CVE-2024-42236
JSON

7.8high

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

Severity
7.8high CVSS:3.1 by Linux
Exploit likelihood
0.24% (higher than 16% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
Linux

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

Product or packageVersionsReported by
Linux Linuxfrom 88af8bbe4ef781031ad3370847553f3b42ba0076 before a444c3fc264119801575ab086e03fb4952f23fd0, from 88af8bbe4ef781031ad3370847553f3b42ba0076 before c95fbdde87e39e5e0ae27f28bf6711edfb985caa, from 88af8bbe4ef781031ad3370847553f3b42ba0076 before e8474a10c535e6a2024c3b06e37e4a3a23beb490, from 88af8bbe4ef781031ad3370847553f3b42ba0076 before 72b8ee0d9826e8ed00e0bdfce3e46b98419b37ce, from 88af8bbe4ef781031ad3370847553f3b42ba0076 before 2d16f63d8030903e5031853e79d731ee5d474e70, from 88af8bbe4ef781031ad3370847553f3b42ba0076 before d1205033e912f9332c1dbefa812e6ceb0575ce0a, from 88af8bbe4ef781031ad3370847553f3b42ba0076 before eecfefad0953b2f31aaefa058f7f348ff39c4bba, from 88af8bbe4ef781031ad3370847553f3b42ba0076 before 6d3c721e686ea6c59e18289b400cc95c76e927e0 and 1 more
Not affected: before 3.10, from 4.19.318 up to 4.19.*, from 5.4.280 up to 5.4.*, from 5.10.222 up to 5.10.*, from 5.15.163 up to 5.15.*, from 6.1.100 up to 6.1.*
CVE List
linux linux_kernelbefore 4.19.318, from 4.20 before 5.4.280, from 5.5 before 5.10.222, from 5.11 before 5.15.163, from 5.16 before 6.1.100, from 6.2 before 6.6.41, from 6.7 before 6.9.10NVD

All scores

Linux7.8high CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
NVD5.5medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

Classification

CWE-787

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

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.

NVD (es)

En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: usb: gadget: configfs: Evitar lectura/escritura OOB en usb_string_copy() Las cadenas 's' proporcionadas por el espacio de usuario podrían tener trivialmente una longitud cero. Si no se marca, esto dará como resultado en primer lugar una lectura OOB en el formato `if (str[0 - 1] == '\n') seguida de cerca por una escritura OOB en el formato `str[0 - 1] = '\0' `. Ya existe una verificación de validación para detectar cadenas que son demasiado largas. Proporcionemos una verificación adicional para cadenas no válidas que sean demasiado cortas.

References

Sources

SourceRecordLicence
CVE ListCVE-2024-42236 changed 2026-08-05CVE Terms of Use
NVDCVE-2024-42236 changed 2026-08-04Public domain