Skip to main content

Linux Kernel CVE-2026-31412

| EUVDEUVD-2026-21361 MEDIUM
Integer Overflow or Wraparound (CWE-190)
2026-04-10 Linux GHSA-35q9-fp2v-jhcq
5.5
CVSS 3.1 · NVD
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Connect malicious USB host device
  2. Delivery
    Issue crafted SCSI READ/WRITE with oversized data length
  3. Exploit
    Trigger unchecked left shift in check_command_size_in_blocks()
  4. Install
    Integer wraps to truncated value
  5. C2
    Bypass kernel boundary checks
  6. Execute
    Access out-of-bounds kernel memory
  7. Impact
    Crash system or corrupt memory

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Integer overflow checks
MITRE ATT&CK

1 technique across 1 tactic: Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires that the target Linux system has the USB gadget mass storage function enabled - specifically that the usb_f_mass_storage (or legacy g_mass_storage) kernel module is loaded and a gadget configuration is active, which is not the default state on general-purpose Linux distributions. This is primarily relevant to embedded Linux, single-board computers (e.g., Raspberry Pi configured as a gadget), or custom appliances. The attacker must physically connect a USB host they control to the vulnerable gadget device (AV:L). PR:L in the CVSS vector indicates low privilege is required - in this context meaning the attacker controls the USB host side and can issue arbitrary SCSI commands. The overflow is triggered specifically via SCSI READ or WRITE commands carrying oversized data length fields. Exploitation is limited by: mandatory physical USB proximity, the non-default requirement for gadget mass storage mode to be active, and the absence of any remote attack path.

Impact

The CVSS 3.1 score of 5.5 (Medium) with vector AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H formally scopes impact to availability only, but the description explicitly raises the possibility of memory corruption and out-of-bounds accesses - primitives that in practice can sometimes be escalated beyond a denial-of-service. This tension between the CVSS availability-only rating and the described memory safety violation is worth noting; security teams should verify impact scope empirically against their kernel build. The EPSS score of 0.02% (7th percentile) strongly supports low real-world exploitation likelihood, which aligns with the physical-access attack vector: an attacker must control a USB host physically cabled to the target gadget device. The vulnerability is not listed in CISA KEV and no POC is publicly known, placing this firmly in the 'patch when convenient' tier for standard Linux server or desktop deployments. However, organizations operating Linux-based embedded, IoT, or single-board-computer systems in environments with untrusted USB hosts - such as industrial controllers, kiosks, or development boards - face a materially higher risk profile and should treat this as a higher priority. Low EPSS despite a memory-corruption root cause is consistent with the narrow exploitation surface.

Exploit ScenarioDerived

An attacker with physical access to a Linux embedded or IoT system operating in USB gadget mode connects a custom-programmed USB host controller that issues a SCSI READ or WRITE command with an extreme data_size_from_cmnd value. The kernel's check_command_size_in_blocks() performs an unchecked left shift, wrapping the integer and producing a truncated size that passes downstream boundary checks, ultimately corrupting kernel memory or accessing out-of-bounds regions. No public proof-of-concept code is known at time of analysis, but the attack complexity is rated Low once physical USB host access is established.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – May 20, 2026

Integer overflow in the Linux kernel's USB gadget mass storage driver (f_mass_storage) allows a malicious USB host to corrupt kernel memory or trigger out-of-bounds accesses on any Linux system acting as a USB storage gadget. The flaw affects kernel versions tracing back to Linux 3.3 (commit 144974e7f9e32b53b02f6c8632be45d8f43d6ab5), with vendor-released patches now available across multiple stable branches. No public exploit has been identified at time of analysis, and EPSS exploitation probability stands at a very low 0.02%, consistent with the physical USB access prerequisite.

RemediationAI

The primary remediation is to upgrade to a patched Linux kernel stable release: 6.1.167, 6.6.130, 6.12.78, 6.18.19, or 6.19.9. Upstream fix commits are available at 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, and https://git.kernel.org/stable/c/8479891d1f04a8ce55366fe4ca361ccdb96f02e1. For systems that cannot be patched immediately, the most direct compensating control is to unload or blacklist the g_mass_storage or usb_f_mass_storage kernel modules (modprobe -r usb_f_mass_storage), which fully eliminates the attack surface at the cost of disabling USB gadget mass storage functionality. If the gadget mode is operationally required, physically restricting USB port access to trusted hosts is a second-best control, though it is a physical rather than software-enforced boundary.

Affected VersionsENISA

Linux 144974e7f9e32b53b02f6c8632be45d8f43d6ab5 <91817ad5452defe69bc7bc0e355f0ed5d01125cc
Linux patch: 6.18.19
Linux 144974e7f9e32b53b02f6c8632be45d8f43d6ab5 <8479891d1f04a8ce55366fe4ca361ccdb96f02e1
Linux 144974e7f9e32b53b02f6c8632be45d8f43d6ab5 <228b37936376143f4b60cc6828663f6eaceb81b5
Linux patch: 7.0-rc4
Linux patch: 6.19.9
Linux 3.3
Linux 144974e7f9e32b53b02f6c8632be45d8f43d6ab5 <ce0caaed5940162780c5c223b8ae54968a5f059b
Linux patch: 6.1.167
Linux 144974e7f9e32b53b02f6c8632be45d8f43d6ab5 <3428dc5520c811e66622b2f5fa43341bf9a1f8b3
Linux patch: 6.6.130
Linux 144974e7f9e32b53b02f6c8632be45d8f43d6ab5 <387ebb0453b99d71491419a5dc4ab4bee0cacbac
Linux patch: 0
Linux patch: 6.12.78

Affected Packages

euvd linux no fix

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The f_mass_storage driver implements the USB Mass Storage Class within the Linux kernel gadget framework, enabling a Linux system to present itself as a USB storage device to a connected host. The vulnerable function check_command_size_in_blocks() computes the total byte-length of a SCSI transfer by left-shifting common->data_size_from_cmnd by common->curlun->blkbits (the log-base-2 block size). Neither do_scsi_command(), which parses SCSI command fields into data_size_from_cmnd, nor fsg_lun_open(), which sets blkbits during LUN initialization, validates the interaction between these two values against overflow. Under CWE-190 (Integer Overflow or Wraparound), a sufficiently large data_size_from_cmnd combined with a nonzero blkbits shift causes the multiplication-equivalent to wrap around the integer boundary, producing a falsely small result that bypasses downstream size checks. The upstream fix applies the check_shl_overflow() macro to detect and abort the computation on overflow. Affected CPE: cpe:2.3:a:linux:linux:*:*:*:*:*:*:*:*.

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

NVD PRIMARY 5.5 MEDIUM
AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
SUSE MEDIUM

Primary rating from NVD.

CVSS VectorNVD

Attack Vector
Local
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

Lifecycle Timeline

3
CVSS changed
May 20, 2026 - 16:07 NVD
5.5 (MEDIUM)
Patch available
Apr 16, 2026 - 05:29 EUVD
91817ad5452defe69bc7bc0e355f0ed5d01125cc,8479891d1f04a8ce55366fe4ca361ccdb96f02e1,228b37936376143f4b60cc6828663f6eaceb81b5
CVE Published
Apr 10, 2026 - 10:35 nvd
N/A

DescriptionCVE.org

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.

Threat Intelligence Overview

EPSS Score
0.0%
Top 93% exploitable
Social Media
2
Sightings
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation· derived
None
System Exposure· derived
Small
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

28
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +28
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.

Integer overflow occurs when an arithmetic operation produces a result that exceeds the maximum value a given integer type can store.

Vendor StatusVendor

SUSE

Severity: Medium
Product Status
SUSE Linux Enterprise Desktop 15 SP7 Fixed
SUSE Linux Enterprise Desktop 15 SP7 Fixed
SUSE Linux Enterprise High Availability Extension 15 SP7 Fixed
SUSE Linux Enterprise High Availability Extension 15 SP7 Fixed
SUSE Linux Enterprise High Performance Computing 15 SP7 Fixed

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy