mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
HID: hidpp: fix potential UAF in hidpp_connect_event()
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>
This commit is contained in:
parent
b7799c3b6a
commit
6df6b1f2c4
|
|
@ -4295,6 +4295,7 @@ static void hidpp_connect_event(struct work_struct *work)
|
|||
|
||||
ret = input_register_device(input);
|
||||
if (ret) {
|
||||
hidpp->input = NULL;
|
||||
input_free_device(input);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user