Date
June 18, 2025, 6:43 a.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 21.970942] ================================================================== [ 21.971127] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x388/0x468 [ 21.971234] Read of size 1 at addr fff00000c7700000 by task kunit_try_catch/223 [ 21.971291] [ 21.971342] CPU: 1 UID: 0 PID: 223 Comm: kunit_try_catch Tainted: G B W N 6.16.0-rc2-next-20250618 #1 PREEMPT [ 21.971439] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST [ 21.971471] Hardware name: linux,dummy-virt (DT) [ 21.971510] Call trace: [ 21.971538] show_stack+0x20/0x38 (C) [ 21.971601] dump_stack_lvl+0x8c/0xd0 [ 21.971660] print_report+0x118/0x608 [ 21.971713] kasan_report+0xdc/0x128 [ 21.971763] __asan_report_load1_noabort+0x20/0x30 [ 21.971817] kmem_cache_rcu_uaf+0x388/0x468 [ 21.971867] kunit_try_run_case+0x170/0x3f0 [ 21.971923] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 21.971982] kthread+0x328/0x630 [ 21.972046] ret_from_fork+0x10/0x20 [ 21.972108] [ 21.972130] Allocated by task 223: [ 21.972165] kasan_save_stack+0x3c/0x68 [ 21.972215] kasan_save_track+0x20/0x40 [ 21.972256] kasan_save_alloc_info+0x40/0x58 [ 21.972300] __kasan_slab_alloc+0xa8/0xb0 [ 21.972341] kmem_cache_alloc_noprof+0x10c/0x398 [ 21.972387] kmem_cache_rcu_uaf+0x12c/0x468 [ 21.972430] kunit_try_run_case+0x170/0x3f0 [ 21.972470] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 21.972517] kthread+0x328/0x630 [ 21.972574] ret_from_fork+0x10/0x20 [ 21.972615] [ 21.972640] Freed by task 0: [ 21.972672] kasan_save_stack+0x3c/0x68 [ 21.972715] kasan_save_track+0x20/0x40 [ 21.972756] kasan_save_free_info+0x4c/0x78 [ 21.972799] __kasan_slab_free+0x6c/0x98 [ 21.972839] slab_free_after_rcu_debug+0xd4/0x2f8 [ 21.972883] rcu_core+0x9f4/0x1e20 [ 21.972925] rcu_core_si+0x18/0x30 [ 21.972962] handle_softirqs+0x374/0xb28 [ 21.973006] __do_softirq+0x1c/0x28 [ 21.973060] [ 21.973083] Last potentially related work creation: [ 21.973113] kasan_save_stack+0x3c/0x68 [ 21.973156] kasan_record_aux_stack+0xb4/0xc8 [ 21.973202] kmem_cache_free+0x120/0x468 [ 21.973242] kmem_cache_rcu_uaf+0x16c/0x468 [ 21.973284] kunit_try_run_case+0x170/0x3f0 [ 21.973325] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 21.973372] kthread+0x328/0x630 [ 21.973406] ret_from_fork+0x10/0x20 [ 21.973446] [ 21.973466] The buggy address belongs to the object at fff00000c7700000 [ 21.973466] which belongs to the cache test_cache of size 200 [ 21.973531] The buggy address is located 0 bytes inside of [ 21.973531] freed 200-byte region [fff00000c7700000, fff00000c77000c8) [ 21.973597] [ 21.973621] The buggy address belongs to the physical page: [ 21.973660] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107700 [ 21.973720] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 21.973776] page_type: f5(slab) [ 21.973822] raw: 0bfffe0000000000 fff00000c0cc5c80 dead000000000122 0000000000000000 [ 21.973875] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000 [ 21.973915] page dumped because: kasan: bad access detected [ 21.973947] [ 21.973964] Memory state around the buggy address: [ 21.973999] fff00000c76fff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 21.974055] fff00000c76fff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 21.974100] >fff00000c7700000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 21.974173] ^ [ 21.974206] fff00000c7700080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc [ 21.974249] fff00000c7700100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 21.974287] ==================================================================
[ 11.914733] ================================================================== [ 11.915157] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x3e3/0x510 [ 11.915414] Read of size 1 at addr ffff888102626000 by task kunit_try_catch/239 [ 11.915971] [ 11.916065] CPU: 0 UID: 0 PID: 239 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc2-next-20250618 #1 PREEMPT(voluntary) [ 11.916116] Tainted: [B]=BAD_PAGE, [N]=TEST [ 11.916128] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 11.916150] Call Trace: [ 11.916164] <TASK> [ 11.916184] dump_stack_lvl+0x73/0xb0 [ 11.916249] print_report+0xd1/0x650 [ 11.916285] ? __virt_addr_valid+0x1db/0x2d0 [ 11.916326] ? kmem_cache_rcu_uaf+0x3e3/0x510 [ 11.916348] ? kasan_complete_mode_report_info+0x64/0x200 [ 11.916373] ? kmem_cache_rcu_uaf+0x3e3/0x510 [ 11.916395] kasan_report+0x141/0x180 [ 11.916415] ? kmem_cache_rcu_uaf+0x3e3/0x510 [ 11.916442] __asan_report_load1_noabort+0x18/0x20 [ 11.916465] kmem_cache_rcu_uaf+0x3e3/0x510 [ 11.916486] ? __pfx_kmem_cache_rcu_uaf+0x10/0x10 [ 11.916508] ? finish_task_switch.isra.0+0x153/0x700 [ 11.916531] ? __switch_to+0x47/0xf50 [ 11.916559] ? __pfx_read_tsc+0x10/0x10 [ 11.916581] ? ktime_get_ts64+0x86/0x230 [ 11.916606] kunit_try_run_case+0x1a5/0x480 [ 11.916631] ? __pfx_kunit_try_run_case+0x10/0x10 [ 11.916661] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 11.916684] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 11.916707] ? __kthread_parkme+0x82/0x180 [ 11.916726] ? preempt_count_sub+0x50/0x80 [ 11.916748] ? __pfx_kunit_try_run_case+0x10/0x10 [ 11.916771] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.916809] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 11.916831] kthread+0x337/0x6f0 [ 11.916849] ? trace_preempt_on+0x20/0xc0 [ 11.916874] ? __pfx_kthread+0x10/0x10 [ 11.916894] ? _raw_spin_unlock_irq+0x47/0x80 [ 11.916913] ? calculate_sigpending+0x7b/0xa0 [ 11.916937] ? __pfx_kthread+0x10/0x10 [ 11.916957] ret_from_fork+0x116/0x1d0 [ 11.916976] ? __pfx_kthread+0x10/0x10 [ 11.916995] ret_from_fork_asm+0x1a/0x30 [ 11.917026] </TASK> [ 11.917037] [ 11.927763] Allocated by task 239: [ 11.927960] kasan_save_stack+0x45/0x70 [ 11.928129] kasan_save_track+0x18/0x40 [ 11.928578] kasan_save_alloc_info+0x3b/0x50 [ 11.928877] __kasan_slab_alloc+0x91/0xa0 [ 11.929166] kmem_cache_alloc_noprof+0x123/0x3f0 [ 11.929561] kmem_cache_rcu_uaf+0x155/0x510 [ 11.929741] kunit_try_run_case+0x1a5/0x480 [ 11.929920] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.930135] kthread+0x337/0x6f0 [ 11.930650] ret_from_fork+0x116/0x1d0 [ 11.930897] ret_from_fork_asm+0x1a/0x30 [ 11.931185] [ 11.931401] Freed by task 0: [ 11.931660] kasan_save_stack+0x45/0x70 [ 11.931938] kasan_save_track+0x18/0x40 [ 11.932319] kasan_save_free_info+0x3f/0x60 [ 11.932661] __kasan_slab_free+0x56/0x70 [ 11.933048] slab_free_after_rcu_debug+0xe4/0x310 [ 11.933381] rcu_core+0x66f/0x1c40 [ 11.933551] rcu_core_si+0x12/0x20 [ 11.933859] handle_softirqs+0x209/0x730 [ 11.934173] __irq_exit_rcu+0xc9/0x110 [ 11.934349] irq_exit_rcu+0x12/0x20 [ 11.934665] sysvec_apic_timer_interrupt+0x81/0x90 [ 11.935023] asm_sysvec_apic_timer_interrupt+0x1f/0x30 [ 11.935366] [ 11.935607] Last potentially related work creation: [ 11.935798] kasan_save_stack+0x45/0x70 [ 11.935973] kasan_record_aux_stack+0xb2/0xc0 [ 11.936155] kmem_cache_free+0x131/0x420 [ 11.936337] kmem_cache_rcu_uaf+0x194/0x510 [ 11.936736] kunit_try_run_case+0x1a5/0x480 [ 11.937044] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.937635] kthread+0x337/0x6f0 [ 11.937825] ret_from_fork+0x116/0x1d0 [ 11.938235] ret_from_fork_asm+0x1a/0x30 [ 11.938663] [ 11.938870] The buggy address belongs to the object at ffff888102626000 [ 11.938870] which belongs to the cache test_cache of size 200 [ 11.939577] The buggy address is located 0 bytes inside of [ 11.939577] freed 200-byte region [ffff888102626000, ffff8881026260c8) [ 11.940831] [ 11.940901] The buggy address belongs to the physical page: [ 11.941071] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102626 [ 11.941925] flags: 0x200000000000000(node=0|zone=2) [ 11.942431] page_type: f5(slab) [ 11.942821] raw: 0200000000000000 ffff88810167fdc0 dead000000000122 0000000000000000 [ 11.943586] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000 [ 11.944338] page dumped because: kasan: bad access detected [ 11.944716] [ 11.944782] Memory state around the buggy address: [ 11.945216] ffff888102625f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 11.945949] ffff888102625f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 11.946475] >ffff888102626000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 11.946977] ^ [ 11.947356] ffff888102626080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc [ 11.948050] ffff888102626100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 11.948696] ==================================================================