CVE-2024-42236

usb: gadget: configfs: Prevent OOB read/write in usb_string_copy()

MEDIUM
5.5
CVSS Score
Published: August 7, 2024 at 03:14 PM UTC
Updated: August 5, 2026 at 12:04 PM UTC
1 product affected across 1 vendorLinux Kernel

Using Linux by Linux?

Get instant alerts when new vulnerabilities affect Linux - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM5.5
Exploit prediction
EPSS 0.2%
SSVC
No known exploit

Description

In the Linux kernel, the following vulnerability has been resolved: usb: gadget: configfs: Prevent OOB read/write in usb_string_copy() Userspace provided string 's' could trivially have the length zero. Left unchecked this will firstly result in an OOB read in the form `if (str[0 - 1] == '\n') followed closely by an OOB write in the form `str[0 - 1] = '\0'`. There is already a validating check to catch strings that are too long. Let's supply an additional check for invalid strings that are too short.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v < 4.19.3183.10 ≤ v < 4.19.3183.10 ≤ v < 5.10.2223.10 ≤ v < 5.15.1633.10 ≤ v < 5.4.2803.10 ≤ v < 6.1.1003.10 ≤ v < 6.103.10 ≤ v < 6.6.413.10 ≤ v < 6.9.104.20 ≤ v < 5.4.2805.11 ≤ v < 5.15.1635.16 ≤ v < 6.1.1005.5 ≤ v < 5.10.2226.2 ≤ v < 6.6.416.7 ≤ v < 6.9.103.1088af8bbe4ef781031ad3370847553f3b42ba0076
Vendor states this is fixed in 2d16f63d8030903e5031853e79d731ee5d474e70 (fixed)
Vendor states this is fixed in 6d3c721e686ea6c59e18289b400cc95c76e927e0 (fixed)
Vendor states this is fixed in 72b8ee0d9826e8ed00e0bdfce3e46b98419b37ce (fixed)
Vendor states this is fixed in a444c3fc264119801575ab086e03fb4952f23fd0 (fixed)
Vendor states this is fixed in c95fbdde87e39e5e0ae27f28bf6711edfb985caa (fixed)
Vendor states this is fixed in d1205033e912f9332c1dbefa812e6ceb0575ce0a (fixed)
Vendor states this is fixed in e8474a10c535e6a2024c3b06e37e4a3a23beb490 (fixed)
Vendor states this is fixed in eecfefad0953b2f31aaefa058f7f348ff39c4bba (fixed)
Vendor states this is fixed in 3.10 (unaffected)
Vendor states this is fixed in 4.19.318 (unaffected)
Vendor states this is fixed in 5.10.222 (unaffected)
Vendor states this is fixed in 5.15.163 (unaffected)
Vendor states this is fixed in 5.4.280 (unaffected)
Vendor states this is fixed in 6.1.100 (unaffected)
Vendor states this is fixed in 6.10 (unaffected)
Vendor states this is fixed in 6.6.41 (unaffected)
Vendor states this is fixed in 6.9.10 (unaffected)

References (9)

Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/2d16f63d8030903e5031853e79d731ee5d474e70
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/6d3c721e686ea6c59e18289b400cc95c76e927e0
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/72b8ee0d9826e8ed00e0bdfce3e46b98419b37ce
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/a444c3fc264119801575ab086e03fb4952f23fd0
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/c95fbdde87e39e5e0ae27f28bf6711edfb985caa
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/d1205033e912f9332c1dbefa812e6ceb0575ce0a
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/e8474a10c535e6a2024c3b06e37e4a3a23beb490
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/eecfefad0953b2f31aaefa058f7f348ff39c4bba

SSVC — Action Prioritization

SSVCNo known exploitNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

Attack Vector
LOCAL
Complexity
LOW
Privileges
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
NONE
Integrity
NONE
Availability
HIGH
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-787

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card