diff options
| author | Denis Benato <denis.benato@linux.dev> | 2026-10-09 11:49:19 +0000 |
|---|---|---|
| committer | Jiri Kosina <jkosina@suse.com> | 2026-10-16 11:39:57 +0200 |
| commit | 6f2204e35a164cb593929918112bb3f217f7ae84 (patch) | |
| tree | 5b8e1990a11cefe454b5aca1456d288915a2b5dc /scripts/decode_stacktrace.sh | |
| parent | 8099f9da59f1c338bf88e25b7aa2a7fdf840879c (diff) | |
HID: asus: document and harden the worker teardown
asus_work() executes actions against the device: they send feature
reports with hid_hw_raw_request() and, for the Fn+F5 fan key fallback,
re-inject the raw report into the HID core with hid_report_raw_event().
For this reason the worker must be quiesced before hid_hw_stop(): after
the low level driver has stopped, the transport is gone (usbhid_stop()
frees the URBs and the I/O buffers) and re-injected reports would race
against the input devices being unregistered by hid_disconnect().
Make so that the teardown cannot race to a use-after-free: every site
queueing an action holds worker->lock across the .removed check, the
list insertion and schedule_work(), and asus_worker_stop() sets .removed
and drains the queue under that same lock before calling
cancel_work_sync(). An action that passed the check is caught by the
latter while any later attempt is discarded by asus_worker_schedule().
Closes: https://lore.kernel.org/all/20260908180032.34C2D1F00A3A@smtp.kernel.org/
Fixes: 47669bec44fe ("HID: asus: refactor the two workqueues and init sequence")
Assisted-by: zcode:glm-5.3-flash
Signed-off-by: Denis Benato <denis.benato@linux.dev>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Diffstat (limited to 'scripts/decode_stacktrace.sh')
0 files changed, 0 insertions, 0 deletions
