syzbot


general protection fault in getname_kernel (2)

Status: auto-obsoleted due to no activity on 2024/11/22 15:11
Subsystems: btrfs
[Documentation on labels]
Reported-by: syzbot+cee29f5a48caf10cd475@syzkaller.appspotmail.com
First crash: 79d, last: 73d
Cause bisection: introduced by (bisect log) :
commit b4b3fb6c00f37a9da91022adcd83555bc339e044
Author: Qu Wenruo <wqu@suse.com>
Date: Tue Sep 24 04:57:07 2024 +0000

  btrfs: canonicalize the device path before adding it

Crash: BUG: unable to handle kernel NULL pointer dereference in getname_kernel (log)
Repro: C syz .config
  
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [btrfs?] general protection fault in getname_kernel (2) 4 (10) 2024/10/10 05:37
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream general protection fault in getname_kernel gfs2 C 10 2263d 2271d 11/28 fixed on 2018/11/12 21:25
upstream KASAN: slab-out-of-bounds Read in getname_kernel (2) btrfs C done 5 326d 373d 25/28 fixed on 2024/03/28 13:58
Last patch testing requests (5)
Created Duration User Patch Repo Result
2024/10/27 18:03 22m retest repro linux-next OK log
2024/10/10 04:55 33m quwenruo.btrfs@gmx.com https://github.com/adam900710/linux.git subpage_read OK log
2024/10/10 02:26 21m quwenruo.btrfs@gmx.com https://github.com/adam900710/linux.git subpage_read log
2024/10/09 23:21 33m quwenruo.btrfs@gmx.com https://github.com/adam900710/linux.git subpage_read report log
2024/10/09 14:33 1h40m eadavis@qq.com patch linux-next error

Sample crash report:
Oops: general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN PTI
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
CPU: 0 UID: 0 PID: 21316 Comm: syz.4.3359 Not tainted 6.12.0-rc2-next-20241011-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
RIP: 0010:strlen+0x2c/0x70 lib/string.c:402
Code: 1e fa 41 57 41 56 41 54 53 49 89 fe 48 c7 c0 ff ff ff ff 49 bf 00 00 00 00 00 fc ff df 48 89 fb 49 89 c4 48 89 d8 48 c1 e8 03 <42> 0f b6 04 38 84 c0 75 12 48 ff c3 49 8d 44 24 01 43 80 7c 26 01
RSP: 0018:ffffc9000902f8a8 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000040000
RDX: ffffc90009493000 RSI: 0000000000000238 RDI: 0000000000000000
RBP: 0000000000000000 R08: ffffffff942e3907 R09: 1ffffffff285c720
R10: dffffc0000000000 R11: fffffbfff285c721 R12: ffffffffffffffff
R13: ffff88802fbc4000 R14: 0000000000000000 R15: dffffc0000000000
FS:  00007fced0bf16c0(0000) GS:ffff8880b8600000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000110c3dd572 CR3: 000000004c39a000 CR4: 00000000003526f0
Call Trace:
 <TASK>
 getname_kernel+0x1d/0x2f0 fs/namei.c:232
 kern_path+0x1d/0x50 fs/namei.c:2716
 is_good_dev_path fs/btrfs/volumes.c:760 [inline]
 btrfs_scan_one_device+0x19e/0xd90 fs/btrfs/volumes.c:1492
 btrfs_get_tree_super fs/btrfs/super.c:1841 [inline]
 btrfs_get_tree+0x30e/0x1920 fs/btrfs/super.c:2114
 vfs_get_tree+0x90/0x2b0 fs/super.c:1814
 fc_mount+0x1b/0xb0 fs/namespace.c:1231
 btrfs_get_tree_subvol fs/btrfs/super.c:2077 [inline]
 btrfs_get_tree+0x652/0x1920 fs/btrfs/super.c:2115
 vfs_get_tree+0x90/0x2b0 fs/super.c:1814
 vfs_cmd_create+0xa0/0x1f0 fs/fsopen.c:225
 __do_sys_fsconfig fs/fsopen.c:472 [inline]
 __se_sys_fsconfig+0xa1f/0xf70 fs/fsopen.c:344
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fcecfd7dff9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fced0bf1038 EFLAGS: 00000246 ORIG_RAX: 00000000000001af
RAX: ffffffffffffffda RBX: 00007fcecff36130 RCX: 00007fcecfd7dff9
RDX: 0000000000000000 RSI: 0000000000000006 RDI: 0000000000000005
RBP: 00007fcecfdf0296 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007fcecff36130 R15: 00007fff75f2b998
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:strlen+0x2c/0x70 lib/string.c:402
Code: 1e fa 41 57 41 56 41 54 53 49 89 fe 48 c7 c0 ff ff ff ff 49 bf 00 00 00 00 00 fc ff df 48 89 fb 49 89 c4 48 89 d8 48 c1 e8 03 <42> 0f b6 04 38 84 c0 75 12 48 ff c3 49 8d 44 24 01 43 80 7c 26 01
RSP: 0018:ffffc9000902f8a8 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000040000
RDX: ffffc90009493000 RSI: 0000000000000238 RDI: 0000000000000000
RBP: 0000000000000000 R08: ffffffff942e3907 R09: 1ffffffff285c720
R10: dffffc0000000000 R11: fffffbfff285c721 R12: ffffffffffffffff
R13: ffff88802fbc4000 R14: 0000000000000000 R15: dffffc0000000000
FS:  00007fced0bf16c0(0000) GS:ffff8880b8600000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000110c3dd572 CR3: 000000004c39a000 CR4: 00000000003526f0
----------------
Code disassembly (best guess), 1 bytes skipped:
   0:	fa                   	cli
   1:	41 57                	push   %r15
   3:	41 56                	push   %r14
   5:	41 54                	push   %r12
   7:	53                   	push   %rbx
   8:	49 89 fe             	mov    %rdi,%r14
   b:	48 c7 c0 ff ff ff ff 	mov    $0xffffffffffffffff,%rax
  12:	49 bf 00 00 00 00 00 	movabs $0xdffffc0000000000,%r15
  19:	fc ff df
  1c:	48 89 fb             	mov    %rdi,%rbx
  1f:	49 89 c4             	mov    %rax,%r12
  22:	48 89 d8             	mov    %rbx,%rax
  25:	48 c1 e8 03          	shr    $0x3,%rax
