diff options
| author | Lee Jones <lee@kernel.org> | 2026-09-09 11:12:26 +0000 |
|---|---|---|
| committer | Jiri Kosina <jkosina@suse.com> | 2026-09-11 15:47:03 +0200 |
| commit | 3a523ecf9ac3fdd33f5eb31c43937ee44135395b (patch) | |
| tree | 2e8ebf9c2c964ee0620a20fd2090c7ee4da01aee /tools/perf/scripts/python | |
| parent | ef32877368a7013c060ef6bd03a30b6da2fe0c41 (diff) | |
HID: wacom: Fix Use-After-Free in wacom_bamboo_pad
wacom_bamboo_pad_pen_event() accesses wacom->shared->pen locklessly
relative to wacom_remove_shared_data() which nullifies it. This
can lead to a Use-After-Free if the sibling device is removed while
events are being processed.
Resolve this by introducing RCU protection for pen and touch
pointers:
- Annotate 'pen' and 'touch' in wacom_shared struct with __rcu.
- Wrap lockless readers in wacom_bamboo_pad_pen_event() with
rcu_read_lock() and rcu_dereference().
- Update writers in wacom_sys.c using rcu_assign_pointer().
- Use rcu_dereference_protected for comparisons under
wacom_udev_list_lock.
- Also use rcu_access_pointer in wacom_sibling_pending() and
wacom_mode_change_work() to avoid warnings (while lockless access in
the latter remains a pre-existing issue).
Cc: stable@vger.kernel.org
Fixes: 8c97a765467c ("HID: wacom: add full support of the Wacom Bamboo PAD")
Signed-off-by: Lee Jones <lee@kernel.org>
Acked-by: Ping Cheng <ping.cheng@wacom.com>
Tested-by: Ping Cheng <ping.cheng@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
