CVE-2024-42236

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

State
Published
Severity
7.8 High
Published
Aug 7, 2024
Updated
Aug 5, 2026
Reserved
Jul 30, 2024

Read the record on cve.org

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.

Scores

CVSSScoreVectorSource
3.17.8 HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HLinux

Weaknesses

The record names no weakness.

Affected Products

ProductVersions
LinuxLinux
  • 88af8bbe4ef781031ad3370847553f3b42ba0076 to before a444c3fc264119801575ab086e03fb4952f23fd0Affected
  • 88af8bbe4ef781031ad3370847553f3b42ba0076 to before c95fbdde87e39e5e0ae27f28bf6711edfb985caaAffected
  • 88af8bbe4ef781031ad3370847553f3b42ba0076 to before e8474a10c535e6a2024c3b06e37e4a3a23beb490Affected
  • 88af8bbe4ef781031ad3370847553f3b42ba0076 to before 72b8ee0d9826e8ed00e0bdfce3e46b98419b37ceAffected
  • 88af8bbe4ef781031ad3370847553f3b42ba0076 to before 2d16f63d8030903e5031853e79d731ee5d474e70Affected
  • 88af8bbe4ef781031ad3370847553f3b42ba0076 to before d1205033e912f9332c1dbefa812e6ceb0575ce0aAffected
  • 88af8bbe4ef781031ad3370847553f3b42ba0076 to before eecfefad0953b2f31aaefa058f7f348ff39c4bbaAffected
  • 88af8bbe4ef781031ad3370847553f3b42ba0076 to before 6d3c721e686ea6c59e18289b400cc95c76e927e0Affected
LinuxLinux
  • 3.10Affected
  • before 3.10Not affected
  • 4.19.318 through 4.19.*Not affected
  • 5.4.280 through 5.4.*Not affected
  • 5.10.222 through 5.10.*Not affected
  • 5.15.163 through 5.15.*Not affected
  • 6.1.100 through 6.1.*Not affected
  • 6.6.41 through 6.6.*Not affected
  • 6.9.10 through 6.9.*Not affected
  • 6.10 and laterNot affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.