syzbot


general protection fault in kernfs_find_ns (2)

Status: upstream: reported C repro on 2021/10/24 20:02
Reported-by: syzbot+d1074aaa6bf5e1eb925c@syzkaller.appspotmail.com
First crash: 402d, last: 243d
similar bugs (2):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream general protection fault in kernfs_find_ns 2 367d 361d 0/24 auto-closed as invalid on 2022/03/29 00:22
android-54 general protection fault in kernfs_find_ns 1 558d 558d 0/2 auto-closed as invalid on 2021/09/18 09:16

Sample crash report:
RAX: ffffffffffffffda RBX: 0000000000006836 RCX: 00007f80bedeb079
RDX: 0000000000000000 RSI: 0000000000004c81 RDI: 0000000000000003
RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000001
R10: 00007ffc7f375ed0 R11: 0000000000000246 R12: 00007ffc7f37646c
R13: 431bde82d7b634db R14: 0000000000000000 R15: 0000000000000000
---[ end trace bc09616a01caeb4a ]---
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
CPU: 1 PID: 304 Comm: syz-executor625 Tainted: G        W         5.4.147-syzkaller-00015-g5b673be0c6b0 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:strlen+0x27/0x60 lib/string.c:551 lib/string.c:551
Code: 0f 1f 00 41 57 41 56 53 49 89 fe 49 bf 00 00 00 00 00 fc ff df 48 89 f8 66 66 2e 0f 1f 84 00 00 00 00 00 48 89 c3 48 c1 e8 03 <42> 0f b6 04 38 84 c0 75 0b 48 8d 43 01 80 3b 00 75 e7 eb 13 89 d9
RSP: 0018:ffff8881de577cd0 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000001
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: ffffffff81b1b57b R09: ffffed103bcaefa0
R10: ffffed103bcaefa0 R11: 0000000000000000 R12: ffff8881f18e4640
R13: 0000000000000000 R14: 0000000000000000 R15: dffffc0000000000
FS:  0000555555d28300(0000) GS:ffff8881f6f00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f80bee5c130 CR3: 00000001de43a000 CR4: 00000000003406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 kernfs_name_hash fs/kernfs/dir.c:302 [inline]
 kernfs_name_hash fs/kernfs/dir.c:302 [inline] fs/kernfs/dir.c:847
 kernfs_find_ns+0x83/0x430 fs/kernfs/dir.c:847 fs/kernfs/dir.c:847
 kernfs_remove_by_name_ns+0x32/0x90 fs/kernfs/dir.c:1510 fs/kernfs/dir.c:1510
 del_gendisk+0x93d/0xb70 block/genhd.c:833 block/genhd.c:833
 loop_remove drivers/block/loop.c:2189 [inline]
 loop_remove drivers/block/loop.c:2189 [inline] drivers/block/loop.c:2288
 loop_control_ioctl+0x563/0x680 drivers/block/loop.c:2288 drivers/block/loop.c:2288
 do_vfs_ioctl+0x6fb/0x15b0 fs/ioctl.c:47 fs/ioctl.c:47
 ksys_ioctl fs/ioctl.c:742 [inline]
 __do_sys_ioctl fs/ioctl.c:749 [inline]
 __se_sys_ioctl fs/ioctl.c:747 [inline]
 ksys_ioctl fs/ioctl.c:742 [inline] fs/ioctl.c:747
 __do_sys_ioctl fs/ioctl.c:749 [inline] fs/ioctl.c:747
 __se_sys_ioctl fs/ioctl.c:747 [inline] fs/ioctl.c:747
 __x64_sys_ioctl+0xd4/0x110 fs/ioctl.c:747 fs/ioctl.c:747
 do_syscall_64+0xcb/0x1e0 arch/x86/entry/common.c:290 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x7f80bedeb079
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 b1 14 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 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffc7f376458 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000006836 RCX: 00007f80bedeb079
RDX: 0000000000000000 RSI: 0000000000004c81 RDI: 0000000000000003
RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000001
R10: 00007ffc7f375ed0 R11: 0000000000000246 R12: 00007ffc7f37646c
R13: 431bde82d7b634db R14: 0000000000000000 R15: 0000000000000000
Modules linked in:
---[ end trace bc09616a01caeb4b ]---
RIP: 0010:strlen+0x27/0x60 lib/string.c:551 lib/string.c:551
Code: 0f 1f 00 41 57 41 56 53 49 89 fe 49 bf 00 00 00 00 00 fc ff df 48 89 f8 66 66 2e 0f 1f 84 00 00 00 00 00 48 89 c3 48 c1 e8 03 <42> 0f b6 04 38 84 c0 75 0b 48 8d 43 01 80 3b 00 75 e7 eb 13 89 d9
RSP: 0018:ffff8881de577cd0 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000001
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: ffffffff81b1b57b R09: ffffed103bcaefa0
R10: ffffed103bcaefa0 R11: 0000000000000000 R12: ffff8881f18e4640
R13: 0000000000000000 R14: 0000000000000000 R15: dffffc0000000000
FS:  0000555555d28300(0000) GS:ffff8881f6f00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f80bee5c130 CR3: 00000001de43a000 CR4: 00000000003406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	0f 1f 00             	nopl   (%rax)
   3:	41 57                	push   %r15
   5:	41 56                	push   %r14
   7:	53                   	push   %rbx
   8:	49 89 fe             	mov    %rdi,%r14
   b:	49 bf 00 00 00 00 00 	movabs $0xdffffc0000000000,%r15
  12:	fc ff df
  15:	48 89 f8             	mov    %rdi,%rax
  18:	66 66 2e 0f 1f 84 00 	data16 nopw %cs:0x0(%rax,%rax,1)
  1f:	00 00 00 00
  23:	48 89 c3             	mov    %rax,%rbx
  26:	48 c1 e8 03          	shr    $0x3,%rax
