syzbot


general protection fault in evdev_connect

Status: closed as dup on 2023/09/04 07:56
Subsystems: kernel
[Documentation on labels]
Reported-by: syzbot+f31b0633f7ca73e2d726@syzkaller.appspotmail.com
First crash: 476d, last: 462d
Cause bisection: introduced by (bisect log) :
commit d21fdd07cea418c0d98c8a15fc95b8b8970801e7
Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: Thu Aug 17 09:12:21 2023 +0000

  driver core: Return proper error code when dev_set_name() fails

Crash: BUG: unable to handle kernel NULL pointer dereference in evdev_connect (log)
Repro: C syz .config
  
Duplicate of
Title Repro Cause bisect Fix bisect Count Last Reported
general protection fault in netdev_register_kobject kernel C done 512 444d 478d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [kernel?] general protection fault in evdev_connect 1 (2) 2023/09/04 07:56

Sample crash report:
RAX: ffffffffffffffda RBX: 00007ffe11022490 RCX: 00007fc4df48fd79
RDX: 0000000000000000 RSI: 0000000000005501 RDI: 0000000000000003
RBP: 0000000000000002 R08: 00007ffe11022216 R09: 00000000000000a0
R10: 0000000000000002 R11: 0000000000000246 R12: 0000000000000001
R13: 431bde82d7b634db R14: 0000000000000001 R15: 0000000000000001
 </TASK>
