Date
July 20, 2025, 11:12 a.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 15.420932] ================================================================== [ 15.421001] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x300/0x338 [ 15.421050] Read of size 1 at addr fff00000c3fc61e8 by task kunit_try_catch/184 [ 15.421117] [ 15.421163] CPU: 0 UID: 0 PID: 184 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc6 #1 PREEMPT [ 15.421246] Tainted: [B]=BAD_PAGE, [N]=TEST [ 15.421271] Hardware name: linux,dummy-virt (DT) [ 15.421319] Call trace: [ 15.421341] show_stack+0x20/0x38 (C) [ 15.421386] dump_stack_lvl+0x8c/0xd0 [ 15.421432] print_report+0x118/0x5d0 [ 15.421588] kasan_report+0xdc/0x128 [ 15.421646] __asan_report_load1_noabort+0x20/0x30 [ 15.421706] kmalloc_uaf+0x300/0x338 [ 15.421749] kunit_try_run_case+0x170/0x3f0 [ 15.421954] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 15.422029] kthread+0x328/0x630 [ 15.422076] ret_from_fork+0x10/0x20 [ 15.422138] [ 15.422157] Allocated by task 184: [ 15.422194] kasan_save_stack+0x3c/0x68 [ 15.422253] kasan_save_track+0x20/0x40 [ 15.422317] kasan_save_alloc_info+0x40/0x58 [ 15.422359] __kasan_kmalloc+0xd4/0xd8 [ 15.422395] __kmalloc_cache_noprof+0x16c/0x3c0 [ 15.422462] kmalloc_uaf+0xb8/0x338 [ 15.422527] kunit_try_run_case+0x170/0x3f0 [ 15.422570] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 15.422612] kthread+0x328/0x630 [ 15.422692] ret_from_fork+0x10/0x20 [ 15.422746] [ 15.422785] Freed by task 184: [ 15.422812] kasan_save_stack+0x3c/0x68 [ 15.422849] kasan_save_track+0x20/0x40 [ 15.422913] kasan_save_free_info+0x4c/0x78 [ 15.422970] __kasan_slab_free+0x6c/0x98 [ 15.423089] kfree+0x214/0x3c8 [ 15.423125] kmalloc_uaf+0x11c/0x338 [ 15.423158] kunit_try_run_case+0x170/0x3f0 [ 15.423213] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 15.423257] kthread+0x328/0x630 [ 15.423288] ret_from_fork+0x10/0x20 [ 15.423531] [ 15.423600] The buggy address belongs to the object at fff00000c3fc61e0 [ 15.423600] which belongs to the cache kmalloc-16 of size 16 [ 15.423739] The buggy address is located 8 bytes inside of [ 15.423739] freed 16-byte region [fff00000c3fc61e0, fff00000c3fc61f0) [ 15.423869] [ 15.423897] The buggy address belongs to the physical page: [ 15.423948] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103fc6 [ 15.424014] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 15.424106] page_type: f5(slab) [ 15.424146] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000 [ 15.424353] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000 [ 15.424542] page dumped because: kasan: bad access detected [ 15.424612] [ 15.424725] Memory state around the buggy address: [ 15.424826] fff00000c3fc6080: 00 00 fc fc 00 02 fc fc 00 02 fc fc 00 06 fc fc [ 15.424935] fff00000c3fc6100: 00 06 fc fc fa fb fc fc fa fb fc fc fa fb fc fc [ 15.424980] >fff00000c3fc6180: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc [ 15.425026] ^ [ 15.425240] fff00000c3fc6200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 15.425394] fff00000c3fc6280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 15.425606] ==================================================================
[ 12.545867] ================================================================== [ 12.546406] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x320/0x380 [ 12.546922] Read of size 1 at addr ffff888100fffaa8 by task kunit_try_catch/201 [ 12.547226] [ 12.547346] CPU: 1 UID: 0 PID: 201 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc6 #1 PREEMPT(voluntary) [ 12.547389] Tainted: [B]=BAD_PAGE, [N]=TEST [ 12.547400] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 12.547420] Call Trace: [ 12.547431] <TASK> [ 12.547445] dump_stack_lvl+0x73/0xb0 [ 12.547474] print_report+0xd1/0x610 [ 12.547495] ? __virt_addr_valid+0x1db/0x2d0 [ 12.547517] ? kmalloc_uaf+0x320/0x380 [ 12.547535] ? kasan_complete_mode_report_info+0x64/0x200 [ 12.547556] ? kmalloc_uaf+0x320/0x380 [ 12.547574] kasan_report+0x141/0x180 [ 12.547595] ? kmalloc_uaf+0x320/0x380 [ 12.547618] __asan_report_load1_noabort+0x18/0x20 [ 12.547641] kmalloc_uaf+0x320/0x380 [ 12.547659] ? __pfx_kmalloc_uaf+0x10/0x10 [ 12.547679] ? __schedule+0x10cc/0x2b60 [ 12.547791] ? __pfx_read_tsc+0x10/0x10 [ 12.547811] ? ktime_get_ts64+0x86/0x230 [ 12.547835] kunit_try_run_case+0x1a5/0x480 [ 12.547859] ? __pfx_kunit_try_run_case+0x10/0x10 [ 12.547880] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 12.547902] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 12.547936] ? __kthread_parkme+0x82/0x180 [ 12.547968] ? preempt_count_sub+0x50/0x80 [ 12.547991] ? __pfx_kunit_try_run_case+0x10/0x10 [ 12.548014] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.548036] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 12.548057] kthread+0x337/0x6f0 [ 12.548076] ? trace_preempt_on+0x20/0xc0 [ 12.548098] ? __pfx_kthread+0x10/0x10 [ 12.548117] ? _raw_spin_unlock_irq+0x47/0x80 [ 12.548137] ? calculate_sigpending+0x7b/0xa0 [ 12.548159] ? __pfx_kthread+0x10/0x10 [ 12.548179] ret_from_fork+0x116/0x1d0 [ 12.548196] ? __pfx_kthread+0x10/0x10 [ 12.548215] ret_from_fork_asm+0x1a/0x30 [ 12.548244] </TASK> [ 12.548254] [ 12.560086] Allocated by task 201: [ 12.560259] kasan_save_stack+0x45/0x70 [ 12.560715] kasan_save_track+0x18/0x40 [ 12.561094] kasan_save_alloc_info+0x3b/0x50 [ 12.561287] __kasan_kmalloc+0xb7/0xc0 [ 12.561452] __kmalloc_cache_noprof+0x189/0x420 [ 12.561675] kmalloc_uaf+0xaa/0x380 [ 12.562280] kunit_try_run_case+0x1a5/0x480 [ 12.562646] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.563051] kthread+0x337/0x6f0 [ 12.563332] ret_from_fork+0x116/0x1d0 [ 12.563702] ret_from_fork_asm+0x1a/0x30 [ 12.563981] [ 12.564062] Freed by task 201: [ 12.564222] kasan_save_stack+0x45/0x70 [ 12.564699] kasan_save_track+0x18/0x40 [ 12.564870] kasan_save_free_info+0x3f/0x60 [ 12.565250] __kasan_slab_free+0x56/0x70 [ 12.565746] kfree+0x222/0x3f0 [ 12.566035] kmalloc_uaf+0x12c/0x380 [ 12.566424] kunit_try_run_case+0x1a5/0x480 [ 12.566621] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.567052] kthread+0x337/0x6f0 [ 12.567334] ret_from_fork+0x116/0x1d0 [ 12.567653] ret_from_fork_asm+0x1a/0x30 [ 12.567998] [ 12.568101] The buggy address belongs to the object at ffff888100fffaa0 [ 12.568101] which belongs to the cache kmalloc-16 of size 16 [ 12.568948] The buggy address is located 8 bytes inside of [ 12.568948] freed 16-byte region [ffff888100fffaa0, ffff888100fffab0) [ 12.569874] [ 12.570107] The buggy address belongs to the physical page: [ 12.570525] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x100fff [ 12.571079] flags: 0x200000000000000(node=0|zone=2) [ 12.571263] page_type: f5(slab) [ 12.571700] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000 [ 12.572260] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000 [ 12.572839] page dumped because: kasan: bad access detected [ 12.573174] [ 12.573276] Memory state around the buggy address: [ 12.573867] ffff888100fff980: fa fb fc fc fa fb fc fc 00 02 fc fc 00 02 fc fc [ 12.574300] ffff888100fffa00: 00 06 fc fc 00 06 fc fc fa fb fc fc fa fb fc fc [ 12.574651] >ffff888100fffa80: 00 05 fc fc fa fb fc fc fc fc fc fc fc fc fc fc [ 12.575229] ^ [ 12.575682] ffff888100fffb00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 12.576128] ffff888100fffb80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 12.576662] ==================================================================