syzbot


BUG: sleeping function called from invalid context in futex_exit_release

Status: closed as invalid on 2022/10/12 17:42
Subsystems: mm
[Documentation on labels]
First crash: 873d, last: 830d
Cause bisection: introduced by (bisect log) :
commit e4b8954074f6d0db01c8c97d338a67f9389c042f
Author: Eric Dumazet <edumazet@google.com>
Date: Tue Dec 7 01:30:37 2021 +0000

  netlink: add net device refcount tracker to struct ethnl_req_info

Crash: WARNING in ref_tracker_dir_exit (log)
Repro: C syz .config
  

Sample crash report:
[   4923]     0  4923     4459     4209    73728        0          1000 syz-executor379
[   4927]     0  4927     4459     4176    73728        0          1000 syz-executor379
[   4931]     0  4931     4459     4176    73728        0          1000 syz-executor379
[   4932]     0  4932     4426     2010    57344        0          1000 syz-executor379
oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0-1,global_oom,task_memcg=/,task=syz-executor379,pid=4923,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: 3606, name: sshd
preempt_count: 1, expected: 0
RCU nest depth: 0, expected: 0
3 locks held by sshd/3606:
 #0: ffff88801a040f88 (mapping.invalidate_lock){++++}-{3:3}, at: filemap_invalidate_lock_shared include/linux/fs.h:832 [inline]
 #0: ffff88801a040f88 (mapping.invalidate_lock){++++}-{3:3}, at: filemap_fault+0x1622/0x22b0 mm/filemap.c:3137
 #1: ffffffff8bc640a8 (oom_lock){+.+.}-{3:3}, at: __alloc_pages_may_oom mm/page_alloc.c:4278 [inline]
 #1: ffffffff8bc640a8 (oom_lock){+.+.}-{3:3}, at: __alloc_pages_slowpath.constprop.0+0xd80/0x2080 mm/page_alloc.c:5058
 #2: ffff88801eb426a0 (&p->alloc_lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:354 [inline]
 #2: ffff88801eb426a0 (&p->alloc_lock){+.+.}-{2:2}, at: task_lock include/linux/sched/task.h:178 [inline]
 #2: ffff88801eb426a0 (&p->alloc_lock){+.+.}-{2:2}, at: find_lock_task_mm+0xe3/0x2b0 mm/oom_kill.c:144
Preemption disabled at:
[<0000000000000000>] 0x0
CPU: 1 PID: 3606 Comm: sshd Not tainted 5.16.0-rc5-next-20211215-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <TASK>
 __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:9583
 __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/0x1460 mm/oom_kill.c:1132
 __alloc_pages_may_oom mm/page_alloc.c:4329 [inline]
 __alloc_pages_slowpath.constprop.0+0x1ac0/0x2080 mm/page_alloc.c:5058
 __alloc_pages+0x412/0x500 mm/page_alloc.c:5389
 alloc_pages+0x1aa/0x310 mm/mempolicy.c:2271
 folio_alloc+0x1c/0x70 mm/mempolicy.c:2281
 filemap_alloc_folio mm/filemap.c:1000 [inline]
 __filemap_get_folio+0x5f4/0xe50 mm/filemap.c:2003
 filemap_fault+0x166d/0x22b0 mm/filemap.c:3140
 __do_fault+0x10d/0x790 mm/memory.c:3846
 do_read_fault mm/memory.c:4161 [inline]
 do_fault mm/memory.c:4290 [inline]
 handle_pte_fault mm/memory.c:4548 [inline]
 __handle_mm_fault+0x2761/0x4160 mm/memory.c:4683
 handle_mm_fault+0x1c8/0x790 mm/memory.c:4781
 do_user_addr_fault+0x489/0x11c0 arch/x86/mm/fault.c:1397
 handle_page_fault arch/x86/mm/fault.c:1484 [inline]
 exc_page_fault+0x9e/0x180 arch/x86/mm/fault.c:1540
 asm_exc_page_fault+0x1e/0x30 arch/x86/include/asm/idtentry.h:568
