]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
HID: logitech-hidpp: Prevent use-after-free on force feedback initialisation failure
authorLee Jones <lee@kernel.org>
Fri, 27 Feb 2026 10:09:38 +0000 (10:09 +0000)
committerBenjamin Tissoires <bentiss@kernel.org>
Mon, 16 Mar 2026 15:21:48 +0000 (16:21 +0100)
commitf7a4c78bfeb320299c1b641500fe7761eadbd101
tree0f25b3ef4b247763e17f1b4f2fc25c044d1c5444
parent2b658c1c442ec1cd9eec5ead98d68662c40fe645
HID: logitech-hidpp: Prevent use-after-free on force feedback initialisation failure

Presently, if the force feedback initialisation fails when probing the
Logitech G920 Driving Force Racing Wheel for Xbox One, an error number
will be returned and propagated before the userspace infrastructure
(sysfs and /dev/input) has been torn down.  If userspace ignores the
errors and continues to use its references to these dangling entities, a
UAF will promptly follow.

We have 2 options; continue to return the error, but ensure that all of
the infrastructure is torn down accordingly or continue to treat this
condition as a warning by emitting the message but returning success.
It is thought that the original author's intention was to emit the
warning but keep the device functional, less the force feedback feature,
so let's go with that.

Signed-off-by: Lee Jones <lee@kernel.org>
Reviewed-by: Günther Noack <gnoack@google.com>
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
drivers/hid/hid-logitech-hidpp.c