oom-kill:constraint=CONSTRAINT_MEMCG,nodemask=(null),cpuset=syz2,mems_allowed=0-1,oom_memcg=/syz1,task_memcg=/syz1,task=syz-executor.1,pid=3639,uid=0 BUG: sleeping function called from invalid context at kernel/locking/mutex.c:577 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 8814, name: syz-executor.2 preempt_count: 1, expected: 0 RCU nest depth: 0, expected: 0 5 locks held by syz-executor.2/8814: #0: ffff88801e8ec460 (sb_writers#10){.+.+}-{0:0}, at: __do_sys_sendfile64 fs/read_write.c:1310 [inline] #0: ffff88801e8ec460 (sb_writers#10){.+.+}-{0:0}, at: __se_sys_sendfile64 fs/read_write.c:1296 [inline] #0: ffff88801e8ec460 (sb_writers#10){.+.+}-{0:0}, at: __x64_sys_sendfile64+0x1cc/0x210 fs/read_write.c:1296 #1: ffff88807dd31488 (&of->mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter+0x287/0x500 fs/kernfs/file.c:287 #2: ffff8880222ad918 (kn->active#182){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x2ab/0x500 fs/kernfs/file.c:288 #3: ffffffff8bc645a8 (oom_lock){+.+.}-{3:3}, at: mem_cgroup_out_of_memory+0x8d/0x270 mm/memcontrol.c:1607 #4: ffff888023bbc3e0 (&p->alloc_lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:354 [inline] #4: ffff888023bbc3e0 (&p->alloc_lock){+.+.}-{2:2}, at: task_lock include/linux/sched/task.h:170 [inline] #4: ffff888023bbc3e0 (&p->alloc_lock){+.+.}-{2:2}, at: find_lock_task_mm+0xe3/0x2b0 mm/oom_kill.c:144 Preemption disabled at: [<0000000000000000>] 0x0 CPU: 0 PID: 8814 Comm: syz-executor.2 Not tainted 5.17.0-rc1-next-20220124-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 __might_resched.cold+0x222/0x26b kernel/sched/core.c:9576 __mutex_lock_common kernel/locking/mutex.c:577 [inline] __mutex_lock+0x9f/0x12f0 kernel/locking/mutex.c:733 futex_cleanup_begin kernel/futex/core.c:1058 [inline] futex_exit_release+0x26/0x220 kernel/futex/core.c:1110 __oom_kill_process+0x373/0xf90 mm/oom_kill.c:893 oom_kill_process+0xd7/0x5b0 mm/oom_kill.c:1003 out_of_memory+0x358/0x14b0 mm/oom_kill.c:1132 mem_cgroup_out_of_memory+0x206/0x270 mm/memcontrol.c:1617 memory_max_write+0x263/0x3c0 mm/memcontrol.c:6313 cgroup_file_write+0x1de/0x760 kernel/cgroup/cgroup.c:3882 kernfs_fop_write_iter+0x342/0x500 fs/kernfs/file.c:296 call_write_iter include/linux/fs.h:2074 [inline] do_iter_readv_writev+0x47a/0x750 fs/read_write.c:725 do_iter_write+0x188/0x710 fs/read_write.c:851 vfs_iter_write+0x70/0xa0 fs/read_write.c:892 iter_file_splice_write+0x723/0xc70 fs/splice.c:689 do_splice_from fs/splice.c:767 [inline] direct_splice_actor+0x110/0x180 fs/splice.c:936 splice_direct_to_actor+0x34b/0x8c0 fs/splice.c:891 do_splice_direct+0x1b3/0x280 fs/splice.c:979 do_sendfile+0xaf2/0x1250 fs/read_write.c:1245 __do_sys_sendfile64 fs/read_write.c:1310 [inline] __se_sys_sendfile64 fs/read_write.c:1296 [inline] __x64_sys_sendfile64+0x1cc/0x210 fs/read_write.c:1296 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7feb94c96059 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007feb9360b168 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 00007feb94da8f60 RCX: 00007feb94c96059 RDX: 0000000000000000 RSI: 0000000000000012 RDI: 0000000000000012 RBP: 00007feb94cf008d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000003 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fff5123f54f R14: 00007feb9360b300 R15: 0000000000022000 ============================= [ BUG: Invalid wait context ] 5.17.0-rc1-next-20220124-syzkaller #0 Tainted: G W ----------------------------- syz-executor.2/8814 is trying to lock: ffff888023bbce00 (&tsk->futex_exit_mutex){+.+.}-{3:3}, at: futex_cleanup_begin kernel/futex/core.c:1058 [inline] ffff888023bbce00 (&tsk->futex_exit_mutex){+.+.}-{3:3}, at: futex_exit_release+0x26/0x220 kernel/futex/core.c:1110 other info that might help us debug this: context-{4:4} 5 locks held by syz-executor.2/8814: #0: ffff88801e8ec460 (sb_writers#10){.+.+}-{0:0}, at: __do_sys_sendfile64 fs/read_write.c:1310 [inline] #0: ffff88801e8ec460 (sb_writers#10){.+.+}-{0:0}, at: __se_sys_sendfile64 fs/read_write.c:1296 [inline] #0: ffff88801e8ec460 (sb_writers#10){.+.+}-{0:0}, at: __x64_sys_sendfile64+0x1cc/0x210 fs/read_write.c:1296 #1: ffff88807dd31488 (&of->mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter+0x287/0x500 fs/kernfs/file.c:287 #2: ffff8880222ad918 (kn->active#182){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x2ab/0x500 fs/kernfs/file.c:288 #3: ffffffff8bc645a8 (oom_lock){+.+.}-{3:3}, at: mem_cgroup_out_of_memory+0x8d/0x270 mm/memcontrol.c:1607 #4: ffff888023bbc3e0 (&p->alloc_lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:354 [inline] #4: ffff888023bbc3e0 (&p->alloc_lock){+.+.}-{2:2}, at: task_lock include/linux/sched/task.h:170 [inline] #4: ffff888023bbc3e0 (&p->alloc_lock){+.+.}-{2:2}, at: find_lock_task_mm+0xe3/0x2b0 mm/oom_kill.c:144 stack backtrace: CPU: 0 PID: 8814 Comm: syz-executor.2 Tainted: G W 5.17.0-rc1-next-20220124-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_lock_invalid_wait_context kernel/locking/lockdep.c:4678 [inline] check_wait_context kernel/locking/lockdep.c:4739 [inline] __lock_acquire.cold+0x213/0x3ab kernel/locking/lockdep.c:4977 lock_acquire kernel/locking/lockdep.c:5639 [inline] lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5604 __mutex_lock_common kernel/locking/mutex.c:600 [inline] __mutex_lock+0x12f/0x12f0 kernel/locking/mutex.c:733 futex_cleanup_begin kernel/futex/core.c:1058 [inline] futex_exit_release+0x26/0x220 kernel/futex/core.c:1110 __oom_kill_process+0x373/0xf90 mm/oom_kill.c:893 oom_kill_process+0xd7/0x5b0 mm/oom_kill.c:1003 out_of_memory+0x358/0x14b0 mm/oom_kill.c:1132 mem_cgroup_out_of_memory+0x206/0x270 mm/memcontrol.c:1617 memory_max_write+0x263/0x3c0 mm/memcontrol.c:6313 cgroup_file_write+0x1de/0x760 kernel/cgroup/cgroup.c:3882 kernfs_fop_write_iter+0x342/0x500 fs/kernfs/file.c:296 call_write_iter include/linux/fs.h:2074 [inline] do_iter_readv_writev+0x47a/0x750 fs/read_write.c:725 do_iter_write+0x188/0x710 fs/read_write.c:851 vfs_iter_write+0x70/0xa0 fs/read_write.c:892 iter_file_splice_write+0x723/0xc70 fs/splice.c:689 do_splice_from fs/splice.c:767 [inline] direct_splice_actor+0x110/0x180 fs/splice.c:936 splice_direct_to_actor+0x34b/0x8c0 fs/splice.c:891 do_splice_direct+0x1b3/0x280 fs/splice.c:979 do_sendfile+0xaf2/0x1250 fs/read_write.c:1245 __do_sys_sendfile64 fs/read_write.c:1310 [inline] __se_sys_sendfile64 fs/read_write.c:1296 [inline] __x64_sys_sendfile64+0x1cc/0x210 fs/read_write.c:1296 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7feb94c96059 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007feb9360b168 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 00007feb94da8f60 RCX: 00007feb94c96059 RDX: 0000000000000000 RSI: 0000000000000012 RDI: 0000000000000012 RBP: 00007feb94cf008d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000003 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fff5123f54f R14: 00007feb9360b300 R15: 0000000000022000 BUG: sleeping function called from invalid context at kernel/futex/core.c:750 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 8814, name: syz-executor.2 preempt_count: 1, expected: 0 RCU nest depth: 0, expected: 0 INFO: lockdep is turned off. Preemption disabled at: [<0000000000000000>] 0x0 CPU: 0 PID: 8814 Comm: syz-executor.2 Tainted: G W 5.17.0-rc1-next-20220124-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 __might_resched.cold+0x222/0x26b kernel/sched/core.c:9576 __might_fault+0x6c/0x170 mm/memory.c:5269 fetch_robust_entry kernel/futex/core.c:750 [inline] exit_robust_list+0x5d/0x2c0 kernel/futex/core.c:778 futex_cleanup kernel/futex/core.c:1010 [inline] futex_exit_release+0x183/0x220 kernel/futex/core.c:1111 __oom_kill_process+0x373/0xf90 mm/oom_kill.c:893 oom_kill_process+0xd7/0x5b0 mm/oom_kill.c:1003 out_of_memory+0x358/0x14b0 mm/oom_kill.c:1132 mem_cgroup_out_of_memory+0x206/0x270 mm/memcontrol.c:1617 memory_max_write+0x263/0x3c0 mm/memcontrol.c:6313 cgroup_file_write+0x1de/0x760 kernel/cgroup/cgroup.c:3882 kernfs_fop_write_iter+0x342/0x500 fs/kernfs/file.c:296 call_write_iter include/linux/fs.h:2074 [inline] do_iter_readv_writev+0x47a/0x750 fs/read_write.c:725 do_iter_write+0x188/0x710 fs/read_write.c:851 vfs_iter_write+0x70/0xa0 fs/read_write.c:892 iter_file_splice_write+0x723/0xc70 fs/splice.c:689 do_splice_from fs/splice.c:767 [inline] direct_splice_actor+0x110/0x180 fs/splice.c:936 splice_direct_to_actor+0x34b/0x8c0 fs/splice.c:891 do_splice_direct+0x1b3/0x280 fs/splice.c:979 do_sendfile+0xaf2/0x1250 fs/read_write.c:1245 __do_sys_sendfile64 fs/read_write.c:1310 [inline] __se_sys_sendfile64 fs/read_write.c:1296 [inline] __x64_sys_sendfile64+0x1cc/0x210 fs/read_write.c:1296 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7feb94c96059 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007feb9360b168 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 00007feb94da8f60 RCX: 00007feb94c96059 RDX: 0000000000000000 RSI: 0000000000000012 RDI: 0000000000000012 RBP: 00007feb94cf008d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000003 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fff5123f54f R14: 00007feb9360b300 R15: 0000000000022000 Memory cgroup out of memory: Killed process 3639 (syz-executor.1) total-vm:56676kB, anon-rss:396kB, file-rss:15208kB, shmem-rss:4kB, UID:0 pgtables:84kB oom_score_adj:0