Re: [syzbot] [input?] KASAN: null-ptr-deref Read in input_event
From: Hillf Danton
Date: Mon Jan 06 2025 - 07:38:50 EST
On Sun, 05 Jan 2025 00:31:21 -0800
> syzbot found the following issue on:
>
> HEAD commit: f097a36ef88d dt-bindings: usb: qcom,dwc3: Add QCS615 to US..
> git tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17e2a8b0580000
#syz test
--- l/drivers/hid/hid-appleir.c
+++ y/drivers/hid/hid-appleir.c
@@ -150,12 +150,16 @@ static int get_key(int data)
static void key_up(struct hid_device *hid, struct appleir *appleir, int key)
{
+ if (!appleir->input_dev)
+ return;
input_report_key(appleir->input_dev, key, 0);
input_sync(appleir->input_dev);
}
static void key_down(struct hid_device *hid, struct appleir *appleir, int key)
{
+ if (!appleir->input_dev)
+ return;
input_report_key(appleir->input_dev, key, 1);
input_sync(appleir->input_dev);
}
--