Date
July 8, 2025, 4:38 p.m.
Environment | |
---|---|
qemu-x86_64 |
[ 11.521645] ================================================================== [ 11.522740] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x320/0x380 [ 11.523168] Read of size 1 at addr ffff88810242c928 by task kunit_try_catch/204 [ 11.523403] [ 11.523497] CPU: 0 UID: 0 PID: 204 Comm: kunit_try_catch Tainted: G B N 6.15.6-rc1 #1 PREEMPT(voluntary) [ 11.523553] Tainted: [B]=BAD_PAGE, [N]=TEST [ 11.523565] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 11.523594] Call Trace: [ 11.523608] <TASK> [ 11.523625] dump_stack_lvl+0x73/0xb0 [ 11.523653] print_report+0xd1/0x650 [ 11.523678] ? __virt_addr_valid+0x1db/0x2d0 [ 11.523702] ? kmalloc_uaf+0x320/0x380 [ 11.523723] ? kasan_complete_mode_report_info+0x64/0x200 [ 11.523771] ? kmalloc_uaf+0x320/0x380 [ 11.523978] kasan_report+0x141/0x180 [ 11.524010] ? kmalloc_uaf+0x320/0x380 [ 11.524038] __asan_report_load1_noabort+0x18/0x20 [ 11.524060] kmalloc_uaf+0x320/0x380 [ 11.524100] ? __pfx_kmalloc_uaf+0x10/0x10 [ 11.524123] ? __schedule+0x10cc/0x2b60 [ 11.524148] ? __pfx_read_tsc+0x10/0x10 [ 11.524169] ? ktime_get_ts64+0x86/0x230 [ 11.524196] kunit_try_run_case+0x1a5/0x480 [ 11.524219] ? __pfx_kunit_try_run_case+0x10/0x10 [ 11.524239] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 11.524264] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 11.524310] ? __kthread_parkme+0x82/0x180 [ 11.524334] ? preempt_count_sub+0x50/0x80 [ 11.524372] ? __pfx_kunit_try_run_case+0x10/0x10 [ 11.524393] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.524416] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 11.524440] kthread+0x337/0x6f0 [ 11.524457] ? trace_preempt_on+0x20/0xc0 [ 11.524483] ? __pfx_kthread+0x10/0x10 [ 11.524501] ? _raw_spin_unlock_irq+0x47/0x80 [ 11.524524] ? calculate_sigpending+0x7b/0xa0 [ 11.524546] ? __pfx_kthread+0x10/0x10 [ 11.524565] ret_from_fork+0x41/0x80 [ 11.524587] ? __pfx_kthread+0x10/0x10 [ 11.524605] ret_from_fork_asm+0x1a/0x30 [ 11.524636] </TASK> [ 11.524647] [ 11.538501] Allocated by task 204: [ 11.538925] kasan_save_stack+0x45/0x70 [ 11.539310] kasan_save_track+0x18/0x40 [ 11.539803] kasan_save_alloc_info+0x3b/0x50 [ 11.540162] __kasan_kmalloc+0xb7/0xc0 [ 11.540304] __kmalloc_cache_noprof+0x189/0x420 [ 11.540458] kmalloc_uaf+0xaa/0x380 [ 11.540739] kunit_try_run_case+0x1a5/0x480 [ 11.541462] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.542183] kthread+0x337/0x6f0 [ 11.542819] ret_from_fork+0x41/0x80 [ 11.543310] ret_from_fork_asm+0x1a/0x30 [ 11.543525] [ 11.543801] Freed by task 204: [ 11.544274] kasan_save_stack+0x45/0x70 [ 11.544505] kasan_save_track+0x18/0x40 [ 11.545085] kasan_save_free_info+0x3f/0x60 [ 11.545423] __kasan_slab_free+0x56/0x70 [ 11.545601] kfree+0x222/0x3f0 [ 11.546107] kmalloc_uaf+0x12c/0x380 [ 11.546541] kunit_try_run_case+0x1a5/0x480 [ 11.546989] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.547172] kthread+0x337/0x6f0 [ 11.547291] ret_from_fork+0x41/0x80 [ 11.547421] ret_from_fork_asm+0x1a/0x30 [ 11.547578] [ 11.547651] The buggy address belongs to the object at ffff88810242c920 [ 11.547651] which belongs to the cache kmalloc-16 of size 16 [ 11.548345] The buggy address is located 8 bytes inside of [ 11.548345] freed 16-byte region [ffff88810242c920, ffff88810242c930) [ 11.549227] [ 11.549311] The buggy address belongs to the physical page: [ 11.549686] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10242c [ 11.550283] flags: 0x200000000000000(node=0|zone=2) [ 11.550555] page_type: f5(slab) [ 11.550729] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000 [ 11.551184] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000 [ 11.551535] page dumped because: kasan: bad access detected [ 11.551847] [ 11.552047] Memory state around the buggy address: [ 11.552215] ffff88810242c800: 00 04 fc fc 00 00 fc fc 00 04 fc fc 00 04 fc fc [ 11.552487] ffff88810242c880: 00 00 fc fc 00 04 fc fc fa fb fc fc fa fb fc fc [ 11.553101] >ffff88810242c900: 00 05 fc fc fa fb fc fc fc fc fc fc fc fc fc fc [ 11.553383] ^ [ 11.553697] ffff88810242c980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 11.553993] ffff88810242ca00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 11.554421] ==================================================================