BUG: sleeping function called from invalid context at include/linux/sched/mm.h:337
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 5086, name: udevd
preempt_count: 1, expected: 0
RCU nest depth: 0, expected: 0
3 locks held by udevd/5086:
#0: ffff88807a91c420 (sb_writers#5){.+.+}-{0:0}, at: mnt_want_write+0x3f/0x90 fs/namespace.c:514
#1: ffff88806f819660 (&type->i_mutex_dir_key#5){++++}-{3:3}, at: inode_lock include/linux/fs.h:799 [inline]
#1: ffff88806f819660 (&type->i_mutex_dir_key#5){++++}-{3:3}, at: open_last_lookups fs/namei.c:3582 [inline]
#1: ffff88806f819660 (&type->i_mutex_dir_key#5){++++}-{3:3}, at: path_openat+0x7e9/0x35e0 fs/namei.c:3821
#2: ffff88806f819410 (&simple_offset_lock_class){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline]
#2: ffff88806f819410 (&simple_offset_lock_class){+.+.}-{2:2}, at: mtree_alloc_cyclic+0x217/0x330 lib/maple_tree.c:6586
Preemption disabled at:
[<0000000000000000>] 0x0
CPU: 0 UID: 0 PID: 5086 Comm: udevd Tainted: G W 6.10.0-rc5-next-20240626-syzkaller #0
Tainted: [W]=WARN
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/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:8520
might_alloc include/linux/sched/mm.h:337 [inline]
slab_pre_alloc_hook mm/slub.c:3926 [inline]
slab_alloc_node mm/slub.c:4017 [inline]
kmem_cache_alloc_noprof+0x5d/0x2a0 mm/slub.c:4044
mt_alloc_one lib/maple_tree.c:162 [inline]
mas_alloc_nodes+0x26c/0x840 lib/maple_tree.c:1242
mas_node_count_gfp lib/maple_tree.c:1322 [inline]
mas_wr_preallocate+0x4ca/0x6b0 lib/maple_tree.c:4351
mas_insert lib/maple_tree.c:4389 [inline]
mas_alloc_cyclic+0x3f7/0xae0 lib/maple_tree.c:4451
mtree_alloc_cyclic+0x239/0x330 lib/maple_tree.c:6587
simple_offset_add+0x105/0x1b0 fs/libfs.c:289
shmem_mknod+0xfa/0x1e0 mm/shmem.c:3449
lookup_open fs/namei.c:3516 [inline]
open_last_lookups fs/namei.c:3585 [inline]
path_openat+0x1aaf/0x35e0 fs/namei.c:3821
do_filp_open+0x235/0x490 fs/namei.c:3851
do_sys_openat2+0x13e/0x1d0 fs/open.c:1416
do_sys_open fs/open.c:1431 [inline]
__do_sys_openat fs/open.c:1447 [inline]
__se_sys_openat fs/open.c:1442 [inline]
__x64_sys_openat+0x247/0x2a0 fs/open.c:1442
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:0x7f47191169a4
Code: 24 20 48 8d 44 24 30 48 89 44 24 28 64 8b 04 25 18 00 00 00 85 c0 75 2c 44 89 e2 48 89 ee bf 9c ff ff ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 76 60 48 8b 15 55 a4 0d 00 f7 d8 64 89 02 48 83
RSP: 002b:00007ffdbd06d300 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00007f47191169a4
RDX: 0000000000080241 RSI: 00007ffdbd06d848 RDI: 00000000ffffff9c
RBP: 00007ffdbd06d848 R08: 0000000000000004 R09: 0000000000000001
R10: 00000000000001b6 R11: 0000000000000246 R12: 0000000000080241
R13: 000055702db3b72e R14: 0000000000000001 R15: 000055702db56160
</TASK>