* CVE-2026-143054: gpio: virtuser: remove the debugfs files before freeing the line data
@ 2026-12-03 9:18 Greg Kroah-Hartman
0 siblings, 0 replies; only message in thread
From: Greg Kroah-Hartman @ 2026-12-03 9:18 UTC (permalink / raw)
To: linux-cve-announce; +Cc: Greg Kroah-Hartman
From: Greg Kroah-Hartman <gregkh@kernel.org>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
gpio: virtuser: remove the debugfs files before freeing the line data
gpio_virtuser_probe() registers the devm action that removes the debugfs
directory before it allocates the per-line and per-array data that the
debugfs files point to. devres releases resources in reverse order, so
on unbind the line data is freed, the consumer_lock mutex is destroyed
and the GPIO descriptors are put first, and the debugfs files are only
removed afterwards.
A read or write of any of the per-line debugfs files (value, direction,
consumer, interrupts, ...) that runs in that window dereferences the
freed data. debugfs_remove_recursive() waits for in-flight file
operations, but by then the data has already been freed.
Running eight threads that read the per-line debugfs files while
another task writes 1 and 0 to the configfs "live" attribute triggers
this within a second on a KASAN kernel, with gpio-sim as the provider:
BUG: KASAN: slab-use-after-free in gpio_virtuser_value_get+0x19/0x60
Read of size 8 at addr ffff888005109e38 by task vu_race/3479
Call Trace:
gpio_virtuser_value_get+0x19/0x60
simple_attr_read+0x109/0x290
debugfs_attr_read+0x5e/0x80
full_proxy_read+0xae/0xe0
vfs_read+0x1bc/0x7a0
Allocated by task 1:
devm_kmalloc+0x89/0x1d0
gpio_virtuser_probe+0x56f/0x910
Freed by task 1:
kfree+0x196/0x430
release_nodes+0x77/0xa0
devres_release_all+0xf3/0x150
device_unbind_cleanup+0x18/0x130
...
platform_device_unregister+0x3c/0x50
gpio_virtuser_device_deactivate+0x3c/0xc0
The same run also reports use-after-free on the freed consumer_lock
from the consumer attribute.
Register the debugfs removal action after the line data has been set
up, so that it runs first on unbind, and remove the directory by hand
on the probe error paths before that point.
The Linux kernel CVE team has assigned CVE-2026-143054 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.11 with commit 91581c4b3f29e2e22aeb1a62e842d529ca638b2d and fixed in 6.12.120 with commit 3aad9f26babf4579ecb3d44b21305669e40fddf8
Issue introduced in 6.11 with commit 91581c4b3f29e2e22aeb1a62e842d529ca638b2d and fixed in 6.18.66 with commit 37afe25c6e20b71d429feda8ae3ed0b57e4211c8
Issue introduced in 6.11 with commit 91581c4b3f29e2e22aeb1a62e842d529ca638b2d and fixed in 7.3.7 with commit c204a4c377bd43f68b6a3c1d25b455a1e89ed48e
Issue introduced in 6.11 with commit 91581c4b3f29e2e22aeb1a62e842d529ca638b2d and fixed in 7.4-rc3 with commit c2d0710318b8cd57d0ef6088d0ee4bbc1e827fd3
Please see https://www.kernel.org for a full list of currently supported
kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to
older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-143054
will be updated if fixes are backported, please check that for the most
up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
drivers/gpio/gpio-virtuser.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest
stable kernel version for this, and many other bugfixes. Individual
changes are never tested alone, but rather are part of a larger kernel
release. Cherry-picking individual commits is not recommended or
supported by the Linux kernel community at all. If however, updating to
the latest release is impossible, the individual changes to resolve this
issue can be found at these commits:
https://git.kernel.org/stable/c/3aad9f26babf4579ecb3d44b21305669e40fddf8
https://git.kernel.org/stable/c/37afe25c6e20b71d429feda8ae3ed0b57e4211c8
https://git.kernel.org/stable/c/c204a4c377bd43f68b6a3c1d25b455a1e89ed48e
https://git.kernel.org/stable/c/c2d0710318b8cd57d0ef6088d0ee4bbc1e827fd3
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-12-03 9:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03 9:18 CVE-2026-143054: gpio: virtuser: remove the debugfs files before freeing the line data Greg Kroah-Hartman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.