{"id":"CVE-2026-64347","summary":"usb: gadget: composite: fix dead empty check in the USB_DT_OTG handler","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nusb: gadget: composite: fix dead empty check in the USB_DT_OTG handler\n\nThe OTG branch of composite_setup() falls back to the first\nconfiguration when none is selected:\n\n\tif (cdev-\u003econfig)\n\t\tconfig = cdev-\u003econfig;\n\telse\n\t\tconfig = list_first_entry(&cdev-\u003econfigs,\n\t\t\t\t\t  struct usb_configuration, list);\n\tif (!config)\n\t\tgoto done;\n\t...\n\tmemcpy(req-\u003ebuf, config-\u003edescriptors[0], value);\n\nlist_first_entry() never returns NULL. On an empty list it returns\ncontainer_of() of the list head. So the \"if (!config)\" check is dead.\n\nWhen cdev-\u003econfigs is empty, config points at the head inside struct\nusb_composite_dev. config-\u003edescriptors[0] reads whatever sits at that\noffset. The memcpy copies up to w_length bytes of it into the response\nbuffer.\n\ncdev-\u003econfigs can be empty in two cases. One is a teardown race on\ngadget unbind with a control transfer in flight. The other is a driver\nthat sets is_otg before it adds a config. A reproducer that holds\ncdev-\u003econfigs empty triggers a KASAN fault in this branch.\n\nUse list_first_entry_or_null() so the existing check does its job.","modified":"2026-07-27T04:03:21.834860Z","published":"2026-07-25T08:50:08.338Z","database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/64xxx/CVE-2026-64347.json","cna_assigner":"Linux"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/01feaf024f29618d5ffa7ab0fd858e0579dcbf7b"},{"type":"WEB","url":"https://git.kernel.org/stable/c/2454264b2ab4cf0055c0bfd39e79f830452bd0db"},{"type":"WEB","url":"https://git.kernel.org/stable/c/56add2b9b2e89ec61c0761165d758f73004fdfdf"},{"type":"WEB","url":"https://git.kernel.org/stable/c/8ac463fe6c0f85bdb1ce8c30e8c9e060802e4483"},{"type":"WEB","url":"https://git.kernel.org/stable/c/91b3ecd34b60f950c50c560974945b6596a6f207"},{"type":"WEB","url":"https://git.kernel.org/stable/c/d3e72cfef2e38bd588055739a8100d14f9773b17"},{"type":"WEB","url":"https://git.kernel.org/stable/c/f8f680609c2b3ab795ffcd6f21585b6dfc46d395"},{"type":"WEB","url":"https://git.kernel.org/stable/c/fcb21bf747640c9d6bd1eda9da85420f076d59c1"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/64xxx/CVE-2026-64347.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-64347"},{"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":"53e6242db8d60da0587d36951cc9434d1a1c21dd"},{"fixed":"2454264b2ab4cf0055c0bfd39e79f830452bd0db"},{"fixed":"d3e72cfef2e38bd588055739a8100d14f9773b17"},{"fixed":"8ac463fe6c0f85bdb1ce8c30e8c9e060802e4483"},{"fixed":"56add2b9b2e89ec61c0761165d758f73004fdfdf"},{"fixed":"91b3ecd34b60f950c50c560974945b6596a6f207"},{"fixed":"01feaf024f29618d5ffa7ab0fd858e0579dcbf7b"},{"fixed":"fcb21bf747640c9d6bd1eda9da85420f076d59c1"},{"fixed":"f8f680609c2b3ab795ffcd6f21585b6dfc46d395"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-64347.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.3.0"},{"fixed":"5.10.261"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.11.0"},{"fixed":"5.15.212"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.16.0"},{"fixed":"6.1.178"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.2.0"},{"fixed":"6.6.145"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.7.0"},{"fixed":"6.12.96"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.13.0"},{"fixed":"6.18.39"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.19.0"},{"fixed":"7.1.4"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-64347.json"}}],"schema_version":"1.7.5"}