syzbot


upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save

Status: closed as dup on 2021/07/28 13:59
Subsystems: mm
[Documentation on labels]
Reported-by: syzbot+0fb43da032dd2c0d2dbb@syzkaller.appspotmail.com
First crash: 1264d, last: 1260d
Duplicate of
Title Repro Cause bisect Fix bisect Count Last Reported
BUG: sleeping function called from invalid context in stack_depot_save mm C unreliable 8490 1237d 1266d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save 0 (1) 2021/07/06 10:33

Sample crash report:
BUG: sleeping function called from invalid context at mm/page_alloc.c:5167
in_atomic(): 0, irqs_disabled(): 1, non_block: 0, pid: 2, name: kthreadd
1 lock held by kthreadd/2:
 #0: ffff8880b9c4d660 (lock#2){....}-{2:2}, at: __alloc_pages_bulk+0x4ad/0x1870 mm/page_alloc.c:5279
irq event stamp: 1804
hardirqs last  enabled at (1803): [<ffffffff81ba1be2>] slab_alloc_node mm/slab.c:3256 [inline]
hardirqs last  enabled at (1803): [<ffffffff81ba1be2>] kmem_cache_alloc_node_trace+0x412/0x5d0 mm/slab.c:3617
hardirqs last disabled at (1804): [<ffffffff81b16d47>] __alloc_pages_bulk+0x1017/0x1870 mm/page_alloc.c:5279
softirqs last  enabled at (1716): [<ffffffff812b17ec>] memcpy include/linux/fortify-string.h:191 [inline]
softirqs last  enabled at (1716): [<ffffffff812b17ec>] fpu_clone+0x13c/0x600 arch/x86/kernel/fpu/core.c:275
softirqs last disabled at (1714): [<ffffffff812b172e>] fpu_clone+0x7e/0x600 arch/x86/kernel/fpu/core.c:266
CPU: 0 PID: 2 Comm: kthreadd Not tainted 5.13.0-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:9154
 prepare_alloc_pages+0x3da/0x580 mm/page_alloc.c:5167
 __alloc_pages+0x12f/0x500 mm/page_alloc.c:5363
 alloc_pages+0x18c/0x2a0 mm/mempolicy.c:2244
 stack_depot_save+0x39d/0x4e0 lib/stackdepot.c:303
 save_stack+0x15e/0x1e0 mm/page_owner.c:120
 __set_page_owner+0x50/0x290 mm/page_owner.c:181
 prep_new_page mm/page_alloc.c:2433 [inline]
 __alloc_pages_bulk+0x8b9/0x1870 mm/page_alloc.c:5301
 alloc_pages_bulk_array_node include/linux/gfp.h:557 [inline]
 vm_area_alloc_pages mm/vmalloc.c:2793 [inline]
 __vmalloc_area_node mm/vmalloc.c:2863 [inline]
 __vmalloc_node_range+0x39d/0x960 mm/vmalloc.c:2966
 alloc_thread_stack_node kernel/fork.c:245 [inline]
 dup_task_struct kernel/fork.c:875 [inline]
 copy_process+0x8db/0x74d0 kernel/fork.c:1952
 kernel_clone+0xe7/0xac0 kernel/fork.c:2509
 kernel_thread+0xb5/0xf0 kernel/fork.c:2561
 create_kthread kernel/kthread.c:342 [inline]
 kthreadd+0x4ea/0x750 kernel/kthread.c:685
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

