syzbot


general protection fault in btrfs_root_node

Status: upstream: reported C repro on 2024/09/03 16:42
Subsystems: btrfs
[Documentation on labels]
Reported-by: syzbot+9c3e0cdfbfe351b0bc0e@syzkaller.appspotmail.com
First crash: 17d, last: 15h34m
Discussions (2)
Title Replies (including bot) Last reply
[PATCH] btrfs: Added null check to extent_root variable 6 (6) 2024/09/04 21:31
[syzbot] [btrfs?] general protection fault in btrfs_root_node 0 (4) 2024/09/04 02:12
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 KASAN: null-ptr-deref Write in btrfs_root_node 1 511d 511d 0/3 auto-obsoleted due to no activity on 2023/08/22 05:04
linux-5.15 KASAN: null-ptr-deref Write in btrfs_root_node (2) origin:lts-only C done 9 44d 364d 0/3 upstream: reported C repro on 2023/09/18 04:34
Last patch testing requests (4)
Created Duration User Patch Repo Result
2024/09/16 03:11 14m retest repro upstream report log
2024/09/04 02:12 19m ghanshyam1898@gmail.com patch upstream OK log
2024/09/04 01:43 0m ghanshyam1898@gmail.com patch upstream error
2024/09/04 01:38 0m ghanshyam1898@gmail.com patch upstream error

Sample crash report:
BTRFS info (device loop0): using crc32c (crc32c-intel) checksum algorithm
BTRFS info (device loop0): using free-space-tree
Oops: general protection fault, probably for non-canonical address 0xdffffc0000000003: 0000 [#1] PREEMPT SMP KASAN NOPTI
KASAN: null-ptr-deref in range [0x0000000000000018-0x000000000000001f]
CPU: 0 UID: 0 PID: 5105 Comm: syz-executor368 Not tainted 6.11.0-rc5-syzkaller-00176-g20371ba12063 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
RIP: 0010:btrfs_root_node+0x86/0x3b0 fs/btrfs/ctree.c:260
Code: a0 aa c8 fd 48 83 c4 08 e8 47 80 12 08 89 c3 31 ff 89 c6 e8 4c 6f ec fd 85 db 74 17 e8 33 a1 d2 fd 84 c0 74 1c e8 fa 6a ec fd <43> 80 3c 3c 00 75 4b eb 51 e8 ec 6a ec fd 43 80 3c 3c 00 75 3d eb
RSP: 0018:ffffc90000e376c0 EFLAGS: 00010293
RAX: ffffffff83a72136 RBX: 0000000000000001 RCX: ffff888000784880
RDX: 0000000000000000 RSI: ffffffff8c608d20 RDI: ffffffff8c608ce0
RBP: ffffc90000e378b0 R08: ffffffff83a72124 R09: 1ffffffff283c908
R10: dffffc0000000000 R11: fffffbfff283c909 R12: 0000000000000003
R13: dffffc0000000000 R14: 0000000000000018 R15: dffffc0000000000
FS:  0000555578f7a380(0000) GS:ffff88801fe00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f674dc59068 CR3: 0000000034fa8000 CR4: 0000000000350ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 btrfs_read_lock_root_node+0x27/0xd0 fs/btrfs/locking.c:279
 btrfs_build_ref_tree+0x112/0x16f0 fs/btrfs/ref-verify.c:1005
 open_ctree+0x1fea/0x2a10 fs/btrfs/disk-io.c:3533
 btrfs_fill_super fs/btrfs/super.c:965 [inline]
 btrfs_get_tree_super fs/btrfs/super.c:1888 [inline]
 btrfs_get_tree+0xe7a/0x1920 fs/btrfs/super.c:2114
 vfs_get_tree+0x90/0x2b0 fs/super.c:1800
 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:1800
 do_new_mount+0x2be/0xb40 fs/namespace.c:3472
 do_mount fs/namespace.c:3812 [inline]
 __do_sys_mount fs/namespace.c:4020 [inline]
 __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3997
 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:0x7f3e4d3e7eea
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 5e 04 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 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:00007ffcc9f71558 EFLAGS: 00000282 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007ffcc9f71560 RCX: 00007f3e4d3e7eea
RDX: 0000000020005100 RSI: 0000000020000040 RDI: 00007ffcc9f71560
RBP: 0000000000000004 R08: 00007ffcc9f715a0 R09: 0000000000005110
R10: 0000000000a08811 R11: 0000000000000282 R12: 00007ffcc9f715a0
R13: 0000000000000003 R14: 0000000001000000 R15: 00007f3e4d42f03b
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:btrfs_root_node+0x86/0x3b0 fs/btrfs/ctree.c:260
Code: a0 aa c8 fd 48 83 c4 08 e8 47 80 12 08 89 c3 31 ff 89 c6 e8 4c 6f ec fd 85 db 74 17 e8 33 a1 d2 fd 84 c0 74 1c e8 fa 6a ec fd <43> 80 3c 3c 00 75 4b eb 51 e8 ec 6a ec fd 43 80 3c 3c 00 75 3d eb
RSP: 0018:ffffc90000e376c0 EFLAGS: 00010293
RAX: ffffffff83a72136 RBX: 0000000000000001 RCX: ffff888000784880
RDX: 0000000000000000 RSI: ffffffff8c608d20 RDI: ffffffff8c608ce0
RBP: ffffc90000e378b0 R08: ffffffff83a72124 R09: 1ffffffff283c908
R10: dffffc0000000000 R11: fffffbfff283c909 R12: 0000000000000003
R13: dffffc0000000000 R14: 0000000000000018 R15: dffffc0000000000
FS:  0000555578f7a380(0000) GS:ffff88801fe00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00005610c6449d38 CR3: 0000000034fa8000 CR4: 0000000000350ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	a0 aa c8 fd 48 83 c4 	movabs 0xe808c48348fdc8aa,%al
   7:	08 e8
   9:	47 80 12 08          	rex.RXB adcb $0x8,(%r10)
   d:	89 c3                	mov    %eax,%ebx
   f:	31 ff                	xor    %edi,%edi
  11:	89 c6                	mov    %eax,%esi
  13:	e8 4c 6f ec fd       	call   0xfdec6f64
  18:	85 db                	test   %ebx,%ebx
  1a:	74 17                	je     0x33
  1c:	e8 33 a1 d2 fd       	call   0xfdd2a154
  21:	84 c0                	test   %al,%al
  23:	74 1c                	je     0x41
  25:	e8 fa 6a ec fd       	call   0xfdec6b24
* 2a:	43 80 3c 3c 00       	cmpb   $0x0,(%r12,%r15,1) <-- trapping instruction
  2f:	75 4b                	jne    0x7c
  31:	eb 51                	jmp    0x84
  33:	e8 ec 6a ec fd       	call   0xfdec6b24
  38:	43 80 3c 3c 00       	cmpb   $0x0,(%r12,%r15,1)
  3d:	75 3d                	jne    0x7c
  3f:	eb                   	.byte 0xeb

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/08/30 16:47 upstream 20371ba12063 db150e23 .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] [mounted in repro] ci-snapshot-upstream-root general protection fault in btrfs_root_node
2024/09/02 03:10 upstream 431c1646e1f8 1eda0d14 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in btrfs_root_node
2024/08/30 16:32 upstream 20371ba12063 db150e23 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in btrfs_root_node
* Struck through repros no longer work on HEAD.