Skip to content
Commit 9c9e54a8 authored by Jiri Kosina's avatar Jiri Kosina
Browse files

HID: hiddev: fix memory corruption due to invalid intfdata



Commit bd25f4dd ("HID: hiddev: use usb_find_interface,
get rid of BKL") introduced using of private intfdata in hiddev for
purpose of storing hiddev pointer.

This is a problem, because intf pointer is already being set to struct
hid_device pointer by HID core. This obviously lead to memory corruptions
at device disconnect time, such as

WARNING: at lib/kobject.c:595 kobject_put+0x37/0x4b()
kobject: '(null)' (ffff88011e9cd898): is not initialized, yet kobject_put() is being called.

Convert hiddev into accessing hiddev through struct hid_device which is
in intfdata already.

Reported-and-tested-by: default avatarMarkus Trippelsdorf <markus@trippelsdorf.de>
Reported-and-tested-by: default avatarHeinz Diehl <htd@fritha.org>
Reported-and-tested-by: default avatarAlan Ott <alan@signal11.us>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 7032269e
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment