general protection fault in saitek_event
syzbot
syzbotHello,
syzbot found the following issue on:
HEAD commit: a5ebb76233b7 Merge tag 'edac_urgent_for_v7.3_rc7' of git:/.. git tree: upstream console+strace: https://syzkaller.appspot.com/x/log.txt?x=14fa29c9580000 kernel config: https://syzkaller.appspot.com/x/.config?x=4118aaa2d227be26 dashboard link: https://syzkaller.appspot.com/bug?extid=eba2b3201bd25a97cddf compiler: Debian clang version 22.1.8 (++20260613092233+e80beda6e255-1~exp1~20260613092250.77), Debian LLD 22.1.8 syz repro: https://syzkaller.appspot.com/x/repro.syz?x=158511d1580000 C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1733f435580000
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/f2a7c6a3f91d/disk-a5ebb762.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/9d9d6d2a348b/vmlinux-a5ebb762.xz
kernel image: https://storage.googleapis.com/syzbot-assets/454e9cb8662e/bzImage-a5ebb762.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Oops: general protection fault, probably for non-canonical address 0xdffffc0000000003: 0000 [#1] SMP KASAN PTI KASAN: null-ptr-deref in range [0x0000000000000018-0x000000000000001f] CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/16/2026 RIP: 0010:saitek_event+0x51/0x2b0 drivers/hid/hid-saitek.c:154 Code: aa f8 49 83 c6 78 4c 89 f0 48 c1 e8 03 42 80 3c 28 00 74 08 4c 89 f7 e8 4d 5a 1b f9 4d 8b 36 49 83 c6 18 4c 89 f0 48 c1 e8 03 <42> 80 3c 28 00 74 08 4c 89 f7 e8 30 5a 1b f9 49 8b 06 48 89 04 24 RSP: 0018:ffffc90000007830 EFLAGS: 00010006 RAX: 0000000000000003 RBX: ffff88801c7ed988 RCX: ffffffff8fa8f000 RDX: 0000000000000100 RSI: 0000000000000100 RDI: ffff8880773c8000 RBP: 000000000000008d R08: 0000000000000000 R09: 0000000000000000 R10: ffff88801c7ed9a8 R11: ffffffff891d95c0 R12: ffffffff910c0c68 R13: dffffc0000000000 R14: 0000000000000018 R15: ffff8880773c8000 FS: 0000000000000000(0000) GS:ffff888123abf000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f50c9650ff8 CR3: 000000007ea2a000 CR4: 00000000003526f0 Call Trace: <IRQ> hid_process_event+0x436/0x620 drivers/hid/hid-core.c:1572 hid_process_report drivers/hid/hid-core.c:1730 [inline] hid_report_raw_event+0xf6a/0x1900 drivers/hid/hid-core.c:2109 __hid_input_report+0x454/0x580 drivers/hid/hid-core.c:2180 hid_ctrl+0x204/0x580 drivers/hid/usbhid/hid-core.c:486 __usb_hcd_giveback_urb+0x378/0x540 drivers/usb/core/hcd.c:1657 dummy_timer+0xa91/0x4cc0 drivers/usb/gadget/udc/dummy_hcd.c:2023 __run_hrtimer kernel/time/hrtimer.c:2074 [inline] __hrtimer_run_queues+0x3bc/0xa10 kernel/time/hrtimer.c:2131 hrtimer_run_softirq+0x1e3/0x2e0 kernel/time/hrtimer.c:2148 handle_softirqs+0x226/0x860 kernel/softirq.c:645 __do_softirq kernel/softirq.c:679 [inline] invoke_softirq kernel/softirq.c:519 [inline] __irq_exit_rcu+0xcb/0x220 kernel/softirq.c:758 irq_exit_rcu+0x9/0x30 kernel/softirq.c:775 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1062 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1062 </IRQ> <TASK> asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:674 RIP: 0010:pv_native_safe_halt+0xf/0x20 arch/x86/kernel/paravirt.c:64 Code: 0b 8b 02 e9 c3 08 03 00 cc cc cc 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa 66 90 0f 00 2d e3 c5 20 00 fb f4 <c3> cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc 90 90 90 90 90 RSP: 0018:ffffffff8fa07ca0 EFLAGS: 00000246 RAX: 00000000000a1669 RBX: ffffffff819becb0 RCX: 8000000000000001 RDX: 0000000000000001 RSI: ffffffff8e4696a9 RDI: ffffffff8c6dde80 RBP: ffffffff8fa07d78 R08: ffff8880b8433a1b R09: 1ffff11017086743 R10: dffffc0000000000 R11: ffffed1017086744 R12: 0000000000000000 R13: 1ffffffff1f51e00 R14: 1ffffffff1f40f9c R15: dffffc0000000000 arch_safe_halt arch/x86/kernel/process.c:767 [inline] default_idle+0x9/0x20 arch/x86/kernel/process.c:768 default_idle_call+0x72/0xb0 kernel/sched/idle.c:122 cpuidle_idle_call kernel/sched/idle.c:199 [inline] do_idle+0x2e0/0x540 kernel/sched/idle.c:355 cpu_startup_entry+0x43/0x60 kernel/sched/idle.c:454 rest_init+0x378/0x3a0 init/main.c:732 start_kernel+0x392/0x3e0 init/main.c:1190 x86_64_start_reservations+0x24/0x30 arch/x86/kernel/head64.c:310 x86_64_start_kernel+0x137/0x1b0 arch/x86/kernel/head64.c:291 common_startup_64+0x13e/0x157 </TASK> Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:saitek_event+0x51/0x2b0 drivers/hid/hid-saitek.c:154 Code: aa f8 49 83 c6 78 4c 89 f0 48 c1 e8 03 42 80 3c 28 00 74 08 4c 89 f7 e8 4d 5a 1b f9 4d 8b 36 49 83 c6 18 4c 89 f0 48 c1 e8 03 <42> 80 3c 28 00 74 08 4c 89 f7 e8 30 5a 1b f9 49 8b 06 48 89 04 24 RSP: 0018:ffffc90000007830 EFLAGS: 00010006 RAX: 0000000000000003 RBX: ffff88801c7ed988 RCX: ffffffff8fa8f000 RDX: 0000000000000100 RSI: 0000000000000100 RDI: ffff8880773c8000 RBP: 000000000000008d R08: 0000000000000000 R09: 0000000000000000 R10: ffff88801c7ed9a8 R11: ffffffff891d95c0 R12: ffffffff910c0c68 R13: dffffc0000000000 R14: 0000000000000018 R15: ffff8880773c8000 FS: 0000000000000000(0000) GS:ffff888123abf000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f50c9650ff8 CR3: 000000007ea2a000 CR4: 00000000003526f0 ---------------- Code disassembly (best guess): 0: aa stos %al,%es:(%rdi) 1: f8 clc 2: 49 83 c6 78 add $0x78,%r14 6: 4c 89 f0 mov %r14,%rax 9: 48 c1 e8 03 shr $0x3,%rax d: 42 80 3c 28 00 cmpb $0x0,(%rax,%r13,1) 12: 74 08 je 0x1c 14: 4c 89 f7 mov %r14,%rdi 17: e8 4d 5a 1b f9 call 0xf91b5a69 1c: 4d 8b 36 mov (%r14),%r14 1f: 49 83 c6 18 add $0x18,%r14 23: 4c 89 f0 mov %r14,%rax 26: 48 c1 e8 03 shr $0x3,%rax * 2a: 42 80 3c 28 00 cmpb $0x0,(%rax,%r13,1) <-- trapping instruction 2f: 74 08 je 0x39 31: 4c 89 f7 mov %r14,%rdi 34: e8 30 5a 1b f9 call 0xf91b5a69 39: 49 8b 06 mov (%r14),%rax 3c: 48 89 04 24 mov %rax,(%rsp)
---
This report is generated by a bot. It may contain errors. See https://goo.gl/tpsmEJ for more information about syzbot. syzbot engineers can be reached at [email protected].
syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.
If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)
If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report
If you want to undo deduplication, reply with:
#syz undup
syzbot
syzbotForwarded: [PATCH] HID: saitek: prevent NULL pointer dereference in saitek_event()
For archival purposes, forwarding an incoming command email to [email protected], [email protected].
For archival purposes, forwarding an incoming command email to [email protected], [email protected].
***
Subject: [PATCH] HID: saitek: prevent NULL pointer dereference in saitek_event()
Author: [email protected]
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
drivers/hid/hid-saitek.c +6 -1
@@ -151,7 +151,12 @@ static int saitek_event(struct hid_device *hdev, struct hid_field *field, struct hid_usage *usage, __s32 value) {struct saitek_sc *ssc =hid_get_drvdata (hdev); -struct input_dev *input = field->hidinput->input; +struct input_dev *input; + +if (!(hdev->claimed &HID_CLAIMED_INPUT ) || !field->hidinput) +return 0 ; + + input = field->hidinput->input; if (usage->type == EV_KEY && value && (((ssc->quirks & SAITEK_RELEASE_MODE_RAT7) &&
syzbot
syzbotForwarded: [PATCH] HID: saitek: prevent NULL pointer dereference in saitek_event()
In reply to syzbotFor archival purposes, forwarding an incoming command email to [email protected], [email protected].
For archival purposes, forwarding an incoming command email to [email protected], [email protected].
***
Subject: [PATCH] HID: saitek: prevent NULL pointer dereference in saitek_event()
Author: [email protected]
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
drivers/hid/hid-saitek.c +6 -1
@@ -151,7 +151,12 @@ static int saitek_event(struct hid_device *hdev, struct hid_field *field, struct hid_usage *usage, __s32 value) {struct saitek_sc *ssc =hid_get_drvdata (hdev); -struct input_dev *input = field->hidinput->input; +struct input_dev *input; + +if (!(hdev->claimed &HID_CLAIMED_INPUT ) || !field->hidinput) +return 0 ; + + input = field->hidinput->input; if (usage->type == EV_KEY && value && (((ssc->quirks & SAITEK_RELEASE_MODE_RAT7) &&