Date
July 8, 2025, 7:07 p.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 20.436049] ================================================================== [ 20.436158] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x388/0x468 [ 20.436232] Read of size 1 at addr fff00000c6470000 by task kunit_try_catch/213 [ 20.436284] [ 20.436325] CPU: 1 UID: 0 PID: 213 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc5 #1 PREEMPT [ 20.436410] Tainted: [B]=BAD_PAGE, [N]=TEST [ 20.436437] Hardware name: linux,dummy-virt (DT) [ 20.436472] Call trace: [ 20.436495] show_stack+0x20/0x38 (C) [ 20.436547] dump_stack_lvl+0x8c/0xd0 [ 20.436599] print_report+0x118/0x608 [ 20.436645] kasan_report+0xdc/0x128 [ 20.436690] __asan_report_load1_noabort+0x20/0x30 [ 20.436752] kmem_cache_rcu_uaf+0x388/0x468 [ 20.436811] kunit_try_run_case+0x170/0x3f0 [ 20.436860] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 20.436912] kthread+0x328/0x630 [ 20.436955] ret_from_fork+0x10/0x20 [ 20.437004] [ 20.437022] Allocated by task 213: [ 20.437049] kasan_save_stack+0x3c/0x68 [ 20.437090] kasan_save_track+0x20/0x40 [ 20.437126] kasan_save_alloc_info+0x40/0x58 [ 20.437164] __kasan_slab_alloc+0xa8/0xb0 [ 20.437200] kmem_cache_alloc_noprof+0x10c/0x398 [ 20.437377] kmem_cache_rcu_uaf+0x12c/0x468 [ 20.440583] kunit_try_run_case+0x170/0x3f0 [ 20.440638] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 20.440681] kthread+0x328/0x630 [ 20.440728] ret_from_fork+0x10/0x20 [ 20.440763] [ 20.440781] Freed by task 0: [ 20.440809] kasan_save_stack+0x3c/0x68 [ 20.440845] kasan_save_track+0x20/0x40 [ 20.440882] kasan_save_free_info+0x4c/0x78 [ 20.440922] __kasan_slab_free+0x6c/0x98 [ 20.440957] slab_free_after_rcu_debug+0xd4/0x2f8 [ 20.440996] rcu_core+0x9f4/0x1e20 [ 20.441031] rcu_core_si+0x18/0x30 [ 20.441065] handle_softirqs+0x374/0xb28 [ 20.441101] __do_softirq+0x1c/0x28 [ 20.441135] [ 20.441152] Last potentially related work creation: [ 20.441179] kasan_save_stack+0x3c/0x68 [ 20.441217] kasan_record_aux_stack+0xb4/0xc8 [ 20.441255] kmem_cache_free+0x120/0x468 [ 20.441291] kmem_cache_rcu_uaf+0x16c/0x468 [ 20.441326] kunit_try_run_case+0x170/0x3f0 [ 20.441363] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 20.441406] kthread+0x328/0x630 [ 20.441436] ret_from_fork+0x10/0x20 [ 20.441471] [ 20.441489] The buggy address belongs to the object at fff00000c6470000 [ 20.441489] which belongs to the cache test_cache of size 200 [ 20.441547] The buggy address is located 0 bytes inside of [ 20.441547] freed 200-byte region [fff00000c6470000, fff00000c64700c8) [ 20.441607] [ 20.441628] The buggy address belongs to the physical page: [ 20.441661] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106470 [ 20.441729] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 20.441796] page_type: f5(slab) [ 20.441838] raw: 0bfffe0000000000 fff00000c563c640 dead000000000122 0000000000000000 [ 20.441890] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000 [ 20.441929] page dumped because: kasan: bad access detected [ 20.441961] [ 20.441987] Memory state around the buggy address: [ 20.442030] fff00000c646ff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [ 20.442074] fff00000c646ff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [ 20.442125] >fff00000c6470000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 20.442171] ^ [ 20.442206] fff00000c6470080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc [ 20.442264] fff00000c6470100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 20.442311] ==================================================================
[ 13.770289] ================================================================== [ 13.770781] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x3e3/0x510 [ 13.771507] Read of size 1 at addr ffff88810261a000 by task kunit_try_catch/230 [ 13.771855] [ 13.771967] CPU: 1 UID: 0 PID: 230 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc5 #1 PREEMPT(voluntary) [ 13.772015] Tainted: [B]=BAD_PAGE, [N]=TEST [ 13.772027] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 13.772060] Call Trace: [ 13.772072] <TASK> [ 13.772093] dump_stack_lvl+0x73/0xb0 [ 13.772126] print_report+0xd1/0x650 [ 13.772148] ? __virt_addr_valid+0x1db/0x2d0 [ 13.772172] ? kmem_cache_rcu_uaf+0x3e3/0x510 [ 13.772193] ? kasan_complete_mode_report_info+0x64/0x200 [ 13.772218] ? kmem_cache_rcu_uaf+0x3e3/0x510 [ 13.772239] kasan_report+0x141/0x180 [ 13.772260] ? kmem_cache_rcu_uaf+0x3e3/0x510 [ 13.772287] __asan_report_load1_noabort+0x18/0x20 [ 13.772310] kmem_cache_rcu_uaf+0x3e3/0x510 [ 13.772333] ? __pfx_kmem_cache_rcu_uaf+0x10/0x10 [ 13.772353] ? finish_task_switch.isra.0+0x153/0x700 [ 13.772376] ? __switch_to+0x47/0xf50 [ 13.772405] ? __pfx_read_tsc+0x10/0x10 [ 13.772425] ? ktime_get_ts64+0x86/0x230 [ 13.772449] kunit_try_run_case+0x1a5/0x480 [ 13.772473] ? __pfx_kunit_try_run_case+0x10/0x10 [ 13.772494] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 13.772518] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 13.772540] ? __kthread_parkme+0x82/0x180 [ 13.772562] ? preempt_count_sub+0x50/0x80 [ 13.772583] ? __pfx_kunit_try_run_case+0x10/0x10 [ 13.772605] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 13.772626] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 13.772648] kthread+0x337/0x6f0 [ 13.772666] ? trace_preempt_on+0x20/0xc0 [ 13.772689] ? __pfx_kthread+0x10/0x10 [ 13.772708] ? _raw_spin_unlock_irq+0x47/0x80 [ 13.772728] ? calculate_sigpending+0x7b/0xa0 [ 13.772751] ? __pfx_kthread+0x10/0x10 [ 13.772771] ret_from_fork+0x116/0x1d0 [ 13.772788] ? __pfx_kthread+0x10/0x10 [ 13.772808] ret_from_fork_asm+0x1a/0x30 [ 13.772839] </TASK> [ 13.772851] [ 13.783530] Allocated by task 230: [ 13.783683] kasan_save_stack+0x45/0x70 [ 13.784144] kasan_save_track+0x18/0x40 [ 13.784284] kasan_save_alloc_info+0x3b/0x50 [ 13.784431] __kasan_slab_alloc+0x91/0xa0 [ 13.785501] kmem_cache_alloc_noprof+0x123/0x3f0 [ 13.785693] kmem_cache_rcu_uaf+0x155/0x510 [ 13.785851] kunit_try_run_case+0x1a5/0x480 [ 13.786072] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 13.786284] kthread+0x337/0x6f0 [ 13.786455] ret_from_fork+0x116/0x1d0 [ 13.787388] ret_from_fork_asm+0x1a/0x30 [ 13.787545] [ 13.787619] Freed by task 0: [ 13.787730] kasan_save_stack+0x45/0x70 [ 13.788615] kasan_save_track+0x18/0x40 [ 13.788873] kasan_save_free_info+0x3f/0x60 [ 13.789062] __kasan_slab_free+0x56/0x70 [ 13.789373] slab_free_after_rcu_debug+0xe4/0x310 [ 13.789630] rcu_core+0x66f/0x1c40 [ 13.789805] rcu_core_si+0x12/0x20 [ 13.790052] handle_softirqs+0x209/0x730 [ 13.790465] __irq_exit_rcu+0xc9/0x110 [ 13.791131] irq_exit_rcu+0x12/0x20 [ 13.791336] sysvec_apic_timer_interrupt+0x81/0x90 [ 13.791770] asm_sysvec_apic_timer_interrupt+0x1f/0x30 [ 13.792009] [ 13.792138] Last potentially related work creation: [ 13.792476] kasan_save_stack+0x45/0x70 [ 13.792960] kasan_record_aux_stack+0xb2/0xc0 [ 13.793366] kmem_cache_free+0x131/0x420 [ 13.793580] kmem_cache_rcu_uaf+0x194/0x510 [ 13.793889] kunit_try_run_case+0x1a5/0x480 [ 13.794242] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 13.794478] kthread+0x337/0x6f0 [ 13.794725] ret_from_fork+0x116/0x1d0 [ 13.794877] ret_from_fork_asm+0x1a/0x30 [ 13.795221] [ 13.795378] The buggy address belongs to the object at ffff88810261a000 [ 13.795378] which belongs to the cache test_cache of size 200 [ 13.795982] The buggy address is located 0 bytes inside of [ 13.795982] freed 200-byte region [ffff88810261a000, ffff88810261a0c8) [ 13.796874] [ 13.796985] The buggy address belongs to the physical page: [ 13.797435] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10261a [ 13.797809] flags: 0x200000000000000(node=0|zone=2) [ 13.798083] page_type: f5(slab) [ 13.798386] raw: 0200000000000000 ffff888101f213c0 dead000000000122 0000000000000000 [ 13.798759] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000 [ 13.799083] page dumped because: kasan: bad access detected [ 13.799332] [ 13.799420] Memory state around the buggy address: [ 13.799936] ffff888102619f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 13.800415] ffff888102619f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 13.800754] >ffff88810261a000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 13.801196] ^ [ 13.801356] ffff88810261a080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc [ 13.801847] ffff88810261a100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 13.802228] ==================================================================