syzbot


general protection fault in prelim_ref_insert

Status: upstream: reported on 2024/12/09 11:27
Subsystems: btrfs
[Documentation on labels]
Reported-by: syzbot+af426748c95aef4f003e@syzkaller.appspotmail.com
First crash: 116d, last: 63d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [btrfs?] general protection fault in prelim_ref_insert 0 (1) 2024/12/09 11:27

Sample crash report:
loop0: detected capacity change from 0 to 32768
BTRFS: device fsid ed167579-eb65-4e76-9a50-61ac97e9b59d devid 1 transid 8 /dev/loop0 (7:0) scanned by syz.0.0 (5316)
BTRFS info (device loop0): first mount of filesystem ed167579-eb65-4e76-9a50-61ac97e9b59d
BTRFS info (device loop0): using sha256 (sha256-avx2) checksum algorithm
BTRFS info (device loop0): rebuilding free space tree
BTRFS info (device loop0): disabling free space tree
BTRFS info (device loop0): clearing compat-ro feature flag for FREE_SPACE_TREE (0x1)
BTRFS info (device loop0): clearing compat-ro feature flag for FREE_SPACE_TREE_VALID (0x2)
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: 5316 Comm: syz.0.0 Not tainted 6.13.0-syzkaller-05182-ge0b1f5914274 #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:do_perf_trace_btrfs__prelim_ref include/trace/events/btrfs.h:1927 [inline]
RIP: 0010:perf_trace_btrfs__prelim_ref+0x32d/0x7b0 include/trace/events/btrfs.h:1927
Code: fd e9 b3 02 00 00 e8 f2 9d ec fd ba 10 00 00 00 48 89 df 31 f6 e8 83 3a 53 fe 4c 89 64 24 08 49 8d 5e 18 48 89 d8 48 c1 e8 03 <42> 80 3c 38 00 74 08 48 89 df e8 94 37 53 fe 4c 8b 23 49 8d 5d 18
RSP: 0018:ffffc9000d1b6720 EFLAGS: 00010206
RAX: 0000000000000003 RBX: 0000000000000018 RCX: ffffffff83b2cd7d
RDX: 0000000000000010 RSI: ffff88803ef5fc00 RDI: ffffe8ffffc48b28
RBP: ffffc9000d1b6820 R08: 764e65eb797516ed R09: 9db5e997ac61509a
R10: 764e65eb797516ed R11: 9db5e997ac61509a R12: ffff88801fc37360
R13: ffffe8ffffc48b20 R14: 0000000000000000 R15: dffffc0000000000
FS:  00007fc4343ef6c0(0000) GS:ffff88801fc00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fc4343cdfe0 CR3: 0000000040bb8000 CR4: 0000000000352ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 trace_btrfs_prelim_ref_insert include/trace/events/btrfs.h:1977 [inline]
 prelim_ref_insert+0x10f2/0x12e0 fs/btrfs/backref.c:328
 add_prelim_ref fs/btrfs/backref.c:413 [inline]
 add_indirect_ref fs/btrfs/backref.c:438 [inline]
 add_inline_refs fs/btrfs/backref.c:1115 [inline]
 find_parent_nodes+0x6533/0x7bd0 fs/btrfs/backref.c:1484
 btrfs_find_all_roots_safe+0x1db/0x4c0 fs/btrfs/backref.c:1768
 btrfs_find_all_roots+0x84/0xf0 fs/btrfs/backref.c:1799
 btrfs_qgroup_account_extents+0x52f/0xb70 fs/btrfs/qgroup.c:3075
 btrfs_commit_transaction+0xfc9/0x3760 fs/btrfs/transaction.c:2440
 btrfs_sync_file+0xdd7/0x11e0 fs/btrfs/file.c:1735
 generic_write_sync include/linux/fs.h:2956 [inline]
 btrfs_do_write_iter+0x5e0/0x760 fs/btrfs/file.c:1386
 iter_file_splice_write+0xbfa/0x1510 fs/splice.c:743
 do_splice_from fs/splice.c:941 [inline]
 direct_splice_actor+0x11b/0x220 fs/splice.c:1164
 splice_direct_to_actor+0x586/0xc80 fs/splice.c:1108
 do_splice_direct_actor fs/splice.c:1207 [inline]
 do_splice_direct+0x289/0x3e0 fs/splice.c:1233
 do_sendfile+0x564/0x8a0 fs/read_write.c:1363
 __do_sys_sendfile64 fs/read_write.c:1424 [inline]
 __se_sys_sendfile64+0x17c/0x1e0 fs/read_write.c:1410
 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:0x7fc437f8cd29
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:00007fc4343ef038 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 00007fc4381a5fa0 RCX: 00007fc437f8cd29
RDX: 0000000000000000 RSI: 0000000000000005 RDI: 0000000000000005
RBP: 00007fc43800e2a0 R08: 0000000000000000 R09: 0000000000000000
R10: 000000007a680000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007fc4381a5fa0 R15: 00007fff3e901648
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:do_perf_trace_btrfs__prelim_ref include/trace/events/btrfs.h:1927 [inline]
RIP: 0010:perf_trace_btrfs__prelim_ref+0x32d/0x7b0 include/trace/events/btrfs.h:1927
Code: fd e9 b3 02 00 00 e8 f2 9d ec fd ba 10 00 00 00 48 89 df 31 f6 e8 83 3a 53 fe 4c 89 64 24 08 49 8d 5e 18 48 89 d8 48 c1 e8 03 <42> 80 3c 38 00 74 08 48 89 df e8 94 37 53 fe 4c 8b 23 49 8d 5d 18
RSP: 0018:ffffc9000d1b6720 EFLAGS: 00010206
RAX: 0000000000000003 RBX: 0000000000000018 RCX: ffffffff83b2cd7d
RDX: 0000000000000010 RSI: ffff88803ef5fc00 RDI: ffffe8ffffc48b28
RBP: ffffc9000d1b6820 R08: 764e65eb797516ed R09: 9db5e997ac61509a
R10: 764e65eb797516ed R11: 9db5e997ac61509a R12: ffff88801fc37360
R13: ffffe8ffffc48b20 R14: 0000000000000000 R15: dffffc0000000000
FS:  00007fc4343ef6c0(0000) GS:ffff88801fc00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fc4343cdfe0 CR3: 0000000040bb8000 CR4: 0000000000352ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	fd                   	std
   1:	e9 b3 02 00 00       	jmp    0x2b9
   6:	e8 f2 9d ec fd       	call   0xfdec9dfd
   b:	ba 10 00 00 00       	mov    $0x10,%edx
  10:	48 89 df             	mov    %rbx,%rdi
  13:	31 f6                	xor    %esi,%esi
  15:	e8 83 3a 53 fe       	call   0xfe533a9d
  1a:	4c 89 64 24 08       	mov    %r12,0x8(%rsp)
  1f:	49 8d 5e 18          	lea    0x18(%r14),%rbx
  23:	48 89 d8             	mov    %rbx,%rax
  26:	48 c1 e8 03          	shr    $0x3,%rax
* 2a:	42 80 3c 38 00       	cmpb   $0x0,(%rax,%r15,1) <-- trapping instruction
  2f:	74 08                	je     0x39
  31:	48 89 df             	mov    %rbx,%rdi
  34:	e8 94 37 53 fe       	call   0xfe5337cd
  39:	4c 8b 23             	mov    (%rbx),%r12
  3c:	49 8d 5d 18          	lea    0x18(%r13),%rbx

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/01/24 04:01 upstream e0b1f5914274 521b0ce3 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in prelim_ref_insert
2024/12/22 15:53 upstream 48f506ad0b68 b4fbdbd4 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in prelim_ref_insert
2024/12/05 21:57 upstream 5076001689e4 1c533826 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in prelim_ref_insert
2024/12/01 17:17 upstream bcc8eda6d349 68914665 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in prelim_ref_insert
* Struck through repros no longer work on HEAD.