syzbot


kernel BUG in btrfs_insert_delayed_dir_index

Status: fixed on 2023/12/21 03:45
Subsystems: btrfs
[Documentation on labels]
Reported-by: syzbot+d13490c82ad5353c779d@syzkaller.appspotmail.com
Fix commit: 8e7f82deb0c0 btrfs: fix race between reading a directory and adding entries to it
First crash: 273d, last: 264d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [btrfs?] kernel BUG in btrfs_insert_delayed_dir_index 0 (1) 2023/08/27 05:10

Sample crash report:
BTRFS info (device loop4): auto enabling async discard
BTRFS error (device loop4): err add delayed dir index item(name: ‡φη) into the insertion tree of the delayed node(root id: 5, inode id: 257, errno: -17)
------------[ cut here ]------------
kernel BUG at fs/btrfs/delayed-inode.c:1504!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 29694 Comm: syz-executor.4 Not tainted 6.5.0-syzkaller-09276-g99d99825fc07 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023
RIP: 0010:btrfs_insert_delayed_dir_index+0x783/0x920 fs/btrfs/delayed-inode.c:1504
Code: 00 48 c1 ea 03 80 3c 02 00 0f 85 5a 01 00 00 48 8b 7d 50 41 54 48 c7 c6 20 ef b7 8a 48 8b 4c 24 08 8b 54 24 38 e8 8d e4 0e 00 <0f> 0b 48 8b 7c 24 20 e8 41 44 51 fe e9 ec f8 ff ff e8 97 44 51 fe
RSP: 0018:ffffc9000e9d7320 EFLAGS: 00010286
RAX: 0000000000000000 RBX: ffff88802bf10000 RCX: ffffc9000d357000
RDX: 0000000000040000 RSI: ffffffff839ac316 RDI: 0000000000000005
RBP: ffff88802fcdbe70 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000080000000 R11: fffffffffffffb38 R12: 00000000ffffffef
R13: 00000000000c0000 R14: ffff888082e6f300 R15: ffff8880346dc000
FS:  00007f286cd1c6c0(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b2c02a000 CR3: 00000000514d1000 CR4: 0000000000350ef0
Call Trace:
 <TASK>
 btrfs_insert_dir_item+0x47e/0x670 fs/btrfs/dir-item.c:166
 btrfs_add_link+0x45e/0xc30 fs/btrfs/inode.c:6415
 btrfs_create_new_inode+0x1a6c/0x2710 fs/btrfs/inode.c:6356
 create_subvol+0xd9e/0x15e0 fs/btrfs/ioctl.c:748
 btrfs_mksubvol+0xe9f/0x12c0 fs/btrfs/ioctl.c:997
 __btrfs_ioctl_snap_create+0x2f7/0x4f0 fs/btrfs/ioctl.c:1272
 btrfs_ioctl_snap_create+0x168/0x200 fs/btrfs/ioctl.c:1321
 btrfs_ioctl+0x3aa2/0x5cf0 fs/btrfs/ioctl.c:4568
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:871 [inline]
 __se_sys_ioctl fs/ioctl.c:857 [inline]
 __x64_sys_ioctl+0x18f/0x210 fs/ioctl.c:857
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f286c07cae9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f286cd1c0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f286c19bf80 RCX: 00007f286c07cae9
RDX: 0000000020000240 RSI: 000000005000940e RDI: 0000000000000006
RBP: 00007f286c0c847a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f286c19bf80 R15: 00007ffd5ff629e8
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:btrfs_insert_delayed_dir_index+0x783/0x920 fs/btrfs/delayed-inode.c:1504
Code: 00 48 c1 ea 03 80 3c 02 00 0f 85 5a 01 00 00 48 8b 7d 50 41 54 48 c7 c6 20 ef b7 8a 48 8b 4c 24 08 8b 54 24 38 e8 8d e4 0e 00 <0f> 0b 48 8b 7c 24 20 e8 41 44 51 fe e9 ec f8 ff ff e8 97 44 51 fe
RSP: 0018:ffffc9000e9d7320 EFLAGS: 00010286
RAX: 0000000000000000 RBX: ffff88802bf10000 RCX: ffffc9000d357000
RDX: 0000000000040000 RSI: ffffffff839ac316 RDI: 0000000000000005
RBP: ffff88802fcdbe70 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000080000000 R11: fffffffffffffb38 R12: 00000000ffffffef
R13: 00000000000c0000 R14: ffff888082e6f300 R15: ffff8880346dc000
FS:  00007f286cd1c6c0(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020404030 CR3: 00000000514d1000 CR4: 0000000000350ee0

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/09/01 09:39 upstream 99d99825fc07 696ea0d2 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root kernel BUG in btrfs_insert_delayed_dir_index
2023/08/23 22:41 upstream a5e505a99ca7 b81ca3f6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in btrfs_insert_delayed_dir_index
2023/08/23 04:57 upstream 53663f4103ff b81ca3f6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in btrfs_insert_delayed_dir_index
* Struck through repros no longer work on HEAD.