Date
June 3, 2025, 7:38 a.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 18.624213] ================================================================== [ 18.624352] BUG: KASAN: slab-use-after-free in rcu_uaf_reclaim+0x64/0x70 [ 18.624439] Read of size 4 at addr fff00000c5933640 by task swapper/1/0 [ 18.624486] [ 18.624526] CPU: 1 UID: 0 PID: 0 Comm: swapper/1 Tainted: G B N 6.15.0-next-20250603 #1 PREEMPT [ 18.624614] Tainted: [B]=BAD_PAGE, [N]=TEST [ 18.624642] Hardware name: linux,dummy-virt (DT) [ 18.624676] Call trace: [ 18.624699] show_stack+0x20/0x38 (C) [ 18.624751] dump_stack_lvl+0x8c/0xd0 [ 18.624801] print_report+0x118/0x608 [ 18.624853] kasan_report+0xdc/0x128 [ 18.624897] __asan_report_load4_noabort+0x20/0x30 [ 18.624944] rcu_uaf_reclaim+0x64/0x70 [ 18.624988] rcu_core+0x9f4/0x1e20 [ 18.625034] rcu_core_si+0x18/0x30 [ 18.625077] handle_softirqs+0x374/0xb28 [ 18.627542] __do_softirq+0x1c/0x28 [ 18.627615] ____do_softirq+0x18/0x30 [ 18.627661] call_on_irq_stack+0x24/0x30 [ 18.627760] do_softirq_own_stack+0x24/0x38 [ 18.627809] __irq_exit_rcu+0x1fc/0x318 [ 18.627853] irq_exit_rcu+0x1c/0x80 [ 18.627897] el1_interrupt+0x38/0x58 [ 18.627940] el1h_64_irq_handler+0x18/0x28 [ 18.627986] el1h_64_irq+0x6c/0x70 [ 18.628090] arch_local_irq_enable+0x4/0x8 (P) [ 18.628172] do_idle+0x384/0x4e8 [ 18.628366] cpu_startup_entry+0x64/0x80 [ 18.628558] secondary_start_kernel+0x288/0x340 [ 18.628834] __secondary_switched+0xc0/0xc8 [ 18.628924] [ 18.628945] Allocated by task 198: [ 18.629102] kasan_save_stack+0x3c/0x68 [ 18.629543] kasan_save_track+0x20/0x40 [ 18.629839] kasan_save_alloc_info+0x40/0x58 [ 18.629956] __kasan_kmalloc+0xd4/0xd8 [ 18.629997] __kmalloc_cache_noprof+0x16c/0x3c0 [ 18.630220] rcu_uaf+0xb0/0x2d8 [ 18.630259] kunit_try_run_case+0x170/0x3f0 [ 18.630866] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 18.631256] kthread+0x328/0x630 [ 18.631299] ret_from_fork+0x10/0x20 [ 18.631336] [ 18.631850] Freed by task 0: [ 18.631993] kasan_save_stack+0x3c/0x68 [ 18.632144] kasan_save_track+0x20/0x40 [ 18.632280] kasan_save_free_info+0x4c/0x78 [ 18.632317] __kasan_slab_free+0x6c/0x98 [ 18.632354] kfree+0x214/0x3c8 [ 18.632865] rcu_uaf_reclaim+0x28/0x70 [ 18.632913] rcu_core+0x9f4/0x1e20 [ 18.632950] rcu_core_si+0x18/0x30 [ 18.632984] handle_softirqs+0x374/0xb28 [ 18.633021] __do_softirq+0x1c/0x28 [ 18.633056] [ 18.633105] Last potentially related work creation: [ 18.633197] kasan_save_stack+0x3c/0x68 [ 18.633239] kasan_record_aux_stack+0xb4/0xc8 [ 18.633277] __call_rcu_common.constprop.0+0x70/0x8b0 [ 18.633358] call_rcu+0x18/0x30 [ 18.633519] rcu_uaf+0x14c/0x2d8 [ 18.633643] kunit_try_run_case+0x170/0x3f0 [ 18.633712] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 18.633757] kthread+0x328/0x630 [ 18.633844] ret_from_fork+0x10/0x20 [ 18.633999] [ 18.634061] The buggy address belongs to the object at fff00000c5933640 [ 18.634061] which belongs to the cache kmalloc-32 of size 32 [ 18.634233] The buggy address is located 0 bytes inside of [ 18.634233] freed 32-byte region [fff00000c5933640, fff00000c5933660) [ 18.634401] [ 18.634432] The buggy address belongs to the physical page: [ 18.634947] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105933 [ 18.635069] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 18.635318] page_type: f5(slab) [ 18.635449] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000 [ 18.635502] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000 [ 18.635769] page dumped because: kasan: bad access detected [ 18.636048] [ 18.636067] Memory state around the buggy address: [ 18.636558] fff00000c5933500: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc [ 18.636629] fff00000c5933580: 00 00 05 fc fc fc fc fc 00 00 07 fc fc fc fc fc [ 18.637088] >fff00000c5933600: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc [ 18.637243] ^ [ 18.637750] fff00000c5933680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 18.638210] fff00000c5933700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 18.638256] ==================================================================
[ 15.300002] ================================================================== [ 15.300784] BUG: KASAN: slab-use-after-free in rcu_uaf_reclaim+0x50/0x60 [ 15.301173] Read of size 4 at addr ffff8881033354c0 by task swapper/1/0 [ 15.301869] [ 15.302051] CPU: 1 UID: 0 PID: 0 Comm: swapper/1 Tainted: G B N 6.15.0-next-20250603 #1 PREEMPT(voluntary) [ 15.302112] Tainted: [B]=BAD_PAGE, [N]=TEST [ 15.302127] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 15.302151] Call Trace: [ 15.302193] <IRQ> [ 15.302369] dump_stack_lvl+0x73/0xb0 [ 15.302414] print_report+0xd1/0x650 [ 15.302442] ? __virt_addr_valid+0x1db/0x2d0 [ 15.302488] ? rcu_uaf_reclaim+0x50/0x60 [ 15.302511] ? kasan_complete_mode_report_info+0x64/0x200 [ 15.302534] ? rcu_uaf_reclaim+0x50/0x60 [ 15.302556] kasan_report+0x141/0x180 [ 15.302581] ? rcu_uaf_reclaim+0x50/0x60 [ 15.302608] __asan_report_load4_noabort+0x18/0x20 [ 15.302631] rcu_uaf_reclaim+0x50/0x60 [ 15.302653] rcu_core+0x66f/0x1c40 [ 15.302684] ? __pfx_rcu_core+0x10/0x10 [ 15.302707] ? ktime_get+0x6b/0x150 [ 15.302735] rcu_core_si+0x12/0x20 [ 15.302757] handle_softirqs+0x209/0x730 [ 15.302780] ? hrtimer_interrupt+0x2fe/0x780 [ 15.302804] ? __pfx_handle_softirqs+0x10/0x10 [ 15.302831] __irq_exit_rcu+0xc9/0x110 [ 15.302852] irq_exit_rcu+0x12/0x20 [ 15.302872] sysvec_apic_timer_interrupt+0x81/0x90 [ 15.302901] </IRQ> [ 15.302938] <TASK> [ 15.302951] asm_sysvec_apic_timer_interrupt+0x1f/0x30 [ 15.303064] RIP: 0010:pv_native_safe_halt+0xf/0x20 [ 15.303375] Code: 1f 84 00 00 00 00 00 0f 1f 40 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa eb 07 0f 00 2d 23 a8 1d 00 fb f4 <c3> cc cc cc cc 66 2e 0f 1f 84 00 00 00 00 00 66 90 90 90 90 90 90 [ 15.303513] RSP: 0000:ffff88810087fdc8 EFLAGS: 00010212 [ 15.303636] RAX: ffff8881cbd5b000 RBX: ffff88810085b000 RCX: ffffffff8ceb1245 [ 15.303695] RDX: ffffed102b62618b RSI: 0000000000000004 RDI: 0000000000016aec [ 15.303747] RBP: ffff88810087fdd0 R08: 0000000000000001 R09: ffffed102b62618a [ 15.303797] R10: ffff88815b130c53 R11: 0000000000039800 R12: 0000000000000001 [ 15.303849] R13: ffffed102010b600 R14: ffffffff8ebc3190 R15: 0000000000000000 [ 15.303921] ? ct_kernel_exit.constprop.0+0xa5/0xd0 [ 15.303990] ? default_idle+0xd/0x20 [ 15.304017] arch_cpu_idle+0xd/0x20 [ 15.304040] default_idle_call+0x48/0x80 [ 15.304063] do_idle+0x379/0x4f0 [ 15.304092] ? __pfx_do_idle+0x10/0x10 [ 15.304123] ? _raw_spin_unlock_irqrestore+0x49/0x90 [ 15.304153] ? complete+0x15b/0x1d0 [ 15.304186] cpu_startup_entry+0x5c/0x70 [ 15.304216] start_secondary+0x211/0x290 [ 15.304241] ? __pfx_start_secondary+0x10/0x10 [ 15.304270] common_startup_64+0x13e/0x148 [ 15.304308] </TASK> [ 15.304322] [ 15.315158] Allocated by task 215: [ 15.315547] kasan_save_stack+0x45/0x70 [ 15.315927] kasan_save_track+0x18/0x40 [ 15.316187] kasan_save_alloc_info+0x3b/0x50 [ 15.316391] __kasan_kmalloc+0xb7/0xc0 [ 15.316659] __kmalloc_cache_noprof+0x189/0x420 [ 15.316925] rcu_uaf+0xb0/0x330 [ 15.317054] kunit_try_run_case+0x1a5/0x480 [ 15.317342] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 15.317627] kthread+0x337/0x6f0 [ 15.317813] ret_from_fork+0x116/0x1d0 [ 15.318022] ret_from_fork_asm+0x1a/0x30 [ 15.318285] [ 15.318361] Freed by task 0: [ 15.318551] kasan_save_stack+0x45/0x70 [ 15.318755] kasan_save_track+0x18/0x40 [ 15.318900] kasan_save_free_info+0x3f/0x60 [ 15.319012] __kasan_slab_free+0x56/0x70 [ 15.319131] kfree+0x222/0x3f0 [ 15.319312] rcu_uaf_reclaim+0x1f/0x60 [ 15.319432] rcu_core+0x66f/0x1c40 [ 15.319659] rcu_core_si+0x12/0x20 [ 15.319832] handle_softirqs+0x209/0x730 [ 15.320781] __irq_exit_rcu+0xc9/0x110 [ 15.321350] irq_exit_rcu+0x12/0x20 [ 15.321489] sysvec_apic_timer_interrupt+0x81/0x90 [ 15.321779] asm_sysvec_apic_timer_interrupt+0x1f/0x30 [ 15.322002] [ 15.322152] Last potentially related work creation: [ 15.322502] kasan_save_stack+0x45/0x70 [ 15.322758] kasan_record_aux_stack+0xb2/0xc0 [ 15.322917] __call_rcu_common.constprop.0+0x72/0x9d0 [ 15.323189] call_rcu+0x12/0x20 [ 15.323390] rcu_uaf+0x168/0x330 [ 15.323507] kunit_try_run_case+0x1a5/0x480 [ 15.323836] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 15.324089] kthread+0x337/0x6f0 [ 15.324317] ret_from_fork+0x116/0x1d0 [ 15.324466] ret_from_fork_asm+0x1a/0x30 [ 15.324728] [ 15.324808] The buggy address belongs to the object at ffff8881033354c0 [ 15.324808] which belongs to the cache kmalloc-32 of size 32 [ 15.325302] The buggy address is located 0 bytes inside of [ 15.325302] freed 32-byte region [ffff8881033354c0, ffff8881033354e0) [ 15.325761] [ 15.325920] The buggy address belongs to the physical page: [ 15.326061] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103335 [ 15.326488] flags: 0x200000000000000(node=0|zone=2) [ 15.326680] page_type: f5(slab) [ 15.326921] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000 [ 15.327282] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000 [ 15.327508] page dumped because: kasan: bad access detected [ 15.327861] [ 15.327956] Memory state around the buggy address: [ 15.328187] ffff888103335380: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc [ 15.328550] ffff888103335400: 00 00 05 fc fc fc fc fc 00 00 07 fc fc fc fc fc [ 15.328845] >ffff888103335480: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc [ 15.329143] ^ [ 15.329378] ffff888103335500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 15.329710] ffff888103335580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 15.329960] ==================================================================