syzbot


BUG: spinlock recursion in copy_process

Status: closed as invalid on 2024/09/13 10:29
Subsystems: kernel
[Documentation on labels]
First crash: 160d, last: 153d

Sample crash report:
BUG: spinlock recursion on CPU#0, syz.3.4/5323
==================================================================
BUG: KASAN: stack-out-of-bounds in cmp_ex_search+0x34/0xa0 lib/extable.c:94
Read of size 8 at addr ffffc900040061c0 by task syz.3.4/5323

CPU: 1 UID: 0 PID: 5323 Comm: syz.3.4 Not tainted 6.11.0-rc4-next-20240820-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
 print_address_description mm/kasan/report.c:377 [inline]
 print_report+0x169/0x550 mm/kasan/report.c:488
 kasan_report+0x143/0x180 mm/kasan/report.c:601
 </TASK>

The buggy address belongs to stack of task syz.3.4/5323
 and is located at offset 32 in frame:
 __pv_queued_spin_lock_slowpath+0x0/0xdb0

This frame has 4 objects:
 [32, 33) 'old.i249'
 [48, 50) 'old.i.i'
 [64, 65) 'old.i'
 [80, 84) 'val.addr'

The buggy address belongs to the virtual mapping at
 [ffffc90004000000, ffffc90004009000) created by:
 copy_process+0x5d1/0x3d50 kernel/fork.c:2206

The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88802dfeeca8 pfn:0x2dfee
memcg:ffff888029a7c982
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000
raw: ffff88802dfeeca8 0000000000000000 00000001ffffffff ffff888029a7c982
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x2dc2(GFP_KERNEL|__GFP_HIGHMEM|__GFP_NOWARN|__GFP_ZERO), pid 35, tgid 35 (kworker/u8:2), ts 55686543585, free_ts 55582044020
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1517
 prep_new_page mm/page_alloc.c:1525 [inline]
 get_page_from_freelist+0x3004/0x30c0 mm/page_alloc.c:3476
 __alloc_pages_noprof+0x29e/0x780 mm/page_alloc.c:4743
 alloc_pages_mpol_noprof+0x3e8/0x680 mm/mempolicy.c:2265
 vm_area_alloc_pages mm/vmalloc.c:3600 [inline]
 __vmalloc_area_node mm/vmalloc.c:3669 [inline]
 __vmalloc_node_range_noprof+0xa40/0x1400 mm/vmalloc.c:3850
 alloc_thread_stack_node kernel/fork.c:314 [inline]
 dup_task_struct+0x444/0x8c0 kernel/fork.c:1115
 copy_process+0x5d1/0x3d50 kernel/fork.c:2206
 kernel_clone+0x226/0x8f0 kernel/fork.c:2787
 user_mode_thread+0x132/0x1a0 kernel/fork.c:2865
 call_usermodehelper_exec_sync kernel/umh.c:133 [inline]
 call_usermodehelper_exec_work+0x9b/0x230 kernel/umh.c:164
 process_one_work kernel/workqueue.c:3232 [inline]
 process_scheduled_works+0xa63/0x1850 kernel/workqueue.c:3313
 worker_thread+0x86d/0xd10 kernel/workqueue.c:3390
 kthread+0x2f0/0x390 kernel/kthread.c:389
 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
page last free pid 5231 tgid 5231 stack trace:
 reset_page_owner include/linux/page_owner.h:25 [inline]
 free_pages_prepare mm/page_alloc.c:1098 [inline]
 free_unref_page+0xc07/0xd90 mm/page_alloc.c:2651
 __slab_free+0x31b/0x3d0 mm/slub.c:4432
 qlink_free mm/kasan/quarantine.c:163 [inline]
 qlist_free_all+0x9e/0x140 mm/kasan/quarantine.c:179
 kasan_quarantine_reduce+0x14f/0x170 mm/kasan/quarantine.c:286
 __kasan_slab_alloc+0x23/0x80 mm/kasan/common.c:329
 kasan_slab_alloc include/linux/kasan.h:250 [inline]
 slab_post_alloc_hook mm/slub.c:4036 [inline]
 slab_alloc_node mm/slub.c:4085 [inline]
 kmem_cache_alloc_node_noprof+0x16b/0x320 mm/slub.c:4128
 __alloc_skb+0x1c3/0x440 net/core/skbuff.c:667
 netlink_sendmsg+0x638/0xcb0 net/netlink/af_netlink.c:1876
 sock_sendmsg_nosec net/socket.c:730 [inline]
 __sock_sendmsg+0x221/0x270 net/socket.c:745
 __sys_sendto+0x3a8/0x500 net/socket.c:2204
 __do_sys_sendto net/socket.c:2216 [inline]
 __se_sys_sendto net/socket.c:2212 [inline]
 __x64_sys_sendto+0xde/0x100 net/socket.c:2212
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Memory state around the buggy address:
 ffffc90004006080: 00 f2 f2 f2 00 f3 f3 f3 00 00 00 00 00 00 00 00
 ffffc90004006100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffffc90004006180: 00 00 00 00 f1 f1 f1 f1 01 f2 02 f2 01 f2 04 f3
                                           ^
 ffffc90004006200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffffc90004006280: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 00 00 00