* 29:	42 0f b6 04 38       	movzbl (%rax,%r15,1),%eax <-- trapping instruction
  2e:	84 c0                	test   %al,%al
  30:	75 12                	jne    0x44
  32:	48 ff c3             	inc    %rbx
  35:	49 8d 44 24 01       	lea    0x1(%r12),%rax
  3a:	43                   	rex.XB
  3b:	80                   	.byte 0x80
  3c:	7c 26                	jl     0x64
  3e:	01                   	.byte 0x1

Crashes (17):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/10/13 15:10 linux-next d61a00525464 084d8178 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in getname_kernel
2024/10/13 15:10 linux-next d61a00525464 084d8178 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in getname_kernel
2024/10/13 02:15 linux-next d61a00525464 084d8178 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in getname_kernel
2024/10/13 02:15 linux-next d61a00525464 084d8178 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in getname_kernel
2024/10/12 20:50 linux-next d61a00525464 084d8178 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in getname_kernel
2024/10/12 20:50 linux-next d61a00525464 084d8178 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in getname_kernel
2024/10/12 20:50 linux-next d61a00525464 084d8178 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in getname_kernel
2024/10/12 20:50 linux-next d61a00525464 084d8178 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in getname_kernel
2024/10/12 20:46 linux-next d61a00525464 084d8178 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in getname_kernel
2024/10/12 20:45 linux-next d61a00525464 084d8178 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in getname_kernel
2024/10/11 20:44 linux-next d61a00525464 cd942402 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in getname_kernel
2024/10/11 20:44 linux-next d61a00525464 cd942402 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in getname_kernel
2024/10/08 21:28 linux-next 33ce24234fca 402f1df0 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in getname_kernel
2024/10/08 12:15 linux-next 33ce24234fca 402f1df0 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in getname_kernel
2024/10/08 11:40 linux-next 33ce24234fca 402f1df0 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in getname_kernel
2024/10/08 08:18 linux-next 33ce24234fca 402f1df0 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in getname_kernel
2024/10/08 08:18 linux-next 33ce24234fca 402f1df0 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in getname_kernel
* Struck through repros no longer work on HEAD.