Linux Input/HID development
 help / color / mirror / Atom feed
* [PATCH] HID: hidpp: fix potential UAF in hidpp_connect_event()
@ 2026-06-12 15:48 Jiri Kosina
  2026-06-12 16:04 ` sashiko-bot
  0 siblings, 1 reply; 3+ messages in thread
From: Jiri Kosina @ 2026-06-12 15:48 UTC (permalink / raw)
  To: Benjamin Tissoires; +Cc: linux-kernel, linux-input

From: Jiri Kosina <jkosina@suse.com>

If input_register_device() fails, we call input_free_device(), but keep 
stale pointer to the old device in hidpp->input, which could potentially 
lead to UAF. Fix that by resetting it to NULL before returning from 
hidpp_connect_event().

Reported-by: zdi-disclosures@trendmicro.com
Signed-off-by: Jiri Kosina <jkosina@suse.com>

diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
index 1990ba5b26ea..e0dfb7051966 100644
--- a/drivers/hid/hid-logitech-hidpp.c
+++ b/drivers/hid/hid-logitech-hidpp.c
@@ -4295,6 +4295,7 @@ static void hidpp_connect_event(struct work_struct *work)
 	ret = input_register_device(input);
 	if (ret) {
 		input_free_device(input);
+		hidpp->input = NULL;
 		return;
 	}

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-06-12 21:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-12 15:48 [PATCH] HID: hidpp: fix potential UAF in hidpp_connect_event() Jiri Kosina
2026-06-12 16:04 ` sashiko-bot
2026-06-12 21:30   ` Jiri Kosina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox