{"id":"CVE-2026-143054","summary":"gpio: virtuser: remove the debugfs files before freeing the line data","details":"In the Linux kernel, the following vulnerability has been resolved:\n\ngpio: virtuser: remove the debugfs files before freeing the line data\n\ngpio_virtuser_probe() registers the devm action that removes the debugfs\ndirectory before it allocates the per-line and per-array data that the\ndebugfs files point to. devres releases resources in reverse order, so\non unbind the line data is freed, the consumer_lock mutex is destroyed\nand the GPIO descriptors are put first, and the debugfs files are only\nremoved afterwards.\n\nA read or write of any of the per-line debugfs files (value, direction,\nconsumer, interrupts, ...) that runs in that window dereferences the\nfreed data. debugfs_remove_recursive() waits for in-flight file\noperations, but by then the data has already been freed.\n\nRunning eight threads that read the per-line debugfs files while\nanother task writes 1 and 0 to the configfs \"live\" attribute triggers\nthis within a second on a KASAN kernel, with gpio-sim as the provider:\n\n  BUG: KASAN: slab-use-after-free in gpio_virtuser_value_get+0x19/0x60\n  Read of size 8 at addr ffff888005109e38 by task vu_race/3479\n  Call Trace:\n   gpio_virtuser_value_get+0x19/0x60\n   simple_attr_read+0x109/0x290\n   debugfs_attr_read+0x5e/0x80\n   full_proxy_read+0xae/0xe0\n   vfs_read+0x1bc/0x7a0\n  Allocated by task 1:\n   devm_kmalloc+0x89/0x1d0\n   gpio_virtuser_probe+0x56f/0x910\n  Freed by task 1:\n   kfree+0x196/0x430\n   release_nodes+0x77/0xa0\n   devres_release_all+0xf3/0x150\n   device_unbind_cleanup+0x18/0x130\n   ...\n   platform_device_unregister+0x3c/0x50\n   gpio_virtuser_device_deactivate+0x3c/0xc0\n\nThe same run also reports use-after-free on the freed consumer_lock\nfrom the consumer attribute.\n\nRegister the debugfs removal action after the line data has been set\nup, so that it runs first on unbind, and remove the directory by hand\non the probe error paths before that point.","modified":"2026-12-03T11:01:03.626810611Z","published":"2026-12-03T09:18:31.475Z","database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/143xxx/CVE-2026-143054.json"},"references":[{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"},{"type":"WEB","url":"https://git.kernel.org/stable/c/37afe25c6e20b71d429feda8ae3ed0b57e4211c8"},{"type":"WEB","url":"https://git.kernel.org/stable/c/3aad9f26babf4579ecb3d44b21305669e40fddf8"},{"type":"WEB","url":"https://git.kernel.org/stable/c/c204a4c377bd43f68b6a3c1d25b455a1e89ed48e"},{"type":"WEB","url":"https://git.kernel.org/stable/c/c2d0710318b8cd57d0ef6088d0ee4bbc1e827fd3"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/143xxx/CVE-2026-143054.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-143054"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"91581c4b3f29e2e22aeb1a62e842d529ca638b2d"},{"fixed":"3aad9f26babf4579ecb3d44b21305669e40fddf8"},{"fixed":"37afe25c6e20b71d429feda8ae3ed0b57e4211c8"},{"fixed":"c204a4c377bd43f68b6a3c1d25b455a1e89ed48e"},{"fixed":"c2d0710318b8cd57d0ef6088d0ee4bbc1e827fd3"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-143054.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"6.11.0"},{"fixed":"6.12.120"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.13.0"},{"fixed":"6.18.66"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.19.0"},{"fixed":"7.3.7"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-143054.json"}}],"schema_version":"1.9.2"}