CVE-2026-31412
usb: gadget: f_mass_storage: Fix potential integer overflow in check_command_size_in_blocks()
Mitigation
- Upgrade Linux to 8479891d1f04a8ce55366fe4ca361ccdb96f02e1 or later.
Who should check
- Anyone running Linux >= 144974e7f9e32b53b02f6c8632be45d8f43d6ab5, < 91817ad5452defe69bc7bc0e355f0ed5d01125cc; >= 144974e7f9e32b53b02f6c8632be45d8f43d6ab5, < ce0caaed5940162780c5c223b8ae54968a5f059b; >= 144974e7f9e32b53b02f6c8632be45d8f43d6ab5, < 228b37936376143f4b60cc6828663f6eaceb81b5; >= 144974e7f9e32b53b02f6c8632be45d8f43d6ab5, < 3428dc5520c811e66622b2f5fa43341bf9a1f8b3; >= 144974e7f9e32b53b02f6c8632be45d8f43d6ab5, < 387ebb0453b99d71491419a5dc4ab4bee0cacbac; >= 144974e7f9e32b53b02f6c8632be45d8f43d6ab5, < 8479891d1f04a8ce55366fe4ca361ccdb96f02e1
- Anyone running Linux 3.3
Vulnerability facts
- Affected
- Linux >= 144974e7f9e32b53b02f6c8632be45d8f43d6ab5, < 91817ad5452defe69bc7bc0e355f0ed5d01125cc; >= 144974e7f9e32b53b02f6c8632be45d8f43d6ab5, < ce0caaed5940162780c5c223b8ae54968a5f059b; >= 144974e7f9e32b53b02f6c8632be45d8f43d6ab5, < 228b37936376143f4b60cc6828663f6eaceb81b5; >= 144974e7f9e32b53b02f6c8632be45d8f43d6ab5, < 3428dc5520c811e66622b2f5fa43341bf9a1f8b3; >= 144974e7f9e32b53b02f6c8632be45d8f43d6ab5, < 387ebb0453b99d71491419a5dc4ab4bee0cacbac; >= 144974e7f9e32b53b02f6c8632be45d8f43d6ab5, < 8479891d1f04a8ce55366fe4ca361ccdb96f02e1; Linux 3.3
- Fixed in
- Linux 91817ad5452defe69bc7bc0e355f0ed5d01125cc, Linux 228b37936376143f4b60cc6828663f6eaceb81b5, Linux 3428dc5520c811e66622b2f5fa43341bf9a1f8b3, Linux 387ebb0453b99d71491419a5dc4ab4bee0cacbac, Linux 8479891d1f04a8ce55366fe4ca361ccdb96f02e1
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Not remotely exploitable (local or adjacent access needed)
- CVSS
- 5.5 (v3.1, NVD)CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Local
- Attack complexity: Low
- Privileges required: Low
- User interaction: None
- Scope: Unchanged
- Confidentiality impact: None
- Integrity impact: None
- Availability impact: High
- EPSS
- 0.18% chance of exploitation in 30 days (percentile 4, 2026-11-26)
- CWE
- CWE-190
- Modified
Description
In the Linux kernel, the following vulnerability has been resolved: usb: gadget: f_mass_storage: Fix potential integer overflow in check_command_size_in_blocks() The `check_command_size_in_blocks()` function calculates the data size in bytes by left shifting `common->data_size_from_cmnd` by the block size (`common->curlun->blkbits`). However, it does not validate whether this shift operation will cause an integer overflow. Initially, the block size is set up in `fsg_lun_open()` , and the `common->data_size_from_cmnd` is set up in `do_scsi_command()`. During initialization, there is no integer overflow check for the interaction between two variables. So if a malicious USB host sends a SCSI READ or WRITE command requesting a large amount of data (`common->data_size_from_cmnd`), the left shift operation can wrap around. This results in a truncated data size, which can bypass boundary checks and potentially lead to memory corruption or out-of-bounds accesses. Fix this by using the check_shl_overflow() macro to safely perform the shift and catch any overflows.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| Linux | >= 144974e7f9e32b53b02f6c8632be45d8f43d6ab5, < 91817ad5452defe69bc7bc0e355f0ed5d01125cc; >= 144974e7f9e32b53b02f6c8632be45d8f43d6ab5, < ce0caaed5940162780c5c223b8ae54968a5f059b; >= 144974e7f9e32b53b02f6c8632be45d8f43d6ab5, < 228b37936376143f4b60cc6828663f6eaceb81b5; >= 144974e7f9e32b53b02f6c8632be45d8f43d6ab5, < 3428dc5520c811e66622b2f5fa43341bf9a1f8b3; >= 144974e7f9e32b53b02f6c8632be45d8f43d6ab5, < 387ebb0453b99d71491419a5dc4ab4bee0cacbac; >= 144974e7f9e32b53b02f6c8632be45d8f43d6ab5, < 8479891d1f04a8ce55366fe4ca361ccdb96f02e1 | — | cvelist |
| Linux | 3.3 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2026-31412. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2026-31412.md Affected: Linux >= 144974e7f9e32b53b02f6c8632be45d8f43d6ab5, < 91817ad5452defe69bc7bc0e355f0ed5d01125cc; >= 144974e7f9e32b53b02f6c8632be45d8f43d6ab5, < ce0caaed5940162780c5c223b8ae54968a5f059b; >= 144974e7f9e32b53b02f6c8632be45d8f43d6ab5, < 228b37936376143f4b60cc6828663f6eaceb81b5; >= 144974e7f9e32b53b02f6c8… Fixed in: Linux 91817ad5452defe69bc7bc0e355f0ed5d01125cc, Linux 228b37936376143f4b60cc6828663f6eaceb81b5, Linux 3428dc5520c811e66622b2f5fa43341bf9a1f8b3, Linux 387ebb0453b99d71491419a5dc4ab4bee0cacbac, Linux 8479891d1f04a8ce55366fe4ca361ccdb96f02e1 Steps: 1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Patches
- https://git.kernel.org/stable/c/91817ad5452defe69bc7bc0e355f0ed5d01125cc
- https://git.kernel.org/stable/c/ce0caaed5940162780c5c223b8ae54968a5f059b
- https://git.kernel.org/stable/c/228b37936376143f4b60cc6828663f6eaceb81b5
- https://git.kernel.org/stable/c/3428dc5520c811e66622b2f5fa43341bf9a1f8b3
- https://git.kernel.org/stable/c/387ebb0453b99d71491419a5dc4ab4bee0cacbac
- https://git.kernel.org/stable/c/8479891d1f04a8ce55366fe4ca361ccdb96f02e1
FAQ
Is CVE-2026-31412 being exploited?
There is no confirmed exploitation: CVE-2026-31412 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.18% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2026-31412?
Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).
Which versions are affected by CVE-2026-31412?
Linux >= 144974e7f9e32b53b02f6c8632be45d8f43d6ab5, < 91817ad5452defe69bc7bc0e355f0ed5d01125cc; >= 144974e7f9e32b53b02f6c8632be45d8f43d6ab5, < ce0caaed5940162780c5c223b8ae54968a5f059b; >= 144974e7f9e32b53b02f6c8632be45d8f43d6ab5, < 228b37936376143f4b60cc6828663f6eaceb81b5; >= 144974e7f9e32b53b02f6c8632be45d8f43d6ab5, < 3428dc5520c811e66622b2f5fa43341bf9a1f8b3; >= 144974e7f9e32b53b02f6c8632be45d8f43d6ab5, < 387ebb0453b99d71491419a5dc4ab4bee0cacbac; >= 144974e7f9e32b53b02f6c8632be45d8f43d6ab5, < 8479891d1f04a8ce55366fe4ca361ccdb96f02e1; Linux 3.3.
Is there a fix for CVE-2026-31412?
Yes. Fixed in Linux 91817ad5452defe69bc7bc0e355f0ed5d01125cc, Linux 228b37936376143f4b60cc6828663f6eaceb81b5, Linux 3428dc5520c811e66622b2f5fa43341bf9a1f8b3, Linux 387ebb0453b99d71491419a5dc4ab4bee0cacbac, Linux 8479891d1f04a8ce55366fe4ca361ccdb96f02e1. Upgrade Linux to 8479891d1f04a8ce55366fe4ca361ccdb96f02e1 or later.
How do I check if I'm affected by CVE-2026-31412?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.