syzbot


BUG: sleeping function called from invalid context in __munlock_pagevec

Status: upstream: reported C repro on 2021/07/10 22:12
Reported-by: syzbot+cf9c548279bff83b0c97@syzkaller.appspotmail.com
First crash: 451d, last: 446d

Cause bisection: introduced by (bisect log) [merge commit]:
commit 68afbd8459e9c8a86544b5e884041981b837e162
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: Mon Jun 14 07:07:45 2021 +0000

  Merge tag 'v5.13-rc6' into driver-core-next

Crash: BUG: sleeping function called from invalid context in lock_sock_nested (log)
Repro: C syz .config

Fix bisection: fixed by (bisect log) [no-op commit]:
commit 0c4f8fd3ed9cb27228497f0ae495ea6cef7017b1
Author: Peter Robinson <pbrobinson@gmail.com>
Date: Sun Jun 27 10:59:55 2021 +0000

  ASoC: remove zte zx dangling kconfig

Patch testing requests:
Created Duration User Patch Repo Result
2022/09/28 15:30 19m upstream OK log
2021/07/11 06:12 17m chouhan.shreyansh630@gmail.com linux-next report log

Sample crash report:
BUG: sleeping function called from invalid context at include/linux/pagemap.h:674
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 8467, name: syz-executor631
1 lock held by syz-executor631/8467:
 #0: ffff8880343e0978 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:359 [inline]
 #0: ffff8880343e0978 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: map_pte mm/page_vma_mapped.c:52 [inline]
 #0: ffff8880343e0978 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: page_vma_mapped_walk+0xd87/0x24f0 mm/page_vma_mapped.c:261
Preemption disabled at:
[<0000000000000000>] 0x0
CPU: 0 PID: 8467 Comm: syz-executor631 Not tainted 5.13.0-next-20210707-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:105
 ___might_sleep.cold+0x1f1/0x237 kernel/sched/core.c:9171
 lock_page include/linux/pagemap.h:674 [inline]
 __munlock_pagevec+0xa22/0x2340 mm/mlock.c:314
 munlock_vma_pages_range+0x9d7/0xf00 mm/mlock.c:475
 munlock_vma_pages_all mm/internal.h:354 [inline]
 unlock_range mm/mmap.c:2811 [inline]
 exit_mmap+0x47a/0x620 mm/mmap.c:3188
 __mmput+0x122/0x470 kernel/fork.c:1152
 mmput+0x58/0x60 kernel/fork.c:1173
 exit_mm kernel/exit.c:501 [inline]
 do_exit+0xae2/0x2a60 kernel/exit.c:812
 do_group_exit+0x125/0x310 kernel/exit.c:922
 __do_sys_exit_group kernel/exit.c:933 [inline]
 __se_sys_exit_group kernel/exit.c:931 [inline]
 __x64_sys_exit_group+0x3a/0x50 kernel/exit.c:931
 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:0x43e969
Code: Unable to access opcode bytes at RIP 0x43e93f.
RSP: 002b:00007ffce2d3a7a8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 00000000004b02f0 RCX: 000000000043e969
RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000000
RBP: 0000000000000000 R08: ffffffffffffffc0 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000004b02f0
R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000001

=============================
[ BUG: Invalid wait context ]
5.13.0-next-20210707-syzkaller #0 Tainted: G        W        
-----------------------------
syz-executor631/8467 is trying to lock:
ffff888035ea6000 (&mapping->i_mmap_rwsem){++++}-{3:3}, at: i_mmap_lock_read include/linux/fs.h:514 [inline]
ffff888035ea6000 (&mapping->i_mmap_rwsem){++++}-{3:3}, at: rmap_walk_file+0x52f/0x710 mm/rmap.c:2337
other info that might help us debug this:
context-{4:4}
1 lock held by syz-executor631/8467:
 #0: ffff8880343e0978 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:359 [inline]
 #0: ffff8880343e0978 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: map_pte mm/page_vma_mapped.c:52 [inline]
 #0: ffff8880343e0978 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: page_vma_mapped_walk+0xd87/0x24f0 mm/page_vma_mapped.c:261