RIP: 0033:0x7f3da66fdb90
Code: Unable to access opcode bytes at RIP 0x7f3da66fdb66.
RSP: 002b:00007fff0e2f3378 EFLAGS: 00010202
RAX: 0000000000000000 RBX: 0000000000000080 RCX: 0000000000000004
RDX: 00007fff0e2f3458 RSI: 00007fff0e2f33d8 RDI: 0000000000000001
RBP: 00007f3da6e090b0 R08: 00007f3da6df5c40 R09: 00007fff0e315080
R10: 00007fff0e3150f0 R11: 000000000000532a R12: 0000000000000004
R13: 0000000000000001 R14: 00007fff0e2f33d8 R15: 00007fff0e2f3458
 </TASK>

=============================
[ BUG: Invalid wait context ]
5.16.0-rc5-next-20211215-syzkaller #0 Tainted: G        W        
-----------------------------
sshd/3606 is trying to lock:
ffff88801eb430c0 (&tsk->futex_exit_mutex){+.+.}-{3:3}, at: futex_cleanup_begin kernel/futex/core.c:1058 [inline]
ffff88801eb430c0 (&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}
3 locks held by sshd/3606:
 #0: ffff88801a040f88 (mapping.invalidate_lock){++++}-{3:3}, at: filemap_invalidate_lock_shared include/linux/fs.h:832 [inline]
 #0: ffff88801a040f88 (mapping.invalidate_lock){++++}-{3:3}, at: filemap_fault+0x1622/0x22b0 mm/filemap.c:3137
 #1: ffffffff8bc640a8 (oom_lock){+.+.}-{3:3}, at: __alloc_pages_may_oom mm/page_alloc.c:4278 [inline]
 #1: ffffffff8bc640a8 (oom_lock){+.+.}-{3:3}, at: __alloc_pages_slowpath.constprop.0+0xd80/0x2080 mm/page_alloc.c:5058
 #2: ffff88801eb426a0 (&p->alloc_lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:354 [inline]
 #2: ffff88801eb426a0 (&p->alloc_lock){+.+.}-{2:2}, at: task_lock include/linux/sched/task.h:178 [inline]
 #2: ffff88801eb426a0 (&p->alloc_lock){+.+.}-{2:2}, at: find_lock_task_mm+0xe3/0x2b0 mm/oom_kill.c:144
stack backtrace:
CPU: 1 PID: 3606 Comm: sshd Tainted: G        W         5.16.0-rc5-next-20211215-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <TASK>
 __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/0x1460 mm/oom_kill.c:1132
 __alloc_pages_may_oom mm/page_alloc.c:4329 [inline]
 __alloc_pages_slowpath.constprop.0+0x1ac0/0x2080 mm/page_alloc.c:5058
 __alloc_pages+0x412/0x500 mm/page_alloc.c:5389
 alloc_pages+0x1aa/0x310 mm/mempolicy.c:2271
 folio_alloc+0x1c/0x70 mm/mempolicy.c:2281
 filemap_alloc_folio mm/filemap.c:1000 [inline]
 __filemap_get_folio+0x5f4/0xe50 mm/filemap.c:2003
 filemap_fault+0x166d/0x22b0 mm/filemap.c:3140
 __do_fault+0x10d/0x790 mm/memory.c:3846
 do_read_fault mm/memory.c:4161 [inline]
 do_fault mm/memory.c:4290 [inline]
 handle_pte_fault mm/memory.c:4548 [inline]
 __handle_mm_fault+0x2761/0x4160 mm/memory.c:4683
 handle_mm_fault+0x1c8/0x790 mm/memory.c:4781
 do_user_addr_fault+0x489/0x11c0 arch/x86/mm/fault.c:1397
 handle_page_fault arch/x86/mm/fault.c:1484 [inline]
 exc_page_fault+0x9e/0x180 arch/x86/mm/fault.c:1540
 asm_exc_page_fault+0x1e/0x30 arch/x86/include/asm/idtentry.h:568
