Date
June 19, 2025, 12:07 p.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 32.070604] ================================================================== [ 32.070810] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x388/0x468 [ 32.071011] Read of size 1 at addr fff00000c7751000 by task kunit_try_catch/224 [ 32.071137] [ 32.071235] CPU: 1 UID: 0 PID: 224 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc2-next-20250619 #1 PREEMPT [ 32.071456] Tainted: [B]=BAD_PAGE, [N]=TEST [ 32.071525] Hardware name: linux,dummy-virt (DT) [ 32.071611] Call trace: [ 32.071670] show_stack+0x20/0x38 (C) [ 32.072077] dump_stack_lvl+0x8c/0xd0 [ 32.072845] print_report+0x118/0x608 [ 32.073082] kasan_report+0xdc/0x128 [ 32.073245] __asan_report_load1_noabort+0x20/0x30 [ 32.073458] kmem_cache_rcu_uaf+0x388/0x468 [ 32.073571] kunit_try_run_case+0x170/0x3f0 [ 32.074125] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 32.074294] kthread+0x328/0x630 [ 32.074446] ret_from_fork+0x10/0x20 [ 32.074601] [ 32.074651] Allocated by task 224: [ 32.074732] kasan_save_stack+0x3c/0x68 [ 32.074838] kasan_save_track+0x20/0x40 [ 32.074954] kasan_save_alloc_info+0x40/0x58 [ 32.075088] __kasan_slab_alloc+0xa8/0xb0 [ 32.075192] kmem_cache_alloc_noprof+0x10c/0x398 [ 32.075300] kmem_cache_rcu_uaf+0x12c/0x468 [ 32.075392] kunit_try_run_case+0x170/0x3f0 [ 32.075488] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 32.075602] kthread+0x328/0x630 [ 32.075686] ret_from_fork+0x10/0x20 [ 32.075781] [ 32.076220] Freed by task 0: [ 32.076426] kasan_save_stack+0x3c/0x68 [ 32.076566] kasan_save_track+0x20/0x40 [ 32.076668] kasan_save_free_info+0x4c/0x78 [ 32.077036] __kasan_slab_free+0x6c/0x98 [ 32.077291] slab_free_after_rcu_debug+0xd4/0x2f8 [ 32.077400] rcu_core+0x9f4/0x1e20 [ 32.077725] rcu_core_si+0x18/0x30 [ 32.077824] handle_softirqs+0x374/0xb28 [ 32.077935] __do_softirq+0x1c/0x28 [ 32.078062] [ 32.078133] Last potentially related work creation: [ 32.078222] kasan_save_stack+0x3c/0x68 [ 32.078336] kasan_record_aux_stack+0xb4/0xc8 [ 32.078421] kmem_cache_free+0x120/0x468 [ 32.078491] kmem_cache_rcu_uaf+0x16c/0x468 [ 32.078586] kunit_try_run_case+0x170/0x3f0 [ 32.078668] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 32.078763] kthread+0x328/0x630 [ 32.079050] ret_from_fork+0x10/0x20 [ 32.079202] [ 32.079311] The buggy address belongs to the object at fff00000c7751000 [ 32.079311] which belongs to the cache test_cache of size 200 [ 32.079462] The buggy address is located 0 bytes inside of [ 32.079462] freed 200-byte region [fff00000c7751000, fff00000c77510c8) [ 32.079680] [ 32.079760] The buggy address belongs to the physical page: [ 32.079889] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107751 [ 32.080069] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 32.080230] page_type: f5(slab) [ 32.080332] raw: 0bfffe0000000000 fff00000c1112dc0 dead000000000122 0000000000000000 [ 32.080464] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000 [ 32.080577] page dumped because: kasan: bad access detected [ 32.080661] [ 32.080708] Memory state around the buggy address: [ 32.080793] fff00000c7750f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 32.080915] fff00000c7750f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 32.081016] >fff00000c7751000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 32.081110] ^ [ 32.081186] fff00000c7751080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc [ 32.081754] fff00000c7751100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 32.081870] ==================================================================
[ 27.974504] ================================================================== [ 27.975156] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x3e3/0x510 [ 27.975483] Read of size 1 at addr ffff888103264000 by task kunit_try_catch/242 [ 27.976238] [ 27.976533] CPU: 0 UID: 0 PID: 242 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc2-next-20250619 #1 PREEMPT(voluntary) [ 27.976657] Tainted: [B]=BAD_PAGE, [N]=TEST [ 27.976685] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 27.976740] Call Trace: [ 27.976780] <TASK> [ 27.976821] dump_stack_lvl+0x73/0xb0 [ 27.976910] print_report+0xd1/0x650 [ 27.976979] ? __virt_addr_valid+0x1db/0x2d0 [ 27.977029] ? kmem_cache_rcu_uaf+0x3e3/0x510 [ 27.977072] ? kasan_complete_mode_report_info+0x64/0x200 [ 27.977131] ? kmem_cache_rcu_uaf+0x3e3/0x510 [ 27.977175] kasan_report+0x141/0x180 [ 27.977221] ? kmem_cache_rcu_uaf+0x3e3/0x510 [ 27.977273] __asan_report_load1_noabort+0x18/0x20 [ 27.977326] kmem_cache_rcu_uaf+0x3e3/0x510 [ 27.977373] ? __pfx_kmem_cache_rcu_uaf+0x10/0x10 [ 27.977416] ? finish_task_switch.isra.0+0x153/0x700 [ 27.977458] ? __switch_to+0x47/0xf50 [ 27.977509] ? __pfx_read_tsc+0x10/0x10 [ 27.977571] ? ktime_get_ts64+0x86/0x230 [ 27.977627] kunit_try_run_case+0x1a5/0x480 [ 27.977687] ? __pfx_kunit_try_run_case+0x10/0x10 [ 27.977735] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 27.977790] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 27.977841] ? __kthread_parkme+0x82/0x180 [ 27.977893] ? preempt_count_sub+0x50/0x80 [ 27.977946] ? __pfx_kunit_try_run_case+0x10/0x10 [ 27.978019] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 27.978047] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 27.978073] kthread+0x337/0x6f0 [ 27.978096] ? trace_preempt_on+0x20/0xc0 [ 27.978147] ? __pfx_kthread+0x10/0x10 [ 27.978171] ? _raw_spin_unlock_irq+0x47/0x80 [ 27.978194] ? calculate_sigpending+0x7b/0xa0 [ 27.978222] ? __pfx_kthread+0x10/0x10 [ 27.978246] ret_from_fork+0x116/0x1d0 [ 27.978268] ? __pfx_kthread+0x10/0x10 [ 27.978292] ret_from_fork_asm+0x1a/0x30 [ 27.978327] </TASK> [ 27.978342] [ 27.987339] Allocated by task 242: [ 27.987570] kasan_save_stack+0x45/0x70 [ 27.987801] kasan_save_track+0x18/0x40 [ 27.987980] kasan_save_alloc_info+0x3b/0x50 [ 27.988321] __kasan_slab_alloc+0x91/0xa0 [ 27.988690] kmem_cache_alloc_noprof+0x123/0x3f0 [ 27.989206] kmem_cache_rcu_uaf+0x155/0x510 [ 27.989583] kunit_try_run_case+0x1a5/0x480 [ 27.990007] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 27.990432] kthread+0x337/0x6f0 [ 27.990679] ret_from_fork+0x116/0x1d0 [ 27.990871] ret_from_fork_asm+0x1a/0x30 [ 27.991224] [ 27.991387] Freed by task 0: [ 27.991631] kasan_save_stack+0x45/0x70 [ 27.991818] kasan_save_track+0x18/0x40 [ 27.992204] kasan_save_free_info+0x3f/0x60 [ 27.992484] __kasan_slab_free+0x56/0x70 [ 27.992750] slab_free_after_rcu_debug+0xe4/0x310 [ 27.993214] rcu_core+0x66f/0x1c40 [ 27.993400] rcu_core_si+0x12/0x20 [ 27.993688] handle_softirqs+0x209/0x730 [ 27.993898] __irq_exit_rcu+0xc9/0x110 [ 27.994252] irq_exit_rcu+0x12/0x20 [ 27.994439] sysvec_apic_timer_interrupt+0x81/0x90 [ 27.994751] asm_sysvec_apic_timer_interrupt+0x1f/0x30 [ 27.995219] [ 27.995392] Last potentially related work creation: [ 27.995726] kasan_save_stack+0x45/0x70 [ 27.997144] kasan_record_aux_stack+0xb2/0xc0 [ 27.997465] kmem_cache_free+0x131/0x420 [ 27.997699] kmem_cache_rcu_uaf+0x194/0x510 [ 27.998076] kunit_try_run_case+0x1a5/0x480 [ 27.998287] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 27.998520] kthread+0x337/0x6f0 [ 27.998691] ret_from_fork+0x116/0x1d0 [ 27.998872] ret_from_fork_asm+0x1a/0x30 [ 28.000487] [ 28.001149] The buggy address belongs to the object at ffff888103264000 [ 28.001149] which belongs to the cache test_cache of size 200 [ 28.002433] The buggy address is located 0 bytes inside of [ 28.002433] freed 200-byte region [ffff888103264000, ffff8881032640c8) [ 28.003436] [ 28.003610] The buggy address belongs to the physical page: [ 28.004013] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103264 [ 28.004524] flags: 0x200000000000000(node=0|zone=2) [ 28.004952] page_type: f5(slab) [ 28.005269] raw: 0200000000000000 ffff888101981b40 dead000000000122 0000000000000000 [ 28.005703] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000 [ 28.006159] page dumped because: kasan: bad access detected [ 28.006379] [ 28.006478] Memory state around the buggy address: [ 28.006745] ffff888103263f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 28.007261] ffff888103263f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 28.007641] >ffff888103264000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 28.007885] ^ [ 28.008176] ffff888103264080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc [ 28.008674] ffff888103264100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 28.009139] ==================================================================