syzbot


kernel BUG in create_pending_snapshot

Status: fixed on 2024/07/27 10:29
Bug presence: origin:lts-only
[Documentation on labels]
Reported-by: syzbot+c56033c8c15c08286062@syzkaller.appspotmail.com
Fix commit: 588df4829d7f btrfs: do not BUG_ON on failure to get dir index for new snapshot
First crash: 602d, last: 420d
Fix commit to backport (bisect log) :
tree: upstream
commit df9f278239046719c91aeb59ec0afb1a99ee8b2b
Author: Filipe Manana <fdmanana@suse.com>
Date: Tue Jun 13 15:42:16 2023 +0000

  btrfs: do not BUG_ON on failure to get dir index for new snapshot

  
Fix bisection: the issue occurs on the latest tested release (bisect log)
Crash: kernel BUG in create_pending_snapshot (log)
Repro: C syz .config
  
Bug presence (2)
Date Name Commit Repro Result
2023/10/21 linux-6.1.y (ToT) 7d24402875c7 C [report] kernel BUG in create_pending_snapshot
2023/10/21 upstream (ToT) d537ae43f8a1 C Didn't crash
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream kernel BUG in create_pending_snapshot btrfs C error done 32 445d 751d 25/28 fixed on 2024/05/19 20:31
linux-4.19 kernel BUG in create_pending_snapshot 1 734d 734d 0/1 auto-obsoleted due to no activity on 2023/04/10 13:10
Fix bisection attempts (3)
Created Duration User Patch Repo Result
2023/11/20 22:35 5h39m fix candidate upstream OK (1) job log
2023/10/02 07:39 11m fix candidate upstream error job log
2023/09/14 00:15 1h50m bisect fix linux-6.1.y OK (0) job log log

Sample crash report:
RDX: 00000000200006c0 RSI: 0000000050009417 RDI: 0000000000000003
RBP: 0000000000000002 R08: 00007fff434e02d6 R09: 00007fff434e0580
R10: 0000000000000002 R11: 0000000000000246 R12: 00007fff434e055c
R13: 0000000000000005 R14: 431bde82d7b634db R15: 00007fff434e05a0
 </TASK>
------------[ cut here ]------------
kernel BUG at fs/btrfs/transaction.c:1705!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 3652 Comm: syz-executor143 Not tainted 6.1.59-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023
RIP: 0010:create_pending_snapshot+0x251f/0x28b0 fs/btrfs/transaction.c:1705
Code: e9 01 ee ff ff e8 c1 d8 02 fe 48 c7 c7 80 97 2d 8b 44 89 e6 e8 42 d2 ca fd 0f 0b e9 ab f9 ff ff e8 76 0f 00 07 e8 a1 d8 02 fe <0f> 0b e8 9a d8 02 fe 48 b8 00 00 00 00 00 fc ff df 48 8b 4c 24 28
RSP: 0018:ffffc9000401f560 EFLAGS: 00010293
RAX: ffffffff838798ef RBX: 00000000fffffff4 RCX: ffff8880760ed940
RDX: 0000000000000000 RSI: 00000000fffffff4 RDI: 0000000000000000
RBP: ffffc9000401f850 R08: ffffffff83877bdf R09: fffffbfff1a4367b
R10: 0000000000000000 R11: dffffc0000000001 R12: 00000000000a0000
R13: ffff88807a07e000 R14: dffffc0000000000 R15: ffff8880718edb30
FS:  00005555555ca380(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020001000 CR3: 000000007d911000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 create_pending_snapshots+0x195/0x1d0 fs/btrfs/transaction.c:1902
 btrfs_commit_transaction+0x13bb/0x3c70 fs/btrfs/transaction.c:2370
 create_snapshot+0x4a5/0x7e0 fs/btrfs/ioctl.c:835
 btrfs_mksubvol+0x71a/0x8a0 fs/btrfs/ioctl.c:985
 btrfs_mksnapshot+0xb5/0xf0 fs/btrfs/ioctl.c:1031
 __btrfs_ioctl_snap_create+0x338/0x450 fs/btrfs/ioctl.c:2186
 btrfs_ioctl_snap_create_v2+0x1c4/0x400 fs/btrfs/ioctl.c:2273
 btrfs_ioctl+0xaa0/0xc10
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:870 [inline]
 __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:856
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fd2f8c7f1e9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 21 18 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fff434e0538 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fff434e0560 RCX: 00007fd2f8c7f1e9
RDX: 00000000200006c0 RSI: 0000000050009417 RDI: 0000000000000003
RBP: 0000000000000002 R08: 00007fff434e02d6 R09: 00007fff434e0580
R10: 0000000000000002 R11: 0000000000000246 R12: 00007fff434e055c
R13: 0000000000000005 R14: 431bde82d7b634db R15: 00007fff434e05a0
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:create_pending_snapshot+0x251f/0x28b0 fs/btrfs/transaction.c:1705
Code: e9 01 ee ff ff e8 c1 d8 02 fe 48 c7 c7 80 97 2d 8b 44 89 e6 e8 42 d2 ca fd 0f 0b e9 ab f9 ff ff e8 76 0f 00 07 e8 a1 d8 02 fe <0f> 0b e8 9a d8 02 fe 48 b8 00 00 00 00 00 fc ff df 48 8b 4c 24 28
RSP: 0018:ffffc9000401f560 EFLAGS: 00010293
RAX: ffffffff838798ef RBX: 00000000fffffff4 RCX: ffff8880760ed940
RDX: 0000000000000000 RSI: 00000000fffffff4 RDI: 0000000000000000
RBP: ffffc9000401f850 R08: ffffffff83877bdf R09: fffffbfff1a4367b
R10: 0000000000000000 R11: dffffc0000000001 R12: 00000000000a0000
R13: ffff88807a07e000 R14: dffffc0000000000 R15: ffff8880718edb30
FS:  00005555555ca380(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020001000 CR3: 000000007d911000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/10/21 21:20 linux-6.1.y 7d24402875c7 361b23dc .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan kernel BUG in create_pending_snapshot
2023/06/30 09:26 linux-6.1.y a1c449d00ff8 01298212 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 kernel BUG in create_pending_snapshot
2023/06/30 09:10 linux-6.1.y a1c449d00ff8 01298212 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 kernel BUG in create_pending_snapshot
2023/04/22 20:59 linux-6.1.y f17b0ab65d17 2b32bd34 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 kernel BUG in create_pending_snapshot
* Struck through repros no longer work on HEAD.