============================================
WARNING: possible recursive locking detected
5.13.0-syzkaller #0 Tainted: G        W        
--------------------------------------------
kthreadd/2 is trying to acquire lock:
ffff8880b9c4d660 (lock#2){....}-{2:2}, at: rmqueue_pcplist mm/page_alloc.c:3663 [inline]
ffff8880b9c4d660 (lock#2){....}-{2:2}, at: rmqueue mm/page_alloc.c:3701 [inline]
ffff8880b9c4d660 (lock#2){....}-{2:2}, at: get_page_from_freelist+0x486/0x2f80 mm/page_alloc.c:4163

but task is already holding lock:
ffff8880b9c4d660 (lock#2){....}-{2:2}, at: __alloc_pages_bulk+0x4ad/0x1870 mm/page_alloc.c:5279

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(lock#2);
  lock(lock#2);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

1 lock held by kthreadd/2:
 #0: ffff8880b9c4d660 (lock#2){....}-{2:2}, at: __alloc_pages_bulk+0x4ad/0x1870 mm/page_alloc.c:5279

stack backtrace:
CPU: 0 PID: 2 Comm: kthreadd Tainted: G        W         5.13.0-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_deadlock_bug kernel/locking/lockdep.c:2944 [inline]
 check_deadlock kernel/locking/lockdep.c:2987 [inline]
 validate_chain kernel/locking/lockdep.c:3776 [inline]
 __lock_acquire.cold+0x149/0x3ab kernel/locking/lockdep.c:5015
 lock_acquire kernel/locking/lockdep.c:5625 [inline]
 lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5590
 local_lock_acquire include/linux/local_lock_internal.h:42 [inline]
 rmqueue_pcplist mm/page_alloc.c:3663 [inline]
 rmqueue mm/page_alloc.c:3701 [inline]
 get_page_from_freelist+0x4aa/0x2f80 mm/page_alloc.c:4163
 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5374
 alloc_pages+0x18c/0x2a0 mm/mempolicy.c:2244
 stack_depot_save+0x39d/0x4e0 lib/stackdepot.c:303
 save_stack+0x15e/0x1e0 mm/page_owner.c:120
 __set_page_owner+0x50/0x290 mm/page_owner.c:181
 prep_new_page mm/page_alloc.c:2433 [inline]
 __alloc_pages_bulk+0x8b9/0x1870 mm/page_alloc.c:5301
 alloc_pages_bulk_array_node include/linux/gfp.h:557 [inline]
 vm_area_alloc_pages mm/vmalloc.c:2793 [inline]
 __vmalloc_area_node mm/vmalloc.c:2863 [inline]
 __vmalloc_node_range+0x39d/0x960 mm/vmalloc.c:2966
 alloc_thread_stack_node kernel/fork.c:245 [inline]
 dup_task_struct kernel/fork.c:875 [inline]
 copy_process+0x8db/0x74d0 kernel/fork.c:1952
 kernel_clone+0xe7/0xac0 kernel/fork.c:2509
 kernel_thread+0xb5/0xf0 kernel/fork.c:2561
 create_kthread kernel/kthread.c:342 [inline]
 kthreadd+0x4ea/0x750 kernel/kthread.c:685
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

Crashes (69):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/07/11 02:44 upstream de5540965853 8f5a7b8c .config console log report ci-upstream-kasan-gce-selinux-root upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/10 20:36 upstream af4cf6a5689a 8f5a7b8c .config console log report ci-upstream-kasan-gce upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/10 19:27 upstream af4cf6a5689a 8f5a7b8c .config console log report ci-upstream-kasan-gce-selinux-root upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/10 00:35 upstream 50be9417e23a 8f5a7b8c .config console log report ci-upstream-kasan-gce-selinux-root upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/09 23:28 upstream 50be9417e23a 8f5a7b8c .config console log report ci-upstream-kasan-gce-smack-root upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/09 22:06 upstream 50be9417e23a 281e815f .config console log report ci-upstream-kasan-gce upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/09 20:54 upstream 9b76d71fa8be 281e815f .config console log report ci-upstream-kasan-gce-selinux-root upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/09 09:37 upstream f55966571d5e 281e815f .config console log report ci-upstream-kasan-gce-smack-root upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/09 09:02 upstream f55966571d5e 281e815f .config console log report ci-upstream-kasan-gce-selinux-root upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/09 09:02 upstream f55966571d5e 281e815f .config console log report ci-upstream-kasan-gce-selinux-root upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/08 21:24 upstream f55966571d5e 1b20171a .config console log report ci-upstream-kasan-gce-smack-root upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/08 21:05 upstream f55966571d5e 1b20171a .config console log report ci-upstream-kasan-gce-selinux-root upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/08 21:05 upstream f55966571d5e 1b20171a .config console log report ci-upstream-kasan-gce-selinux-root upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/08 21:05 upstream f55966571d5e 1b20171a .config console log report ci-upstream-kasan-gce-selinux-root upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/08 17:26 upstream e9f1cbc0c411 1b20171a .config console log report ci-upstream-kasan-gce-selinux-root upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/08 17:26 upstream e9f1cbc0c411 1b20171a .config console log report ci-upstream-kasan-gce-selinux-root upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/08 17:26 upstream e9f1cbc0c411 1b20171a .config console log report ci-upstream-kasan-gce-selinux-root upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/08 02:17 upstream e9f1cbc0c411 95793bce .config console log report ci-upstream-kasan-gce-selinux-root upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/08 02:17 upstream e9f1cbc0c411 95793bce .config console log report ci-upstream-kasan-gce-selinux-root upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/08 01:43 upstream e9f1cbc0c411 95793bce .config console log report ci-upstream-kasan-gce-smack-root upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/08 01:24 upstream e9f1cbc0c411 95793bce .config console log report ci-upstream-kasan-gce-root upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/08 01:24 upstream e9f1cbc0c411 95793bce .config console log report ci-upstream-kasan-gce-root upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/08 00:26 upstream a931dd33d370 4846d5c1 .config console log report ci-upstream-kasan-gce-smack-root upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/08 00:26 upstream a931dd33d370 4846d5c1 .config console log report ci-upstream-kasan-gce-smack-root upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/07 23:51 upstream a931dd33d370 4846d5c1 .config console log report ci-upstream-kasan-gce-selinux-root upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/07 23:51 upstream a931dd33d370 4846d5c1 .config console log report ci-upstream-kasan-gce-selinux-root upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/07 07:36 upstream 77d34a4683b0 4846d5c1 .config console log report ci-upstream-kasan-gce upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/07 07:03 upstream 77d34a4683b0 4846d5c1 .config console log report ci-upstream-kasan-gce-selinux-root upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/07 07:03 upstream 77d34a4683b0 4846d5c1 .config console log report ci-upstream-kasan-gce-selinux-root upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/07 06:47 upstream 77d34a4683b0 4846d5c1 .config console log report ci-upstream-kasan-gce-root upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/06 23:51 upstream 77d34a4683b0 cca78469 .config console log report ci-upstream-kasan-gce-selinux-root upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/06 23:51 upstream 77d34a4683b0 cca78469 .config console log report ci-upstream-kasan-gce-selinux-root upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/06 23:51 upstream 77d34a4683b0 cca78469 .config console log report ci-upstream-kasan-gce-selinux-root upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/06 23:16 upstream 77d34a4683b0 cca78469 .config console log report ci-upstream-kasan-gce-root upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/06 22:58 upstream 77d34a4683b0 cca78469 .config console log report ci-upstream-kasan-gce upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/06 22:41 upstream 77d34a4683b0 cca78469 .config console log report ci-upstream-kasan-gce-smack-root upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/06 22:41 upstream 77d34a4683b0 cca78469 .config console log report ci-upstream-kasan-gce-smack-root upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/06 20:12 upstream 79160a603bdb cca78469 .config console log report ci-upstream-kasan-gce-selinux-root upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/06 20:12 upstream 79160a603bdb cca78469 .config console log report ci-upstream-kasan-gce-selinux-root upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/06 20:12 upstream 79160a603bdb cca78469 .config console log report ci-upstream-kasan-gce-selinux-root upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/06 19:24 upstream 79160a603bdb cca78469 .config console log report ci-upstream-kasan-gce-root upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/06 10:18 upstream 79160a603bdb 6c4484eb .config console log report ci-upstream-kasan-gce-selinux-root upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/06 10:18 upstream 79160a603bdb 6c4484eb .config console log report ci-upstream-kasan-gce-selinux-root upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/11 03:57 upstream de5540965853 8f5a7b8c .config console log report ci-upstream-kasan-gce-386 upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/10 21:30 upstream 1e16624d7b43 8f5a7b8c .config console log report ci-upstream-kasan-gce-386 upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/08 20:48 upstream f55966571d5e 1b20171a .config console log report ci-upstream-kasan-gce-386 upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/08 18:00 upstream e9f1cbc0c411 1b20171a .config console log report ci-upstream-kasan-gce-386 upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/08 18:00 upstream e9f1cbc0c411 1b20171a .config console log report ci-upstream-kasan-gce-386 upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/06 23:33 upstream 77d34a4683b0 cca78469 .config console log report ci-upstream-kasan-gce-386 upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
2021/07/06 19:55 upstream 79160a603bdb cca78469 .config console log report ci-upstream-kasan-gce-386 upstream boot error: BUG: sleeping function called from invalid context in stack_depot_save
* Struck through repros no longer work on HEAD.