CVE-2026-31412
MediumIn 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.
CVSS 3.1 score
5.5
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
Weakness type
CWE-190CVE-2026-31412 is a Integer Overflow vulnerability
What is Integer Overflow?
The product performs a calculation that can produce an integer overflow, leading to unexpected values. Learn more on MITRE CWE
Affected versions
Linux kernel versions
3.3
and later are affected. Fixed in
6.1.167,
6.6.130,
6.12.78,
6.18.19,
6.19.9,
7.0
and their respective stable series.
References
The following references provide additional information about CVE-2026-31412 including vendor advisories, patch commits, exploit details, and third-party analysis. Links are sourced from the NIST NVD database.
-
PatchKernel patch commithttps://git.kernel.org/stable/c/228b37936376143f4b60cc6828663f6eaceb81b5
-
PatchKernel patch commithttps://git.kernel.org/stable/c/3428dc5520c811e66622b2f5fa43341bf9a1f8b3
-
PatchKernel patch commithttps://git.kernel.org/stable/c/387ebb0453b99d71491419a5dc4ab4bee0cacbac
Frequently asked questions
-
What is CVE-2026-31412?
CVE-2026-31412 is a Medium severity Linux kernel vulnerability with a CVSS score of 5.5 out of 10 , classified as an Integer Overflow flaw (CWE-190) . It affects Linux kernel versions from 3.3 onward and has been patched in 6.1.167, 6.6.130, 6.12.78 and others. CVE-2026-31412 has not been confirmed as actively exploited and is not listed in the CISA KEV catalog.
-
What is the CVSS score for CVE-2026-31412?
CVE-2026-31412 has a CVSS score of 5.5 out of 10, rated Medium severity (CVSS 3.1). The vector string is
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H. -
Is there a patch available for CVE-2026-31412?
Yes — CVE-2026-31412 has been patched. Fixed versions include 6.1.167, 6.6.130, 6.12.78 and others. If you are running Linux kernel 3.3 or later up to the fix versions, apply the relevant patch for your kernel branch.
-
Is CVE-2026-31412 actively exploited?
No — CVE-2026-31412 has not been confirmed as actively exploited. It is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog.
-
What is Integer Overflow (CWE-190)?
The product performs a calculation that can produce an integer overflow, leading to unexpected values. View CWE-190 on MITRE CWE →