Re: [syzbot] [btrfs?] KASAN: slab-use-after-free Read in btrfs_open_devices
From: syzbot
Date: Tue Aug 08 2023 - 12:09:43 EST
Hello,
syzbot has tested the proposed patch but the reproducer is still triggering an issue:
BUG: corrupted list in btrfs_close_devices
BTRFS info (device loop2): using xxhash64 (xxhash64-generic) checksum algorithm
BTRFS info (device loop2): force clearing of disk cache
BTRFS info (device loop2): setting nodatasum
BTRFS error (device loop2): unrecognized mount option 'rescan '
list_del corruption, ffff888065d38c20->next is LIST_POISON1 (dead000000000100)
------------[ cut here ]------------
kernel BUG at lib/list_debug.c:53!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 5647 Comm: syz-executor.2 Not tainted 6.5.0-rc5-next-20230807-syzkaller-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023
RIP: 0010:__list_del_entry_valid+0xfd/0x1b0 lib/list_debug.c:53
Code: 18 c3 48 c7 c7 80 8f c8 8a e8 9f 70 43 fd 0f 0b 48 c7 c7 e0 8f c8 8a e8 91 70 43 fd 0f 0b 48 c7 c7 40 90 c8 8a e8 83 70 43 fd <0f> 0b 48 89 ca 48 c7 c7 a0 90 c8 8a e8 72 70 43 fd 0f 0b 48 89 c2
RSP: 0018:ffffc90002f7f700 EFLAGS: 00010282
RAX: 000000000000004e RBX: ffff888065d38c00 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff816a9732 RDI: 0000000000000005
RBP: 0000000000000001 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000080000000 R11: 0000000000000001 R12: ffff888065d38d30
R13: ffffc90002f7f758 R14: ffff888065d38c20 R15: ffff888065d38c28
FS: 00007f38da2476c0(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fbe2639d988 CR3: 0000000064991000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
__list_del_entry include/linux/list.h:134 [inline]
list_del include/linux/list.h:148 [inline]
btrfs_close_devices+0x460/0x790 fs/btrfs/volumes.c:1208
open_ctree+0x1c1/0x5700 fs/btrfs/disk-io.c:3612
btrfs_fill_super fs/btrfs/super.c:1158 [inline]
btrfs_mount_root+0x9af/0xeb0 fs/btrfs/super.c:1521
legacy_get_tree+0x109/0x220 fs/fs_context.c:611
vfs_get_tree+0x88/0x350 fs/super.c:1544
fc_mount fs/namespace.c:1112 [inline]
vfs_kern_mount.part.0+0xcb/0x170 fs/namespace.c:1142
vfs_kern_mount+0x3f/0x60 fs/namespace.c:1129
btrfs_mount+0x292/0xb10 fs/btrfs/super.c:1584
legacy_get_tree+0x109/0x220 fs/fs_context.c:611
vfs_get_tree+0x88/0x350 fs/super.c:1544
do_new_mount fs/namespace.c:3335 [inline]
path_mount+0x1492/0x1ed0 fs/namespace.c:3662
do_mount fs/namespace.c:3675 [inline]
__do_sys_mount fs/namespace.c:3884 [inline]
__se_sys_mount fs/namespace.c:3861 [inline]
__x64_sys_mount+0x293/0x310 fs/namespace.c:3861
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:0x7f38d947e1ea
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 09 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f38da246ee8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f38da246f80 RCX: 00007f38d947e1ea
RDX: 00000000200051c0 RSI: 0000000020005200 RDI: 00007f38da246f40
RBP: 00000000200051c0 R08: 00007f38da246f80 R09: 0000000001000008
R10: 0000000001000008 R11: 0000000000000246 R12: 0000000020005200
R13: 00007f38da246f40 R14: 00000000000051ab R15: 0000000020000280
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:__list_del_entry_valid+0xfd/0x1b0 lib/list_debug.c:53
Code: 18 c3 48 c7 c7 80 8f c8 8a e8 9f 70 43 fd 0f 0b 48 c7 c7 e0 8f c8 8a e8 91 70 43 fd 0f 0b 48 c7 c7 40 90 c8 8a e8 83 70 43 fd <0f> 0b 48 89 ca 48 c7 c7 a0 90 c8 8a e8 72 70 43 fd 0f 0b 48 89 c2
RSP: 0018:ffffc90002f7f700 EFLAGS: 00010282
RAX: 000000000000004e RBX: ffff888065d38c00 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff816a9732 RDI: 0000000000000005
RBP: 0000000000000001 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000080000000 R11: 0000000000000001 R12: ffff888065d38d30
R13: ffffc90002f7f758 R14: ffff888065d38c20 R15: ffff888065d38c28
FS: 00007f38da2476c0(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f0f6962e3b0 CR3: 0000000064991000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Tested on:
commit: f7dc24b3 Add linux-next specific files for 20230807
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
console output: https://syzkaller.appspot.com/x/log.txt?x=170b2395a80000
kernel config: https://syzkaller.appspot.com/x/.config?x=d7847c9dca13d6c5
dashboard link: https://syzkaller.appspot.com/bug?extid=26860029a4d562566231
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=14e4981ba80000