general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
CPU: 0 PID: 5043 Comm: syz-executor229 Not tainted 6.5.0-syzkaller-11938-g65d6e954e378 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023
RIP: 0010:strchr+0x1b/0xb0 lib/string.c:329
Code: f6 ad f7 48 8b 74 24 08 48 8b 14 24 eb 89 90 f3 0f 1e fa 48 b8 00 00 00 00 00 fc ff df 48 89 fa 55 48 c1 ea 03 53 48 83 ec 10 <0f> b6 04 02 48 89 fa 83 e2 07 38 d0 7f 04 84 c0 75 51 0f b6 07 89
RSP: 0018:ffffc90003acfa38 EFLAGS: 00010282
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000025 RDI: 0000000000000000
RBP: ffffc90003acfac8 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: ffffffff8a60008b R12: ffffc90003acfac8
R13: 0000000000000cc0 R14: ffff8880211cd2f0 R15: 0000000000000001
FS:  0000555555857380(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fc4df4c2c80 CR3: 00000000778b7000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 kvasprintf_const+0x25/0x190 lib/kasprintf.c:45
 kobject_set_name_vargs+0x5a/0x130 lib/kobject.c:272
 kobject_add_varg lib/kobject.c:366 [inline]
 kobject_add+0x12a/0x240 lib/kobject.c:424
 device_add+0x290/0x1ac0 drivers/base/core.c:3560
 cdev_device_add+0x12b/0x270 fs/char_dev.c:556
 evdev_connect+0x3a0/0x4c0 drivers/input/evdev.c:1386
 input_attach_handler.isra.0+0x17c/0x250 drivers/input/input.c:1064
 input_register_device+0xb1e/0x1130 drivers/input/input.c:2396
 uinput_create_device drivers/input/misc/uinput.c:365 [inline]
 uinput_ioctl_handler.isra.0+0x1308/0x1d70 drivers/input/misc/uinput.c:904
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:871 [inline]
 __se_sys_ioctl fs/ioctl.c:857 [inline]
 __x64_sys_ioctl+0x18f/0x210 fs/ioctl.c:857
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fc4df48fd79
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 c1 17 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffe11022478 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007ffe11022490 RCX: 00007fc4df48fd79
RDX: 0000000000000000 RSI: 0000000000005501 RDI: 0000000000000003
RBP: 0000000000000002 R08: 00007ffe11022216 R09: 00000000000000a0
R10: 0000000000000002 R11: 0000000000000246 R12: 0000000000000001
R13: 431bde82d7b634db R14: 0000000000000001 R15: 0000000000000001
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:strchr+0x1b/0xb0 lib/string.c:329
Code: f6 ad f7 48 8b 74 24 08 48 8b 14 24 eb 89 90 f3 0f 1e fa 48 b8 00 00 00 00 00 fc ff df 48 89 fa 55 48 c1 ea 03 53 48 83 ec 10 <0f> b6 04 02 48 89 fa 83 e2 07 38 d0 7f 04 84 c0 75 51 0f b6 07 89
RSP: 0018:ffffc90003acfa38 EFLAGS: 00010282
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000025 RDI: 0000000000000000
RBP: ffffc90003acfac8 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: ffffffff8a60008b R12: ffffc90003acfac8
R13: 0000000000000cc0 R14: ffff8880211cd2f0 R15: 0000000000000001
FS:  0000555555857380(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055af4454a0b8 CR3: 00000000778b7000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	f6 ad f7 48 8b 74    	imulb  0x748b48f7(%rbp)
   6:	24 08                	and    $0x8,%al
   8:	48 8b 14 24          	mov    (%rsp),%rdx
   c:	eb 89                	jmp    0xffffff97
   e:	90                   	nop
   f:	f3 0f 1e fa          	endbr64
  13:	48 b8 00 00 00 00 00 	movabs $0xdffffc0000000000,%rax
  1a:	fc ff df
  1d:	48 89 fa             	mov    %rdi,%rdx
  20:	55                   	push   %rbp
  21:	48 c1 ea 03          	shr    $0x3,%rdx
  25:	53                   	push   %rbx
  26:	48 83 ec 10          	sub    $0x10,%rsp
* 2a:	0f b6 04 02          	movzbl (%rdx,%rax,1),%eax <-- trapping instruction
  2e:	48 89 fa             	mov    %rdi,%rdx
  31:	83 e2 07             	and    $0x7,%edx
  34:	38 d0                	cmp    %dl,%al
  36:	7f 04                	jg     0x3c
  38:	84 c0                	test   %al,%al
  3a:	75 51                	jne    0x8d
  3c:	0f b6 07             	movzbl (%rdi),%eax
  3f:	89                   	.byte 0x89

Crashes (23):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/09/06 14:48 upstream 65d6e954e378 8bc9053e .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in evdev_connect
2023/09/06 14:20 upstream 65d6e954e378 8bc9053e .config console log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in evdev_connect
2023/09/06 09:48 upstream 7733171926cc 8bc9053e .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in evdev_connect
2023/09/02 08:08 upstream b84acc11b1c9 696ea0d2 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root general protection fault in evdev_connect
2023/09/02 14:12 upstream 0468be89b3fa 696ea0d2 .config console log report syz C [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream general protection fault in evdev_connect
2023/09/02 13:42 upstream 0468be89b3fa 696ea0d2 .config console log report syz C [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 general protection fault in evdev_connect
2023/09/15 20:34 upstream 9fdfb15a3dbf 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root general protection fault in evdev_connect
2023/09/13 14:42 upstream 3669558bdf35 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root general protection fault in evdev_connect
2023/09/12 02:05 upstream 0bb80ecc33a8 59da8366 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root general protection fault in evdev_connect
2023/09/11 00:31 upstream 535a265d7f0d 6654cf89 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root general protection fault in evdev_connect
2023/09/11 00:01 upstream 535a265d7f0d 6654cf89 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root general protection fault in evdev_connect
2023/09/06 04:24 upstream 7733171926cc 8bc9053e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in evdev_connect
2023/09/05 17:24 upstream 3f86ed6ec0b3 8bc9053e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root general protection fault in evdev_connect
2023/09/03 10:02 upstream 92901222f83d 696ea0d2 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root general protection fault in evdev_connect
2023/09/02 07:47 upstream b84acc11b1c9 696ea0d2 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root general protection fault in evdev_connect
2023/09/14 22:19 upstream 9fdfb15a3dbf 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 general protection fault in evdev_connect
2023/09/08 09:43 upstream ff6e6ded5472 72324844 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream general protection fault in evdev_connect
2023/09/16 20:25 upstream 57d88e8a5974 0b6a67ac .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 general protection fault in evdev_connect
2023/09/13 01:44 upstream a747acc0b752 59da8366 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 general protection fault in evdev_connect
2023/09/11 00:23 upstream e56b2b605799 6654cf89 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 general protection fault in evdev_connect
2023/09/09 13:46 upstream 32bf43e4efdb 6654cf89 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 general protection fault in evdev_connect
2023/09/03 00:12 upstream fdde61878047 696ea0d2 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 general protection fault in evdev_connect
2023/09/02 13:59 upstream 0468be89b3fa 696ea0d2 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 general protection fault in evdev_connect
* Struck through repros no longer work on HEAD.