syzbot


general protection fault in chrdev_open

Status: fixed on 2023/08/02 14:36
Reported-by: syzbot+16342c5db3ef64c0f60a@syzkaller.appspotmail.com
Fix commit: 56a7f57da5d0 9p: missing chunk of "fs/9p: Don't update file type when updating file attributes"
First crash: 687d, last: 687d
Cause bisection: failed (error log, bisect log)
  
Discussions (1)
Title Replies (including bot) Last reply
Apply commit "9p: missing chunk of fs/9p: Don't update file type when updating file attributes" to stable 2 (2) 2022/06/16 12:56
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 KASAN: use-after-free Read in chrdev_open C error 14 603d 1168d 0/1 upstream: reported C repro on 2021/02/11 04:55
android-54 general protection fault in chrdev_open C 1 686d 686d 0/2 auto-obsoleted due to no activity on 2023/04/22 08:07
linux-4.14 KASAN: use-after-free Read in chrdev_open C error 4 603d 1176d 0/1 upstream: reported C repro on 2021/02/03 08:18
Last patch testing requests (5)
Created Duration User Patch Repo Result
2022/06/14 19:20 17m tadeusz.struk@linaro.org patch android12-5.10-lts OK log
2022/06/14 18:41 21m tadeusz.struk@linaro.org git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master OK log
2022/06/09 00:04 15m tadeusz.struk@linaro.org patch android12-5.10-lts log
2022/06/08 23:08 12m tadeusz.struk@linaro.org patch android12-5.10-lts log
2022/06/08 16:21 16m tadeusz.struk@linaro.org git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master OK

Sample crash report:
general protection fault, probably for non-canonical address 0xdffffc000000000c: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000060-0x0000000000000067]
CPU: 0 PID: 371 Comm: syz-executor270 Not tainted 5.10.117-syzkaller-00814-gfdd06dc6b0f8 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:cdev_get fs/char_dev.c:350 [inline]
RIP: 0010:chrdev_open+0xb3/0x680 fs/char_dev.c:400
Code: 00 4c 89 fb 48 c1 eb 03 42 80 3c 33 00 74 08 4c 89 ff e8 50 25 f7 ff 4d 8b 2f 4d 85 ed 74 40 49 8d 5d 60 48 89 d8 48 c1 e8 03 <42> 80 3c 30 00 74 08 48 89 df e8 2e 25 f7 ff 48 8b 1b 48 85 db 0f
RSP: 0018:ffffc90000c077a0 EFLAGS: 00010206
RAX: 000000000000000c RBX: 0000000000000062 RCX: 0000000000000001
RDX: 0000000000000001 RSI: 0000000000000004 RDI: ffffc90000c07720
RBP: ffffc90000c07880 R08: dffffc0000000000 R09: 0000000000000003
R10: fffff52000180ee5 R11: 1ffff92000180ee4 R12: 1ffff92000180efc
R13: 0000000000000002 R14: dffffc0000000000 R15: ffff8881199fdbc0
FS:  00005555564453c0(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f652f57e6a8 CR3: 00000001061ab000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 do_dentry_open+0x7a2/0x1090 fs/open.c:819
 vfs_open+0x73/0x80 fs/open.c:942
 do_open fs/namei.c:3327 [inline]
 path_openat+0x2638/0x2fd0 fs/namei.c:3444
 do_filp_open+0x200/0x440 fs/namei.c:3471
 do_sys_openat2+0x13b/0x470 fs/open.c:1211
 do_sys_open fs/open.c:1227 [inline]
 __do_sys_open fs/open.c:1235 [inline]
 __se_sys_open fs/open.c:1231 [inline]
 __x64_sys_open+0x221/0x270 fs/open.c:1231
 do_syscall_64+0x34/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x7f7969805909
Code: 28 c3 e8 5a 14 00 00 66 2e 0f 1f 84 00 00 00 00 00 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 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fffdc1184c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000002
RAX: ffffffffffffffda RBX: 00007fffdc1184d8 RCX: 00007f7969805909
RDX: 0000000000000034 RSI: 0000000000080082 RDI: 0000000020000040
RBP: 00007fffdc1184d0 R08: 00007f79697c3bd0 R09: 00007f79697c3bd0
R10: 00007f79697c3bd0 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
Modules linked in:
---[ end trace 0fd24476f99204e4 ]---
RIP: 0010:cdev_get fs/char_dev.c:350 [inline]
RIP: 0010:chrdev_open+0xb3/0x680 fs/char_dev.c:400
Code: 00 4c 89 fb 48 c1 eb 03 42 80 3c 33 00 74 08 4c 89 ff e8 50 25 f7 ff 4d 8b 2f 4d 85 ed 74 40 49 8d 5d 60 48 89 d8 48 c1 e8 03 <42> 80 3c 30 00 74 08 48 89 df e8 2e 25 f7 ff 48 8b 1b 48 85 db 0f
RSP: 0018:ffffc90000c077a0 EFLAGS: 00010206
RAX: 000000000000000c RBX: 0000000000000062 RCX: 0000000000000001
RDX: 0000000000000001 RSI: 0000000000000004 RDI: ffffc90000c07720
RBP: ffffc90000c07880 R08: dffffc0000000000 R09: 0000000000000003
R10: fffff52000180ee5 R11: 1ffff92000180ee4 R12: 1ffff92000180efc
R13: 0000000000000002 R14: dffffc0000000000 R15: ffff8881199fdbc0
FS:  00005555564453c0(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f652f57e6a8 CR3: 00000001061ab000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	00 4c 89 fb          	add    %cl,-0x5(%rcx,%rcx,4)
   4:	48 c1 eb 03          	shr    $0x3,%rbx
   8:	42 80 3c 33 00       	cmpb   $0x0,(%rbx,%r14,1)
   d:	74 08                	je     0x17
   f:	4c 89 ff             	mov    %r15,%rdi
  12:	e8 50 25 f7 ff       	callq  0xfff72567
  17:	4d 8b 2f             	mov    (%r15),%r13
  1a:	4d 85 ed             	test   %r13,%r13
  1d:	74 40                	je     0x5f
  1f:	49 8d 5d 60          	lea    0x60(%r13),%rbx
  23:	48 89 d8             	mov    %rbx,%rax
  26:	48 c1 e8 03          	shr    $0x3,%rax
* 2a:	42 80 3c 30 00       	cmpb   $0x0,(%rax,%r14,1) <-- trapping instruction
  2f:	74 08                	je     0x39
  31:	48 89 df             	mov    %rbx,%rdi
  34:	e8 2e 25 f7 ff       	callq  0xfff72567
  39:	48 8b 1b             	mov    (%rbx),%rbx
  3c:	48 85 db             	test   %rbx,%rbx
  3f:	0f                   	.byte 0xf

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/06/07 16:04 android12-5.10-lts fdd06dc6b0f8 b2706118 .config strace log report syz C ci2-android-5-10 general protection fault in chrdev_open
* Struck through repros no longer work on HEAD.