kernel tried to execute NX-protected page - exploit attempt? (uid: 0)
BUG: unable to handle page fault for address: ffffffff8e0382cc
#PF: supervisor instruction fetch in kernel mode
#PF: error_code(0x0011) - permissions violation
PGD e73a067 P4D e73a067 PUD e73b063 PMD 800000000e0001a1 
Oops: Oops: 0011 [#1] PREEMPT SMP KASAN PTI
CPU: 1 UID: 0 PID: 5323 Comm: syz.3.4 Not tainted 6.11.0-rc4-next-20240820-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
RIP: 0010:kallsyms_seqs_of_names+0x22bcf4/0x483ce0
Code: 38 20 31 31 20 66 6c 61 67 73 2e 69 2e 69 2e 69 20 36 34 20 31 30 34 20 31 20 6e 20 32 30 38 20 32 34 20 34 20 77 61 69 74 00 <32> 20 33 32 20 38 20 31 31 20 66 6c 61 67 73 2e 69 2e 69 2e 69 20
RSP: 0018:ffffc90004006070 EFLAGS: 00010046
RAX: a9be2c2e87185f00 RBX: ffffffff8140766a RCX: 0000000000040000
RDX: ffffc90004ca1000 RSI: 00000000000326fe RDI: 00000000000326ff
RBP: 0000000041b58ab3 R08: ffffffff81744bbc R09: 1ffff1101722519a
R10: dffffc0000000000 R11: ffffed101722519b R12: dffffc0000000000
R13: ffffc900040060a0 R14: 0000000304006110 R15: ffffffff9312a1a0
FS:  00007fa8ac6346c0(0000) GS:ffff8880b9100000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffff8e0382cc CR3: 000000007a6b8000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 </TASK>
Modules linked in:
CR2: ffffffff8e0382cc
---[ end trace 0000000000000000 ]---
RIP: 0010:kallsyms_seqs_of_names+0x22bcf4/0x483ce0
Code: 38 20 31 31 20 66 6c 61 67 73 2e 69 2e 69 2e 69 20 36 34 20 31 30 34 20 31 20 6e 20 32 30 38 20 32 34 20 34 20 77 61 69 74 00 <32> 20 33 32 20 38 20 31 31 20 66 6c 61 67 73 2e 69 2e 69 2e 69 20
RSP: 0018:ffffc90004006070 EFLAGS: 00010046
RAX: a9be2c2e87185f00 RBX: ffffffff8140766a RCX: 0000000000040000
RDX: ffffc90004ca1000 RSI: 00000000000326fe RDI: 00000000000326ff
RBP: 0000000041b58ab3 R08: ffffffff81744bbc R09: 1ffff1101722519a
R10: dffffc0000000000 R11: ffffed101722519b R12: dffffc0000000000
R13: ffffc900040060a0 R14: 0000000304006110 R15: ffffffff9312a1a0
FS:  00007fa8ac6346c0(0000) GS:ffff8880b9100000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffff8e0382cc CR3: 000000007a6b8000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/08/21 00:44 linux-next bb1b0acdcd66 9f0ab3fb .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: spinlock recursion in copy_process
2024/08/28 07:38 linux-next 6f923748057a 6c853ff9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: unable to handle kernel NULL pointer dereference in cmp_ex_search
2024/08/23 01:55 linux-next 6a7917c89f21 295a4b50 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: stack-out-of-bounds Read in cmp_ex_search
* Struck through repros no longer work on HEAD.