RIP: 0033:0x7f3da66fdb90
Code: Unable to access opcode bytes at RIP 0x7f3da66fdb66.
RSP: 002b:00007fff0e2f3378 EFLAGS: 00010202
RAX: 0000000000000000 RBX: 0000000000000080 RCX: 0000000000000004
RDX: 00007fff0e2f3458 RSI: 00007fff0e2f33d8 RDI: 0000000000000001
RBP: 00007f3da6e090b0 R08: 00007f3da6df5c40 R09: 00007fff0e315080
R10: 00007fff0e3150f0 R11: 000000000000532a R12: 0000000000000004
R13: 0000000000000001 R14: 00007fff0e2f33d8 R15: 00007fff0e2f3458
 </TASK>
Out of memory: Killed process 4923 (syz-executor379) total-vm:17836kB, anon-rss:16836kB, file-rss:0kB, shmem-rss:0kB, UID:0 pgtables:72kB oom_score_adj:1000

Crashes (803):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/12/16 02:43 linux-next 93bf6eee76c0 572bcb40 .config console log report syz C ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/28 04:10 linux-next 0eb96e2c58c0 495e00c5 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/28 02:17 linux-next 0eb96e2c58c0 64a8e201 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/28 01:07 linux-next 0eb96e2c58c0 64a8e201 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/28 00:06 linux-next 0eb96e2c58c0 64a8e201 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/27 22:51 linux-next 0eb96e2c58c0 64a8e201 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/27 21:28 linux-next 0eb96e2c58c0 64a8e201 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/27 20:26 linux-next 0eb96e2c58c0 64a8e201 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/27 19:16 linux-next 0eb96e2c58c0 64a8e201 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/27 17:00 linux-next 0eb96e2c58c0 64a8e201 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/27 15:42 linux-next 0eb96e2c58c0 2cbffd88 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/27 14:28 linux-next 0eb96e2c58c0 2cbffd88 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/27 13:35 linux-next 0eb96e2c58c0 2cbffd88 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/27 11:11 linux-next 0eb96e2c58c0 2cbffd88 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/27 10:06 linux-next 0eb96e2c58c0 2cbffd88 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/27 09:57 linux-next 0eb96e2c58c0 2cbffd88 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/27 08:50 linux-next 0eb96e2c58c0 2cbffd88 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/27 07:00 linux-next 0eb96e2c58c0 2cbffd88 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/27 05:24 linux-next 0eb96e2c58c0 2cbffd88 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/27 03:20 linux-next 74e5dee6a5b9 2cbffd88 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/27 01:49 linux-next 74e5dee6a5b9 2cbffd88 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/27 00:04 linux-next 74e5dee6a5b9 2cbffd88 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/26 23:03 linux-next 74e5dee6a5b9 2cbffd88 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/26 20:21 linux-next 74e5dee6a5b9 2cbffd88 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/26 19:27 linux-next 74e5dee6a5b9 2cbffd88 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/26 18:26 linux-next 74e5dee6a5b9 2cbffd88 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/26 17:07 linux-next 74e5dee6a5b9 2cbffd88 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/26 14:31 linux-next 74e5dee6a5b9 2cbffd88 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/26 13:21 linux-next 74e5dee6a5b9 2cbffd88 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/26 11:49 linux-next 74e5dee6a5b9 2cbffd88 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/26 11:36 linux-next 74e5dee6a5b9 2cbffd88 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/26 10:16 linux-next 74e5dee6a5b9 2cbffd88 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/26 08:57 linux-next 74e5dee6a5b9 2cbffd88 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/26 07:24 linux-next 74e5dee6a5b9 2cbffd88 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/26 05:36 linux-next 74e5dee6a5b9 2cbffd88 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/26 04:49 linux-next 74e5dee6a5b9 2cbffd88 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/26 03:33 linux-next 74e5dee6a5b9 2cbffd88 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/26 01:37 linux-next 74e5dee6a5b9 2cbffd88 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/26 00:35 linux-next 74e5dee6a5b9 2cbffd88 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/25 23:33 linux-next 74e5dee6a5b9 2cbffd88 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/25 23:31 linux-next 74e5dee6a5b9 2cbffd88 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/25 20:45 linux-next 74e5dee6a5b9 2cbffd88 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2022/01/25 18:53 linux-next 74e5dee6a5b9 2cbffd88 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
2021/12/16 01:21 linux-next 93bf6eee76c0 572bcb40 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in futex_exit_release
* Struck through repros no longer work on HEAD.