{"id":"CVE-2024-42236","summary":"usb: gadget: configfs: Prevent OOB read/write in usb_string_copy()","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nusb: gadget: configfs: Prevent OOB read/write in usb_string_copy()\n\nUserspace provided string 's' could trivially have the length zero. Left\nunchecked this will firstly result in an OOB read in the form\n`if (str[0 - 1] == '\\n') followed closely by an OOB write in the form\n`str[0 - 1] = '\\0'`.\n\nThere is already a validating check to catch strings that are too long.\nLet's supply an additional check for invalid strings that are too short.","modified":"2026-03-20T12:37:39.987488Z","published":"2024-08-07T15:14:25.642Z","related":["SUSE-SU-2024:3189-1","SUSE-SU-2024:3190-1","SUSE-SU-2024:3194-1","SUSE-SU-2024:3195-1","SUSE-SU-2024:3209-1","SUSE-SU-2024:3251-1","SUSE-SU-2024:3252-1","SUSE-SU-2024:3383-1","SUSE-SU-2024:3483-1","SUSE-SU-2025:20044-1","SUSE-SU-2025:20047-1"],"database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/42xxx/CVE-2024-42236.json"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/2d16f63d8030903e5031853e79d731ee5d474e70"},{"type":"WEB","url":"https://git.kernel.org/stable/c/6d3c721e686ea6c59e18289b400cc95c76e927e0"},{"type":"WEB","url":"https://git.kernel.org/stable/c/72b8ee0d9826e8ed00e0bdfce3e46b98419b37ce"},{"type":"WEB","url":"https://git.kernel.org/stable/c/a444c3fc264119801575ab086e03fb4952f23fd0"},{"type":"WEB","url":"https://git.kernel.org/stable/c/c95fbdde87e39e5e0ae27f28bf6711edfb985caa"},{"type":"WEB","url":"https://git.kernel.org/stable/c/d1205033e912f9332c1dbefa812e6ceb0575ce0a"},{"type":"WEB","url":"https://git.kernel.org/stable/c/e8474a10c535e6a2024c3b06e37e4a3a23beb490"},{"type":"WEB","url":"https://git.kernel.org/stable/c/eecfefad0953b2f31aaefa058f7f348ff39c4bba"},{"type":"WEB","url":"https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/42xxx/CVE-2024-42236.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-42236"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"88af8bbe4ef781031ad3370847553f3b42ba0076"},{"fixed":"a444c3fc264119801575ab086e03fb4952f23fd0"},{"fixed":"c95fbdde87e39e5e0ae27f28bf6711edfb985caa"},{"fixed":"e8474a10c535e6a2024c3b06e37e4a3a23beb490"},{"fixed":"72b8ee0d9826e8ed00e0bdfce3e46b98419b37ce"},{"fixed":"2d16f63d8030903e5031853e79d731ee5d474e70"},{"fixed":"d1205033e912f9332c1dbefa812e6ceb0575ce0a"},{"fixed":"eecfefad0953b2f31aaefa058f7f348ff39c4bba"},{"fixed":"6d3c721e686ea6c59e18289b400cc95c76e927e0"}]}],"database_specific":{"source":"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2024-42236.json"}}],"schema_version":"1.7.5"}