stack backtrace:
CPU: 0 PID: 8467 Comm: syz-executor631 Tainted: G        W         5.13.0-next-20210707-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:105
 print_lock_invalid_wait_context kernel/locking/lockdep.c:4666 [inline]
 check_wait_context kernel/locking/lockdep.c:4727 [inline]
 __lock_acquire.cold+0x213/0x3ab kernel/locking/lockdep.c:4965
 lock_acquire kernel/locking/lockdep.c:5625 [inline]
 lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5590
 down_read+0x9a/0x440 kernel/locking/rwsem.c:1353
 i_mmap_lock_read include/linux/fs.h:514 [inline]
 rmap_walk_file+0x52f/0x710 mm/rmap.c:2337
 rmap_walk+0x10d/0x190 mm/rmap.c:2366
 page_mlock+0x448/0x650 mm/rmap.c:2029
 __munlock_isolated_page+0x88/0x410 mm/mlock.c:122
 __munlock_pagevec+0xd7f/0x2340 mm/mlock.c:322
 munlock_vma_pages_range+0x9d7/0xf00 mm/mlock.c:475
 munlock_vma_pages_all mm/internal.h:354 [inline]
 unlock_range mm/mmap.c:2811 [inline]
 exit_mmap+0x47a/0x620 mm/mmap.c:3188
 __mmput+0x122/0x470 kernel/fork.c:1152
 mmput+0x58/0x60 kernel/fork.c:1173
 exit_mm kernel/exit.c:501 [inline]
 do_exit+0xae2/0x2a60 kernel/exit.c:812
 do_group_exit+0x125/0x310 kernel/exit.c:922
 __do_sys_exit_group kernel/exit.c:933 [inline]
 __se_sys_exit_group kernel/exit.c:931 [inline]
 __x64_sys_exit_group+0x3a/0x50 kernel/exit.c:931
 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:0x43e969
Code: Unable to access opcode bytes at RIP 0x43e93f.
RSP: 002b:00007ffce2d3a7a8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 00000000004b02f0 RCX: 000000000043e969
RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000000
RBP: 0000000000000000 R08: ffffffffffffffc0 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000004b02f0
R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000001

Crashes (15):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-linux-next-kasan-gce-root 2021/07/07 18:25 linux-next ee268dee405b 4846d5c1 .config log report syz C BUG: sleeping function called from invalid context in __munlock_pagevec
ci-upstream-kasan-gce-smack-root 2021/07/12 01:01 upstream 98f7fdced2e0 8f5a7b8c .config log report syz C BUG: sleeping function called from invalid context in __munlock_pagevec
ci-upstream-kasan-gce-smack-root 2021/07/12 02:10 upstream 98f7fdced2e0 8f5a7b8c .config log report info BUG: sleeping function called from invalid context in __munlock_pagevec
ci-upstream-kasan-gce-smack-root 2021/07/12 01:31 upstream 98f7fdced2e0 8f5a7b8c .config log report info BUG: sleeping function called from invalid context in __munlock_pagevec
ci-upstream-kasan-gce-root 2021/07/11 19:29 upstream 98f7fdced2e0 8f5a7b8c .config log report info BUG: sleeping function called from invalid context in __munlock_pagevec
ci-upstream-kasan-gce-root 2021/07/11 19:21 upstream 98f7fdced2e0 8f5a7b8c .config log report info BUG: sleeping function called from invalid context in __munlock_pagevec
ci-upstream-linux-next-kasan-gce-root 2021/07/11 01:57 linux-next 92510a7fd93c 8f5a7b8c .config log report info BUG: sleeping function called from invalid context in __munlock_pagevec
ci-upstream-linux-next-kasan-gce-root 2021/07/11 01:47 linux-next 92510a7fd93c 8f5a7b8c .config log report info BUG: sleeping function called from invalid context in __munlock_pagevec
ci-upstream-linux-next-kasan-gce-root 2021/07/10 06:16 linux-next 92510a7fd93c 8f5a7b8c .config log report info BUG: sleeping function called from invalid context in __munlock_pagevec
ci-upstream-linux-next-kasan-gce-root 2021/07/10 01:04 linux-next 92510a7fd93c 8f5a7b8c .config log report info BUG: sleeping function called from invalid context in __munlock_pagevec
ci-upstream-linux-next-kasan-gce-root 2021/07/09 09:32 linux-next 92510a7fd93c 281e815f .config log report info BUG: sleeping function called from invalid context in __munlock_pagevec
ci-upstream-linux-next-kasan-gce-root 2021/07/08 15:50 linux-next e2f74b13dbe6 95793bce .config log report info BUG: sleeping function called from invalid context in __munlock_pagevec
ci-upstream-linux-next-kasan-gce-root 2021/07/07 09:04 linux-next ee268dee405b 4846d5c1 .config log report info BUG: sleeping function called from invalid context in __munlock_pagevec
ci-upstream-linux-next-kasan-gce-root 2021/07/07 02:24 linux-next d72e63193059 cca78469 .config log report info BUG: sleeping function called from invalid context in __munlock_pagevec
ci-upstream-linux-next-kasan-gce-root 2021/07/06 22:07 linux-next d72e63193059 cca78469 .config log report info BUG: sleeping function called from invalid context in __munlock_pagevec
* Struck through repros no longer work on HEAD.