diff options
author | Ludvig Michaelsson <ludvig.michaelsson@yubico.com> | 2023-06-21 13:17:43 +0200 |
---|---|---|
committer | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2023-06-21 17:15:48 +0200 |
commit | 944ee77dc6ec7b0afd8ec70ffc418b238c92f12b (patch) | |
tree | b8e3d37f27d397206bb7b666befa0a5689818638 /drivers/hid/hid-ids.h | |
parent | HID: intel-ish-hid: ipc: Add Arrow Lake PCI device ID (diff) | |
download | linux-944ee77dc6ec7b0afd8ec70ffc418b238c92f12b.tar.xz linux-944ee77dc6ec7b0afd8ec70ffc418b238c92f12b.zip |
HID: hidraw: fix data race on device refcount
The hidraw_open() function increments the hidraw device reference
counter. The counter has no dedicated synchronization mechanism,
resulting in a potential data race when concurrently opening a device.
The race is a regression introduced by commit 8590222e4b02 ("HID:
hidraw: Replace hidraw device table mutex with a rwsem"). While
minors_rwsem is intended to protect the hidraw_table itself, by instead
acquiring the lock for writing, the reference counter is also protected.
This is symmetrical to hidraw_release().
Link: https://github.com/systemd/systemd/issues/27947
Fixes: 8590222e4b02 ("HID: hidraw: Replace hidraw device table mutex with a rwsem")
Cc: stable@vger.kernel.org
Signed-off-by: Ludvig Michaelsson <ludvig.michaelsson@yubico.com>
Link: https://lore.kernel.org/r/20230621-hidraw-race-v1-1-a58e6ac69bab@yubico.com
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Diffstat (limited to 'drivers/hid/hid-ids.h')
0 files changed, 0 insertions, 0 deletions