diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2025-03-11 08:24:16 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-05-02 09:02:14 +0300 |
commit | 3781e4b83e174364998855de777e184cf0b62c40 (patch) | |
tree | 4672d88a56c1d58c05b576cdd3b0b7c77b5528c3 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | eb48703f5c5bec393e942159279187a4dee277cc (diff) | |
download | linux-3781e4b83e174364998855de777e184cf0b62c40.tar.xz |
driver core: fix potential NULL pointer dereference in dev_uevent()
commit 18daa52418e7e4629ed1703b64777294209d2622 upstream.
If userspace reads "uevent" device attribute at the same time as another
threads unbinds the device from its driver, change to dev->driver from a
valid pointer to NULL may result in crash. Fix this by using READ_ONCE()
when fetching the pointer, and take bus' drivers klist lock to make sure
driver instance will not disappear while we access it.
Use WRITE_ONCE() when setting the driver pointer to ensure there is no
tearing.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Link: https://lore.kernel.org/r/20250311052417.1846985-3-dmitry.torokhov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions