mirror of
https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux-stable.git
synced 2025-09-26 17:10:55 +10:00
HID: hid-ntrig: fix unable to handle page fault in ntrig_report_version()
commit 185c926283
upstream.
in ntrig_report_version(), hdev parameter passed from hid_probe().
sending descriptor to /dev/uhid can make hdev->dev.parent->parent to null
if hdev->dev.parent->parent is null, usb_dev has
invalid address(0xffffffffffffff58) that hid_to_usb_dev(hdev) returned
when usb_rcvctrlpipe() use usb_dev,it trigger
page fault error for address(0xffffffffffffff58)
add null check logic to ntrig_report_version()
before calling hid_to_usb_dev()
Signed-off-by: Minjong Kim <minbell.kim@samsung.com>
Link: https://patch.msgid.link/20250813-hid-ntrig-page-fault-fix-v2-1-f98581f35106@samsung.com
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
b9166ea27d
commit
e422370e6a
@ -144,6 +144,9 @@ static void ntrig_report_version(struct hid_device *hdev)
|
||||
struct usb_device *usb_dev = hid_to_usb_dev(hdev);
|
||||
unsigned char *data = kmalloc(8, GFP_KERNEL);
|
||||
|
||||
if (!hid_is_usb(hdev))
|
||||
return;
|
||||
|
||||
if (!data)
|
||||
goto err_free;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user