syzbot


INFO: trying to register non-static key in uhid_char_release

Status: fixed on 2020/09/28 23:05
Reported-by: syzbot+a01edcf7e7543c247fe4@syzkaller.appspotmail.com
Fix commit: 9e5894b7e222 HID: core: Correctly handle ReportSize being zero
First crash: 1599d, last: 1580d
Fix bisection: fixed by (bisect log) :
commit 9e5894b7e2229e6d89319864fb08304571fd44f7
Author: Marc Zyngier <maz@kernel.org>
Date: Sat Aug 29 11:26:01 2020 +0000

  HID: core: Correctly handle ReportSize being zero

  
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 INFO: trying to register non-static key in uhid_char_release C done 3 1580d 1602d 1/1 fixed on 2020/09/28 22:53
upstream INFO: trying to register non-static key in uhid_char_release C done done 26 1578d 1755d 15/28 fixed on 2020/11/16 12:12

Sample crash report:
audit: type=1400 audit(1598712372.252:8): avc:  denied  { execmem } for  pid=6336 comm="syz-executor350" scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=process permissive=1
hid-generic 1000:0000:0000.0001: hidraw0: <UNKNOWN> HID v0.00 Device [syz0] on syz0
hid-generic 1000:0000:0000.0002: hidraw0: <UNKNOWN> HID v0.00 Device [syz0] on syz0
hid-generic 1000:0000:0000.0003: hidraw0: <UNKNOWN> HID v0.00 Device [syz0] on syz0
INFO: trying to register non-static key.
the code is fine but needs lockdep annotation.
turning off the locking correctness validator.
CPU: 1 PID: 6353 Comm: syz-executor350 Not tainted 4.14.195-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x1b2/0x283 lib/dump_stack.c:58
 register_lock_class+0x32b/0x1320 kernel/locking/lockdep.c:768
 __lock_acquire+0x167/0x3f20 kernel/locking/lockdep.c:3378
 lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
 _raw_spin_lock_irqsave+0x8c/0xc0 kernel/locking/spinlock.c:160
 __wake_up_common_lock+0x9d/0x140 kernel/sched/wait.c:124
 uhid_dev_destroy drivers/hid/uhid.c:566 [inline]
 uhid_char_release+0x90/0x180 drivers/hid/uhid.c:645
 __fput+0x25f/0x7a0 fs/file_table.c:210
 task_work_run+0x11f/0x190 kernel/task_work.c:113
 exit_task_work include/linux/task_work.h:22 [inline]
 do_exit+0xa08/0x27f0 kernel/exit.c:865
 do_group_exit+0x100/0x2e0 kernel/exit.c:962
 SYSC_exit_group kernel/exit.c:973 [inline]
 SyS_exit_group+0x19/0x20 kernel/exit.c:971
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x43ff88
RSP: 002b:00007ffc64988aa8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043ff88
RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000
RBP: 00000000004c0930 R08: 00000000000000e7 R09: ffffffffffffffd0
R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000000001
R13: 00000000006d2180 R14: 0000000000000000 R15: 0000000000000000
kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] PREEMPT SMP KASAN
Modules linked in:
CPU: 1 PID: 6353 Comm: syz-executor350 Not tainted 4.14.195-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
task: ffff888097632580 task.stack: ffff888097e98000
RIP: 0010:__wake_up_common+0x9e/0x5d0 kernel/sched/wait.c:90
RSP: 0018:ffff888097e9fba0 EFLAGS: 00010046
RAX: dffffc0000000000 RBX: ffff888098141c88 RCX: 0000000000000000
RDX: 0000000000000001 RSI: 0000000000000001 RDI: 0000000000000000
RBP: 0000000000000001 R08: ffffffffffffffe8 R09: ffff888097e9fc40
R10: 0000000000000001 R11: ffff888097632580 R12: 0000000000000001
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
FS:  0000000000000000(0000) GS:ffff8880aeb00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000004c0968 CR3: 0000000007c6a000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 __wake_up_common_lock+0xba/0x140 kernel/sched/wait.c:125
 uhid_dev_destroy drivers/hid/uhid.c:566 [inline]
 uhid_char_release+0x90/0x180 drivers/hid/uhid.c:645
 __fput+0x25f/0x7a0 fs/file_table.c:210
 task_work_run+0x11f/0x190 kernel/task_work.c:113
 exit_task_work include/linux/task_work.h:22 [inline]
 do_exit+0xa08/0x27f0 kernel/exit.c:865
 do_group_exit+0x100/0x2e0 kernel/exit.c:962
 SYSC_exit_group kernel/exit.c:973 [inline]
 SyS_exit_group+0x19/0x20 kernel/exit.c:971
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x43ff88
RSP: 002b:00007ffc64988aa8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043ff88
RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000
RBP: 00000000004c0930 R08: 00000000000000e7 R09: ffffffffffffffd0
R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000000001
R13: 00000000006d2180 R14: 0000000000000000 R15: 0000000000000000
Code: bf 04 00 00 4c 8b 43 38 49 83 e8 18 49 8d 78 18 48 3b 3c 24 0f 84 6a 02 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 f9 48 c1 e9 03 <80> 3c 01 00 0f 85 a4 04 00 00 49 8b 40 18 89 54 24 10 31 db 48 
RIP: __wake_up_common+0x9e/0x5d0 kernel/sched/wait.c:90 RSP: ffff888097e9fba0
---[ end trace 8d433e78a8546368 ]---

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/08/29 14:47 linux-4.14.y d7e78d08fa77 d5a3ae1f .config console log report syz C ci2-linux-4-14
2020/08/10 11:36 linux-4.14.y 14b58326976d 7adc7b65 .config console log report syz C ci2-linux-4-14
* Struck through repros no longer work on HEAD.