Re: [syzbot] [btrfs?] BUG: sleeping function called from invalid context in getname_kernel

From: Qu Wenruo
Date: Wed Oct 09 2024 - 19:22:04 EST


#syz test: https://github.com/adam900710/linux.git subpage_read

在 2024/10/10 00:18, syzbot 写道:
Hello,

syzbot found the following issue on:

HEAD commit: 33ce24234fca Add linux-next specific files for 20241008
git tree: linux-next
console+strace: https://syzkaller.appspot.com/x/log.txt?x=14771780580000
kernel config: https://syzkaller.appspot.com/x/.config?x=4750ca93740b938d
dashboard link: https://syzkaller.appspot.com/bug?extid=02a127be2df04bdc5df0
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=112f97d0580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=101d4f9f980000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/ee8dc2df0c57/disk-33ce2423.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/dc473c0fa06e/vmlinux-33ce2423.xz
kernel image: https://storage.googleapis.com/syzbot-assets/4671f1ca2e61/bzImage-33ce2423.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/9876580e56ab/mount_0.gz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+02a127be2df04bdc5df0@xxxxxxxxxxxxxxxxxxxxxxxxx

BUG: sleeping function called from invalid context at include/linux/sched/mm.h:330
in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 5233, name: udevd
preempt_count: 0, expected: 0
RCU nest depth: 1, expected: 0
INFO: lockdep is turned off.
CPU: 1 UID: 0 PID: 5233 Comm: udevd Not tainted 6.12.0-rc2-next-20241008-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
__might_resched+0x5d4/0x780 kernel/sched/core.c:8638
might_alloc include/linux/sched/mm.h:330 [inline]
slab_pre_alloc_hook mm/slub.c:4062 [inline]
slab_alloc_node mm/slub.c:4140 [inline]
kmem_cache_alloc_noprof+0x61/0x380 mm/slub.c:4167
getname_kernel+0x59/0x2f0 fs/namei.c:234
kern_path+0x1d/0x50 fs/namei.c:2716
is_same_device fs/btrfs/volumes.c:812 [inline]
device_list_add+0xc64/0x1ea0 fs/btrfs/volumes.c:947
btrfs_scan_one_device+0xab5/0xd90 fs/btrfs/volumes.c:1538
btrfs_control_ioctl+0x165/0x3e0 fs/btrfs/super.c:2264
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:907 [inline]
__se_sys_ioctl+0xf9/0x170 fs/ioctl.c:893
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:0x7faa2bb1ad49
Code: 5c c3 48 8d 44 24 08 48 89 54 24 e0 48 89 44 24 c0 48 8d 44 24 d0 48 89 44 24 c8 b8 10 00 00 00 c7 44 24 b8 10 00 00 00 0f 05 <41> 89 c0 3d 00 f0 ff ff 76 10 48 8b 15 ae 60 0d 00 f7 d8 41 83 c8
RSP: 002b:00007ffd55ec91e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007faa2bb1ad49
RDX: 00007ffd55ec91f8 RSI: 0000000090009427 RDI: 0000000000000009
RBP: 0000000000000009 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffd55eca238 R14: 000055773bb412a0 R15: 00007ffd55ecaf58
</TASK>


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@xxxxxxxxxxxxxxxx.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup