INFO: rcu detected stall in do_vmi_munmap

From: cheung wall
Date: Thu Mar 14 2024 - 22:54:03 EST


Hello,


when using Healer to fuzz the latest Linux Kernel, the following crash

was triggered on:


HEAD commit: 0dd3ee31125508cd67f7e7172247f05b7fd1753a (tag: v6.7)

git tree: upstream

console output: https://pastebin.com/raw/aVdC6E9i

kernel config: https://pastebin.com/raw/Ta59KYzh

C reproducer: https://pastebin.com/raw/wnY4TDPU

Syzlang reproducer: https://pastebin.com/raw/AZVZSGGe


If you fix this issue, please add the following tag to the commit:

Reported-by: Qiang Zhang <zzqq0103.hey@xxxxxxxxx>

----------------------------------------------------------

rcu: INFO: rcu_preempt detected stalls on CPUs/tasks:
rcu: 3-....: (135 ticks this GP) idle=31a4/1/0x4000000000000000
softirq=28352/28352 fqs=4760
rcu: (detected by 4, t=21003 jiffies, g=41045, q=989 ncpus=7)
Sending NMI from CPU 4 to CPUs 3:
NMI backtrace for cpu 3
CPU: 3 PID: 33337 Comm: modprobe Not tainted 6.7.0 #1
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
1.13.0-1ubuntu1.1 04/01/2014
RIP: 0010:select_task_rq_fair+0x3d/0x3370 kernel/sched/fair.c:8080
Code: 48 81 ec e8 00 00 00 48 8d 84 24 88 00 00 00 89 54 24 20 48 ba
00 00 00 00 00 fc ff df 48 c1 e8 03 89 74 24 08 48 89 44 24 30 <48> 01
d0 48 c7 84 24 88 00 00 00 b3 8a b5 41 48 c7 84 24 90 00 00
RSP: 0018:ffff8881c01895a8 EFLAGS: 00000806
RAX: 1ffff110380312c6 RBX: 1ffff110380312e1 RCX: 0000000000000008
RDX: dffffc0000000000 RSI: 0000000000000000 RDI: ffff88812e78c740
RBP: ffffffff9d7e01b0 R08: ffffed10380312cd R09: ffffed10380312ce
R10: ffffed10380312cd R11: 0000000000000003 R12: ffff88812e78c774
R13: ffff88812e78c754 R14: ffff88812750fc30 R15: ffff88812e78c740
FS: 0000000000000000(0000) GS:ffff8881c0180000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fa9bb6fd8e0 CR3: 000000010350c003 CR4: 0000000000770ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
PKRU: 55555554
Call Trace:
<NMI>
</NMI>
<IRQ>
select_task_rq kernel/sched/core.c:3614 [inline]
try_to_wake_up+0x37e/0x1870 kernel/sched/core.c:4327
swake_up_locked.part.0+0x5f/0x170 kernel/sched/swait.c:29
swake_up_locked kernel/sched/swait.c:25 [inline]
complete_with_flags+0x75/0xa0 kernel/sched/completion.c:24
csd_do_func kernel/smp.c:133 [inline]
__flush_smp_call_function_queue+0x2d5/0xa10 kernel/smp.c:542
__sysvec_call_function_single+0x22/0x1d0 arch/x86/kernel/smp.c:267
sysvec_call_function_single+0x4b/0xa0 arch/x86/kernel/smp.c:262
asm_sysvec_call_function_single+0x1a/0x20 arch/x86/include/asm/idtentry.h:656
RIP: 0010:get_stack_info+0x0/0x100 arch/x86/kernel/dumpstack_64.c:193
Code: 00 b2 e4 9c e8 61 57 39 00 4c 89 e0 5b 41 5c c3 cc cc cc cc 66
0f 1f 44 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 <66> 0f
1f 00 41 57 41 56 41 55 49 89 d5 41 54 49 89 fc 55 48 89 cd
RSP: 0018:ffff8881c0189928 EFLAGS: 00000246
RAX: dffffc0000000000 RBX: ffff8881c0189aa0 RCX: ffff8881c0189ac0
RDX: ffff8881c0189aa0 RSI: ffff88812387df00 RDI: ffff888118e6e770
RBP: ffff888118e6e770 R08: 0000000000000001 R09: 0000000000000000
R10: ffff8881c0189aa0 R11: ffffffff9e217a17 R12: 0000000000000008
R13: ffff8881c0182000 R14: ffff888118e6e770 R15: 0000000000000002
stack_access_ok+0xa7/0x230 arch/x86/kernel/unwind_orc.c:396
deref_stack_reg+0x26/0x80 arch/x86/kernel/unwind_orc.c:403
unwind_next_frame+0xdd8/0x1e40 arch/x86/kernel/unwind_orc.c:585
arch_stack_walk+0xaf/0x140 arch/x86/kernel/stacktrace.c:25
stack_trace_save+0x90/0xd0 kernel/stacktrace.c:122
kasan_save_stack+0x22/0x50 mm/kasan/common.c:45
kasan_set_track+0x25/0x30 mm/kasan/common.c:52
kasan_save_free_info+0x2b/0x50 mm/kasan/generic.c:522
____kasan_slab_free mm/kasan/common.c:236 [inline]
____kasan_slab_free mm/kasan/common.c:200 [inline]
__kasan_slab_free+0x10e/0x190 mm/kasan/common.c:244
kasan_slab_free include/linux/kasan.h:164 [inline]
slab_free_hook mm/slub.c:1800 [inline]
slab_free_freelist_hook mm/slub.c:1826 [inline]
slab_free mm/slub.c:3809 [inline]
kmem_cache_free+0xa5/0x380 mm/slub.c:3831
rcu_do_batch kernel/rcu/tree.c:2158 [inline]
rcu_core+0x632/0x1960 kernel/rcu/tree.c:2431
__do_softirq+0x164/0x529 kernel/softirq.c:553
invoke_softirq kernel/softirq.c:427 [inline]
__irq_exit_rcu kernel/softirq.c:632 [inline]
irq_exit_rcu+0x7e/0xb0 kernel/softirq.c:644
sysvec_apic_timer_interrupt+0x75/0x80 arch/x86/kernel/apic/apic.c:1076
</IRQ>
<TASK>
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:649
RIP: 0010:get_current arch/x86/include/asm/current.h:41 [inline]
RIP: 0010:__sanitizer_cov_trace_pc+0x8/0x70 kernel/kcov.c:206
Code: 48 8b 80 50 0a 00 00 c3 cc cc cc cc 66 0f 1f 44 00 00 90 90 90
90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa 48 8b 0c 24 <65> 48
8b 04 25 40 6f 03 00 65 8b 15 80 b0 e5 65 f7 c2 00 01 ff 00
RSP: 0018:ffff888118e6e828 EFLAGS: 00000246
RAX: 0000000000000000 RBX: ffff888118e6e938 RCX: ffffffff99edebfa
RDX: 1ffff110231cdd27 RSI: ffff888118e6f770 RDI: ffff888118e6f770
RBP: 1ffff110231cdd10 R08: 0000000000000001 R09: 0000000000000000
R10: ffff888118e6e938 R11: ffffffff9e217a17 R12: ffffffff9e94273a
R13: ffff888118e6e988 R14: ffff888118e6f798 R15: 0000000000000001
unwind_next_frame+0x5ea/0x1e40 arch/x86/kernel/unwind_orc.c:665
arch_stack_walk+0xaf/0x140 arch/x86/kernel/stacktrace.c:25
stack_trace_save+0x90/0xd0 kernel/stacktrace.c:122
kasan_save_stack+0x22/0x50 mm/kasan/common.c:45
__kasan_record_aux_stack+0x8e/0xa0 mm/kasan/generic.c:492
__call_rcu_common.constprop.0+0x6b/0x8b0 kernel/rcu/tree.c:2681
mas_topiary_node lib/maple_tree.c:2556 [inline]
mas_topiary_replace+0x1e02/0x2ec0 lib/maple_tree.c:2662
mas_wmb_replace lib/maple_tree.c:2678 [inline]
mas_split+0x2e7e/0x4720 lib/maple_tree.c:3429
mas_commit_b_node+0x539/0x11f0 lib/maple_tree.c:3482
mas_wr_bnode+0x11d/0x2a0 lib/maple_tree.c:4198
mas_wr_modify+0x207/0x28e0 lib/maple_tree.c:4236
mas_wr_store_entry+0x40a/0x1480 lib/maple_tree.c:4269
mas_store_prealloc+0xab/0x210 lib/maple_tree.c:5460
vma_iter_store mm/internal.h:1198 [inline]
vma_complete mm/mmap.c:532 [inline]
__split_vma+0x118b/0x1790 mm/mmap.c:2414
do_vmi_align_munmap.constprop.0+0x377/0xcd0 mm/mmap.c:2582
do_vmi_munmap+0x18b/0x300 mm/mmap.c:2728
mmap_region+0x166/0x1e40 mm/mmap.c:2779
do_mmap+0x677/0xc10 mm/mmap.c:1379
vm_mmap_pgoff+0x1a0/0x2e0 mm/util.c:556
ksys_mmap_pgoff+0x342/0x490 mm/mmap.c:1425
__do_sys_mmap arch/x86/kernel/sys_x86_64.c:93 [inline]
__se_sys_mmap arch/x86/kernel/sys_x86_64.c:86 [inline]
__x64_sys_mmap+0x116/0x180 arch/x86/kernel/sys_x86_64.c:86
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0x43/0xf0 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x6f/0x77
RIP: 0033:0x7fa9bba01e82
Code: eb aa 66 0f 1f 44 00 00 41 f7 c1 ff 0f 00 00 75 27 55 48 89 fd
53 89 cb 48 85 ff 74 33 41 89 da 48 89 ef b8 09 00 00 00 0f 05 <48> 3d
00 f0 ff ff 77 56 5b 5d c3 0f 1f 00 c7 05 ae 02 01 00 16 00
RSP: 002b:00007ffd15fa42f8 EFLAGS: 00000206 ORIG_RAX: 0000000000000009
RAX: ffffffffffffffda RBX: 0000000000000812 RCX: 00007fa9bba01e82
RDX: 0000000000000005 RSI: 0000000000159000 RDI: 00007fa9bb512000
RBP: 00007fa9bb512000 R08: 0000000000000000 R09: 0000000000022000
R10: 0000000000000812 R11: 0000000000000206 R12: 00007fa9bb9e0a20
R13: 00007ffd15fa4310 R14: 00007ffd15fa4340 R15: 00007ffd15fa4730
</TASK>
modprobe (34972) used greatest stack depth: 23912 bytes left