BUG: sleeping function called from invalid context at include/linux/sched/mm.h:306
in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 31316, name: udevd
preempt_count: 0, expected: 0
RCU nest depth: 1, expected: 0
3 locks held by udevd/31316:
#0: ffff88802a8e3488 (&sig->cred_guard_mutex){+.+.}-{3:3}, at: prepare_bprm_creds fs/exec.c:1475 [inline]
#0: ffff88802a8e3488 (&sig->cred_guard_mutex){+.+.}-{3:3}, at: bprm_execve+0xb2/0x1980 fs/exec.c:1816
#1: ffff88801ddf2c00 (&type->i_mutex_dir_key#3){++++}-{3:3}, at: inode_lock_shared include/linux/fs.h:785 [inline]
#1: ffff88801ddf2c00 (&type->i_mutex_dir_key#3){++++}-{3:3}, at: open_last_lookups fs/namei.c:3559 [inline]
#1: ffff88801ddf2c00 (&type->i_mutex_dir_key#3){++++}-{3:3}, at: path_openat+0x14d7/0x2750 fs/namei.c:3788
#2: ffffffff8c799a40 (rcu_read_lock){....}-{1:2}, at: lru_gen_refault mm/workingset.c:293 [inline]
#2: ffffffff8c799a40 (rcu_read_lock){....}-{1:2}, at: workingset_refault+0x175/0x11e0 mm/workingset.c:528
CPU: 1 PID: 31316 Comm: udevd Not tainted 6.3.0-next-20230505-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x136/0x150 lib/dump_stack.c:106
__might_resched+0x358/0x580 kernel/sched/core.c:10153
might_alloc include/linux/sched/mm.h:306 [inline]
slab_pre_alloc_hook mm/slab.h:670 [inline]
slab_alloc_node mm/slub.c:3433 [inline]
slab_alloc mm/slub.c:3459 [inline]
__kmem_cache_alloc_lru mm/slub.c:3466 [inline]
kmem_cache_alloc+0x357/0x3b0 mm/slub.c:3475
kmem_cache_zalloc include/linux/slab.h:670 [inline]
alloc_buffer_head+0x24/0x150 fs/buffer.c:2974
folio_alloc_buffers+0x2f2/0x810 fs/buffer.c:871
alloc_page_buffers fs/buffer.c:906 [inline]
grow_dev_page fs/buffer.c:1014 [inline]
grow_buffers fs/buffer.c:1060 [inline]
__getblk_slow+0x612/0x1230 fs/buffer.c:1087
__getblk_gfp+0x72/0x80 fs/buffer.c:1382
sb_getblk include/linux/buffer_head.h:365 [inline]
ext4_getblk+0x211/0x850 fs/ext4/inode.c:845
ext4_bread_batch+0x82/0x500 fs/ext4/inode.c:912
__ext4_find_entry+0x451/0x1050 fs/ext4/namei.c:1650
ext4_lookup_entry fs/ext4/namei.c:1751 [inline]
ext4_lookup fs/ext4/namei.c:1819 [inline]
ext4_lookup+0x500/0x700 fs/ext4/namei.c:1810
lookup_open.isra.0+0x944/0x1400 fs/namei.c:3470
open_last_lookups fs/namei.c:3560 [inline]
path_openat+0x975/0x2750 fs/namei.c:3788
do_filp_open+0x1ba/0x410 fs/namei.c:3818
do_open_execat+0x116/0x730 fs/exec.c:919
bprm_execve fs/exec.c:1829 [inline]
bprm_execve+0x49a/0x1980 fs/exec.c:1810
do_execveat_common+0x72c/0x8e0 fs/exec.c:1962
do_execve fs/exec.c:2036 [inline]
__do_sys_execve fs/exec.c:2112 [inline]
__se_sys_execve fs/exec.c:2107 [inline]
__x64_sys_execve+0x93/0xc0 fs/exec.c:2107
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f5c094fcef7
Code: ba 0f 00 5b 5d 41 5c 41 5d 41 5e 41 5f e9 63 d8 fb ff 48 83 c4 18 5b 5d 41 5c 41 5d 41 5e 41 5f c3 66 90 b8 3b 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 01 3f 0f 00 f7 d8 64 89 01 48
RSP: 002b:00007ffc724ee788 EFLAGS: 00000246 ORIG_RAX: 000000000000003b
RAX: ffffffffffffffda RBX: 00007f5c0988fae0 RCX: 00007f5c094fcef7
RDX: 000055ba01a4a130 RSI: 00007ffc724ee888 RDI: 00007ffc724eec88
RBP: 0000000000000009 R08: 0000000000000000 R09: 0000000000000002
R10: 0000000000000008 R11: 0000000000000246 R12: 000000000000000e
R13: 000000000000000b R14: 000055ba01568f18 R15: 00007ffc724f0508
------------[ cut here ]------------
Voluntary context switch within RCU read-side critical section!
WARNING: CPU: 1 PID: 31316 at kernel/rcu/tree_plugin.h:318 rcu_note_context_switch+0xbb9/0x1800 kernel/rcu/tree_plugin.h:318
Modules linked in:
CPU: 1 PID: 31316 Comm: udevd Tainted: G W 6.3.0-next-20230505-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023
RIP: 0010:rcu_note_context_switch+0xbb9/0x1800 kernel/rcu/tree_plugin.h:318
Code: 9d f5 67 00 4c 8b 4c 24 30 8b 4c 24 28 48 8b 54 24 20 e9 8f 03 00 00 48 c7 c7 40 32 4e 8a c6 05 39 8a f5 0c 01 e8 97 b7 dc ff <0f> 0b e9 4c f5 ff ff 81 e5 ff ff ff 7f 0f 84 d7 f6 ff ff 65 48 8b
RSP: 0018:ffffc90008af71c0 EFLAGS: 00010086
RAX: 0000000000000000 RBX: ffff8880b993d4c0 RCX: 0000000000000000
RDX: ffff888026b35940 RSI: ffffffff814c0497 RDI: 0000000000000001
RBP: ffff888026b35940 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: 000000000019abd0 R12: 0000000000000000
R13: ffff888026b35940 R14: ffffffff8e7ac430 R15: ffff8880b993c5c0
FS: 00007f5c0988fc80(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f3856e52110 CR3: 000000015a79c000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
__schedule+0x276/0x5790 kernel/sched/core.c:6569
schedule+0xde/0x1a0 kernel/sched/core.c:6745
io_schedule+0xbe/0x130 kernel/sched/core.c:8979
bit_wait_io+0x16/0xe0 kernel/sched/wait_bit.c:209
__wait_on_bit+0x64/0x180 kernel/sched/wait_bit.c:49
out_of_line_wait_on_bit+0xd9/0x110 kernel/sched/wait_bit.c:64
wait_on_bit_io include/linux/wait_bit.h:101 [inline]
__wait_on_buffer+0x63/0x70 fs/buffer.c:123
wait_on_buffer include/linux/buffer_head.h:394 [inline]
__ext4_find_entry+0x590/0x1050 fs/ext4/namei.c:1660
ext4_lookup_entry fs/ext4/namei.c:1751 [inline]
ext4_lookup fs/ext4/namei.c:1819 [inline]
ext4_lookup+0x500/0x700 fs/ext4/namei.c:1810
lookup_open.isra.0+0x944/0x1400 fs/namei.c:3470
open_last_lookups fs/namei.c:3560 [inline]
path_openat+0x975/0x2750 fs/namei.c:3788
do_filp_open+0x1ba/0x410 fs/namei.c:3818
do_open_execat+0x116/0x730 fs/exec.c:919
bprm_execve fs/exec.c:1829 [inline]
bprm_execve+0x49a/0x1980 fs/exec.c:1810
do_execveat_common+0x72c/0x8e0 fs/exec.c:1962
do_execve fs/exec.c:2036 [inline]
__do_sys_execve fs/exec.c:2112 [inline]
__se_sys_execve fs/exec.c:2107 [inline]
__x64_sys_execve+0x93/0xc0 fs/exec.c:2107
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f5c094fcef7
Code: ba 0f 00 5b 5d 41 5c 41 5d 41 5e 41 5f e9 63 d8 fb ff 48 83 c4 18 5b 5d 41 5c 41 5d 41 5e 41 5f c3 66 90 b8 3b 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 01 3f 0f 00 f7 d8 64 89 01 48
RSP: 002b:00007ffc724ee788 EFLAGS: 00000246 ORIG_RAX: 000000000000003b
RAX: ffffffffffffffda RBX: 00007f5c0988fae0 RCX: 00007f5c094fcef7
RDX: 000055ba01a4a130 RSI: 00007ffc724ee888 RDI: 00007ffc724eec88
RBP: 0000000000000009 R08: 0000000000000000 R09: 0000000000000002
R10: 0000000000000008 R11: 0000000000000246 R12: 000000000000000e
R13: 000000000000000b R14: 000055ba01568f18 R15: 00007ffc724f0508