Date
July 6, 2025, 11:09 a.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 19.381936] ================================================================== [ 19.382041] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x388/0x468 [ 19.382116] Read of size 1 at addr fff00000c56f8000 by task kunit_try_catch/213 [ 19.382168] [ 19.382240] CPU: 1 UID: 0 PID: 213 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc4 #1 PREEMPT [ 19.382327] Tainted: [B]=BAD_PAGE, [N]=TEST [ 19.382377] Hardware name: linux,dummy-virt (DT) [ 19.382414] Call trace: [ 19.382443] show_stack+0x20/0x38 (C) [ 19.382497] dump_stack_lvl+0x8c/0xd0 [ 19.382545] print_report+0x118/0x608 [ 19.382593] kasan_report+0xdc/0x128 [ 19.382637] __asan_report_load1_noabort+0x20/0x30 [ 19.382688] kmem_cache_rcu_uaf+0x388/0x468 [ 19.382850] kunit_try_run_case+0x170/0x3f0 [ 19.382917] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 19.382970] kthread+0x328/0x630 [ 19.383022] ret_from_fork+0x10/0x20 [ 19.383072] [ 19.383090] Allocated by task 213: [ 19.383121] kasan_save_stack+0x3c/0x68 [ 19.383163] kasan_save_track+0x20/0x40 [ 19.383210] kasan_save_alloc_info+0x40/0x58 [ 19.383250] __kasan_slab_alloc+0xa8/0xb0 [ 19.383288] kmem_cache_alloc_noprof+0x10c/0x398 [ 19.383328] kmem_cache_rcu_uaf+0x12c/0x468 [ 19.383365] kunit_try_run_case+0x170/0x3f0 [ 19.383402] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 19.383446] kthread+0x328/0x630 [ 19.383488] ret_from_fork+0x10/0x20 [ 19.383525] [ 19.383542] Freed by task 0: [ 19.383575] kasan_save_stack+0x3c/0x68 [ 19.383755] kasan_save_track+0x20/0x40 [ 19.383872] kasan_save_free_info+0x4c/0x78 [ 19.383911] __kasan_slab_free+0x6c/0x98 [ 19.383946] slab_free_after_rcu_debug+0xd4/0x2f8 [ 19.383985] rcu_core+0x9f4/0x1e20 [ 19.384021] rcu_core_si+0x18/0x30 [ 19.384056] handle_softirqs+0x374/0xb28 [ 19.384093] __do_softirq+0x1c/0x28 [ 19.384125] [ 19.384144] Last potentially related work creation: [ 19.384169] kasan_save_stack+0x3c/0x68 [ 19.384782] kasan_record_aux_stack+0xb4/0xc8 [ 19.384830] kmem_cache_free+0x120/0x468 [ 19.384869] kmem_cache_rcu_uaf+0x16c/0x468 [ 19.384934] kunit_try_run_case+0x170/0x3f0 [ 19.385310] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 19.385357] kthread+0x328/0x630 [ 19.385388] ret_from_fork+0x10/0x20 [ 19.385433] [ 19.385451] The buggy address belongs to the object at fff00000c56f8000 [ 19.385451] which belongs to the cache test_cache of size 200 [ 19.385596] The buggy address is located 0 bytes inside of [ 19.385596] freed 200-byte region [fff00000c56f8000, fff00000c56f80c8) [ 19.385691] [ 19.385713] The buggy address belongs to the physical page: [ 19.385746] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1056f8 [ 19.385802] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 19.385854] page_type: f5(slab) [ 19.385896] raw: 0bfffe0000000000 fff00000c1b58a00 dead000000000122 0000000000000000 [ 19.385946] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000 [ 19.385986] page dumped because: kasan: bad access detected [ 19.386017] [ 19.386035] Memory state around the buggy address: [ 19.386069] fff00000c56f7f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 19.386111] fff00000c56f7f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 19.386292] >fff00000c56f8000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 19.386410] ^ [ 19.386507] fff00000c56f8080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc [ 19.386552] fff00000c56f8100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 19.386631] ==================================================================
[ 12.399755] ================================================================== [ 12.400302] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x3e3/0x510 [ 12.400634] Read of size 1 at addr ffff8881027a3000 by task kunit_try_catch/230 [ 12.400976] [ 12.401085] CPU: 1 UID: 0 PID: 230 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc4 #1 PREEMPT(voluntary) [ 12.401133] Tainted: [B]=BAD_PAGE, [N]=TEST [ 12.401146] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 12.401167] Call Trace: [ 12.401181] <TASK> [ 12.401201] dump_stack_lvl+0x73/0xb0 [ 12.401232] print_report+0xd1/0x650 [ 12.401255] ? __virt_addr_valid+0x1db/0x2d0 [ 12.401279] ? kmem_cache_rcu_uaf+0x3e3/0x510 [ 12.401302] ? kasan_complete_mode_report_info+0x64/0x200 [ 12.401324] ? kmem_cache_rcu_uaf+0x3e3/0x510 [ 12.401347] kasan_report+0x141/0x180 [ 12.401369] ? kmem_cache_rcu_uaf+0x3e3/0x510 [ 12.401396] __asan_report_load1_noabort+0x18/0x20 [ 12.401419] kmem_cache_rcu_uaf+0x3e3/0x510 [ 12.401442] ? __pfx_kmem_cache_rcu_uaf+0x10/0x10 [ 12.401464] ? finish_task_switch.isra.0+0x153/0x700 [ 12.401486] ? __switch_to+0x47/0xf50 [ 12.401515] ? __pfx_read_tsc+0x10/0x10 [ 12.401536] ? ktime_get_ts64+0x86/0x230 [ 12.401560] kunit_try_run_case+0x1a5/0x480 [ 12.401586] ? __pfx_kunit_try_run_case+0x10/0x10 [ 12.401607] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 12.401631] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 12.401653] ? __kthread_parkme+0x82/0x180 [ 12.401674] ? preempt_count_sub+0x50/0x80 [ 12.401911] ? __pfx_kunit_try_run_case+0x10/0x10 [ 12.402038] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.402065] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 12.402089] kthread+0x337/0x6f0 [ 12.402122] ? trace_preempt_on+0x20/0xc0 [ 12.402146] ? __pfx_kthread+0x10/0x10 [ 12.402167] ? _raw_spin_unlock_irq+0x47/0x80 [ 12.402189] ? calculate_sigpending+0x7b/0xa0 [ 12.402215] ? __pfx_kthread+0x10/0x10 [ 12.402236] ret_from_fork+0x116/0x1d0 [ 12.402256] ? __pfx_kthread+0x10/0x10 [ 12.402276] ret_from_fork_asm+0x1a/0x30 [ 12.402308] </TASK> [ 12.402320] [ 12.415299] Allocated by task 230: [ 12.415451] kasan_save_stack+0x45/0x70 [ 12.415887] kasan_save_track+0x18/0x40 [ 12.416261] kasan_save_alloc_info+0x3b/0x50 [ 12.416696] __kasan_slab_alloc+0x91/0xa0 [ 12.416908] kmem_cache_alloc_noprof+0x123/0x3f0 [ 12.417133] kmem_cache_rcu_uaf+0x155/0x510 [ 12.417563] kunit_try_run_case+0x1a5/0x480 [ 12.417950] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.418311] kthread+0x337/0x6f0 [ 12.418437] ret_from_fork+0x116/0x1d0 [ 12.418960] ret_from_fork_asm+0x1a/0x30 [ 12.419348] [ 12.419598] Freed by task 0: [ 12.419811] kasan_save_stack+0x45/0x70 [ 12.419988] kasan_save_track+0x18/0x40 [ 12.420368] kasan_save_free_info+0x3f/0x60 [ 12.420811] __kasan_slab_free+0x56/0x70 [ 12.420974] slab_free_after_rcu_debug+0xe4/0x310 [ 12.421269] rcu_core+0x66f/0x1c40 [ 12.421654] rcu_core_si+0x12/0x20 [ 12.421982] handle_softirqs+0x209/0x730 [ 12.422292] __irq_exit_rcu+0xc9/0x110 [ 12.422430] irq_exit_rcu+0x12/0x20 [ 12.422564] sysvec_apic_timer_interrupt+0x81/0x90 [ 12.422726] asm_sysvec_apic_timer_interrupt+0x1f/0x30 [ 12.422894] [ 12.422977] Last potentially related work creation: [ 12.423139] kasan_save_stack+0x45/0x70 [ 12.423275] kasan_record_aux_stack+0xb2/0xc0 [ 12.423427] kmem_cache_free+0x131/0x420 [ 12.423563] kmem_cache_rcu_uaf+0x194/0x510 [ 12.423708] kunit_try_run_case+0x1a5/0x480 [ 12.423854] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.424431] kthread+0x337/0x6f0 [ 12.424795] ret_from_fork+0x116/0x1d0 [ 12.425162] ret_from_fork_asm+0x1a/0x30 [ 12.425576] [ 12.425736] The buggy address belongs to the object at ffff8881027a3000 [ 12.425736] which belongs to the cache test_cache of size 200 [ 12.426834] The buggy address is located 0 bytes inside of [ 12.426834] freed 200-byte region [ffff8881027a3000, ffff8881027a30c8) [ 12.428102] [ 12.428303] The buggy address belongs to the physical page: [ 12.428844] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1027a3 [ 12.429601] flags: 0x200000000000000(node=0|zone=2) [ 12.430040] page_type: f5(slab) [ 12.430363] raw: 0200000000000000 ffff888100f77640 dead000000000122 0000000000000000 [ 12.431073] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000 [ 12.431927] page dumped because: kasan: bad access detected [ 12.432315] [ 12.432480] Memory state around the buggy address: [ 12.432722] ffff8881027a2f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 12.432960] ffff8881027a2f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 12.433377] >ffff8881027a3000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 12.434061] ^ [ 12.434404] ffff8881027a3080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc [ 12.435088] ffff8881027a3100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 12.435516] ==================================================================