* 2a:	42 0f b6 04 38       	movzbl (%rax,%r15,1),%eax <-- trapping instruction
  2f:	84 c0                	test   %al,%al
  31:	75 0b                	jne    0x3e
  33:	48 8d 43 01          	lea    0x1(%rbx),%rax
  37:	80 3b 00             	cmpb   $0x0,(%rbx)
  3a:	75 e7                	jne    0x23
  3c:	eb 13                	jmp    0x51
  3e:	89 d9                	mov    %ebx,%ecx
----------------
Code disassembly (best guess):
   0:	0f 1f 00             	nopl   (%rax)
   3:	41 57                	push   %r15
   5:	41 56                	push   %r14
   7:	53                   	push   %rbx
   8:	49 89 fe             	mov    %rdi,%r14
   b:	49 bf 00 00 00 00 00 	movabs $0xdffffc0000000000,%r15
  12:	fc ff df
  15:	48 89 f8             	mov    %rdi,%rax
  18:	66 66 2e 0f 1f 84 00 	data16 nopw %cs:0x0(%rax,%rax,1)
  1f:	00 00 00 00
  23:	48 89 c3             	mov    %rax,%rbx
  26:	48 c1 e8 03          	shr    $0x3,%rax
* 2a:	42 0f b6 04 38       	movzbl (%rax,%r15,1),%eax <-- trapping instruction
  2f:	84 c0                	test   %al,%al
  31:	75 0b                	jne    0x3e
  33:	48 8d 43 01          	lea    0x1(%rbx),%rax
  37:	80 3b 00             	cmpb   $0x0,(%rbx)
  3a:	75 e7                	jne    0x23
  3c:	eb 13                	jmp    0x51
  3e:	89 d9                	mov    %ebx,%ecx

Crashes (14):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-android-5-4-kasan 2021/12/20 17:50 android12-5.4 5b673be0c6b0 021b36cb .config log report syz C general protection fault in kernfs_find_ns
ci2-android-5-4-kasan 2022/04/01 20:22 android12-5.4 61c005f0f166 79a2a8fc .config log report info general protection fault in kernfs_find_ns
ci2-android-5-4-kasan 2022/03/30 21:46 android12-5.4 ed043095f483 42718dd6 .config log report info general protection fault in kernfs_find_ns
ci2-android-5-4-kasan 2022/03/29 11:24 android12-5.4 ed043095f483 6bdac766 .config log report info general protection fault in kernfs_find_ns
ci2-android-5-4-kasan 2022/03/08 19:27 android12-5.4 8a3679a75730 7bdd8b2c .config log report info general protection fault in kernfs_find_ns
ci2-android-5-4-kasan 2022/03/02 05:32 android12-5.4 961dd91cc692 45a13a73 .config log report info general protection fault in kernfs_find_ns
ci2-android-5-4-kasan 2022/02/04 14:30 android12-5.4 287dec2d1089 a3e470b2 .config log report info general protection fault in kernfs_find_ns
ci2-android-5-4-kasan 2022/01/29 05:11 android12-5.4 57f9b292a6a3 495e00c5 .config log report info general protection fault in kernfs_find_ns
ci2-android-5-4-kasan 2022/01/18 20:01 android12-5.4 37c7c8d4f085 731a2d23 .config log report info general protection fault in kernfs_find_ns
ci2-android-5-4-kasan 2021/12/20 17:31 android12-5.4 5b673be0c6b0 021b36cb .config log report info general protection fault in kernfs_find_ns
ci2-android-5-4-kasan 2021/11/30 05:15 android12-5.4 0bbc71d87f4d d0830353 .config log report info general protection fault in kernfs_find_ns
ci2-android-5-4-kasan 2021/11/23 18:16 android12-5.4 697fba25ed27 545ab074 .config log report info general protection fault in kernfs_find_ns
ci2-android-5-4-kasan 2021/11/10 07:18 android12-5.4 f49f3b377eae 55fa030c .config log report info general protection fault in kernfs_find_ns
ci2-android-5-4-kasan 2021/10/24 20:01 android12-5.4 eb4a5a5dbd5b 282f03fb .config log report info general protection fault in kernfs_find_ns
* Struck through repros no longer work on HEAD.