Date
July 22, 2025, 5:13 a.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 30.497035] ================================================================== [ 30.497329] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x3f4/0x468 [ 30.497527] Read of size 1 at addr fff00000c923d6a8 by task kunit_try_catch/219 [ 30.497674] [ 30.497757] CPU: 1 UID: 0 PID: 219 Comm: kunit_try_catch Tainted: G B W N 6.16.0-rc7-next-20250722 #1 PREEMPT [ 30.497957] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST [ 30.497988] Hardware name: linux,dummy-virt (DT) [ 30.498034] Call trace: [ 30.498318] show_stack+0x20/0x38 (C) [ 30.498414] dump_stack_lvl+0x8c/0xd0 [ 30.498736] print_report+0x118/0x5e8 [ 30.498824] kasan_report+0xdc/0x128 [ 30.498872] __asan_report_load1_noabort+0x20/0x30 [ 30.498950] kmalloc_uaf2+0x3f4/0x468 [ 30.498999] kunit_try_run_case+0x170/0x3f0 [ 30.499050] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 30.499103] kthread+0x328/0x630 [ 30.499165] ret_from_fork+0x10/0x20 [ 30.499213] [ 30.499231] Allocated by task 219: [ 30.499260] kasan_save_stack+0x3c/0x68 [ 30.499301] kasan_save_track+0x20/0x40 [ 30.499344] kasan_save_alloc_info+0x40/0x58 [ 30.499382] __kasan_kmalloc+0xd4/0xd8 [ 30.499415] __kmalloc_cache_noprof+0x16c/0x3c0 [ 30.499464] kmalloc_uaf2+0xc4/0x468 [ 30.499506] kunit_try_run_case+0x170/0x3f0 [ 30.499544] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 30.499594] kthread+0x328/0x630 [ 30.499626] ret_from_fork+0x10/0x20 [ 30.499661] [ 30.499679] Freed by task 219: [ 30.499703] kasan_save_stack+0x3c/0x68 [ 30.499754] kasan_save_track+0x20/0x40 [ 30.499787] kasan_save_free_info+0x4c/0x78 [ 30.499834] __kasan_slab_free+0x6c/0x98 [ 30.499868] kfree+0x214/0x3c8 [ 30.499904] kmalloc_uaf2+0x134/0x468 [ 30.499940] kunit_try_run_case+0x170/0x3f0 [ 30.499977] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 30.500025] kthread+0x328/0x630 [ 30.500076] ret_from_fork+0x10/0x20 [ 30.500112] [ 30.500131] The buggy address belongs to the object at fff00000c923d680 [ 30.500131] which belongs to the cache kmalloc-64 of size 64 [ 30.500189] The buggy address is located 40 bytes inside of [ 30.500189] freed 64-byte region [fff00000c923d680, fff00000c923d6c0) [ 30.500259] [ 30.500278] The buggy address belongs to the physical page: [ 30.500312] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10923d [ 30.500374] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 30.500422] page_type: f5(slab) [ 30.500461] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000 [ 30.500511] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000 [ 30.500553] page dumped because: kasan: bad access detected [ 30.500589] [ 30.500622] Memory state around the buggy address: [ 30.500660] fff00000c923d580: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 30.500703] fff00000c923d600: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 30.500750] >fff00000c923d680: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 30.500788] ^ [ 30.501058] fff00000c923d700: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc [ 30.501576] fff00000c923d780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 30.501955] ==================================================================
[ 25.431136] ================================================================== [ 25.431672] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x4a8/0x520 [ 25.432028] Read of size 1 at addr ffff88810496fb28 by task kunit_try_catch/236 [ 25.432371] [ 25.432553] CPU: 0 UID: 0 PID: 236 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc7-next-20250722 #1 PREEMPT(voluntary) [ 25.432606] Tainted: [B]=BAD_PAGE, [N]=TEST [ 25.432620] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 25.432641] Call Trace: [ 25.432656] <TASK> [ 25.432673] dump_stack_lvl+0x73/0xb0 [ 25.432703] print_report+0xd1/0x640 [ 25.432749] ? __virt_addr_valid+0x1db/0x2d0 [ 25.432775] ? kmalloc_uaf2+0x4a8/0x520 [ 25.432795] ? kasan_complete_mode_report_info+0x64/0x200 [ 25.432821] ? kmalloc_uaf2+0x4a8/0x520 [ 25.432853] kasan_report+0x141/0x180 [ 25.432883] ? kmalloc_uaf2+0x4a8/0x520 [ 25.432908] __asan_report_load1_noabort+0x18/0x20 [ 25.432932] kmalloc_uaf2+0x4a8/0x520 [ 25.432953] ? __pfx_kmalloc_uaf2+0x10/0x10 [ 25.432973] ? __schedule+0x2070/0x2b60 [ 25.432996] ? schedule+0x7c/0x2e0 [ 25.433018] ? trace_hardirqs_on+0x37/0xe0 [ 25.433042] ? __schedule+0x2070/0x2b60 [ 25.433066] ? __pfx_read_tsc+0x10/0x10 [ 25.433088] ? ktime_get_ts64+0x86/0x230 [ 25.433135] kunit_try_run_case+0x1a5/0x480 [ 25.433161] ? __pfx_kunit_try_run_case+0x10/0x10 [ 25.433184] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 25.433209] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 25.433234] ? __kthread_parkme+0x82/0x180 [ 25.433263] ? preempt_count_sub+0x50/0x80 [ 25.433286] ? __pfx_kunit_try_run_case+0x10/0x10 [ 25.433310] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 25.433334] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 25.433357] kthread+0x337/0x6f0 [ 25.433378] ? trace_preempt_on+0x20/0xc0 [ 25.433400] ? __pfx_kthread+0x10/0x10 [ 25.433421] ? _raw_spin_unlock_irq+0x47/0x80 [ 25.433444] ? calculate_sigpending+0x7b/0xa0 [ 25.433517] ? __pfx_kthread+0x10/0x10 [ 25.433539] ret_from_fork+0x116/0x1d0 [ 25.433559] ? __pfx_kthread+0x10/0x10 [ 25.433579] ret_from_fork_asm+0x1a/0x30 [ 25.433610] </TASK> [ 25.433622] [ 25.441683] Allocated by task 236: [ 25.441887] kasan_save_stack+0x45/0x70 [ 25.442086] kasan_save_track+0x18/0x40 [ 25.442440] kasan_save_alloc_info+0x3b/0x50 [ 25.442653] __kasan_kmalloc+0xb7/0xc0 [ 25.442873] __kmalloc_cache_noprof+0x189/0x420 [ 25.443075] kmalloc_uaf2+0xc6/0x520 [ 25.443269] kunit_try_run_case+0x1a5/0x480 [ 25.443524] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 25.443774] kthread+0x337/0x6f0 [ 25.443942] ret_from_fork+0x116/0x1d0 [ 25.444072] ret_from_fork_asm+0x1a/0x30 [ 25.444275] [ 25.444365] Freed by task 236: [ 25.444630] kasan_save_stack+0x45/0x70 [ 25.444783] kasan_save_track+0x18/0x40 [ 25.444930] kasan_save_free_info+0x3f/0x60 [ 25.445153] __kasan_slab_free+0x56/0x70 [ 25.445362] kfree+0x222/0x3f0 [ 25.445627] kmalloc_uaf2+0x14c/0x520 [ 25.445765] kunit_try_run_case+0x1a5/0x480 [ 25.445919] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 25.446089] kthread+0x337/0x6f0 [ 25.446203] ret_from_fork+0x116/0x1d0 [ 25.446330] ret_from_fork_asm+0x1a/0x30 [ 25.446484] [ 25.446575] The buggy address belongs to the object at ffff88810496fb00 [ 25.446575] which belongs to the cache kmalloc-64 of size 64 [ 25.447168] The buggy address is located 40 bytes inside of [ 25.447168] freed 64-byte region [ffff88810496fb00, ffff88810496fb40) [ 25.447674] [ 25.447746] The buggy address belongs to the physical page: [ 25.448271] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10496f [ 25.448666] flags: 0x200000000000000(node=0|zone=2) [ 25.448963] page_type: f5(slab) [ 25.449114] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000 [ 25.449606] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000 [ 25.449899] page dumped because: kasan: bad access detected [ 25.450155] [ 25.450246] Memory state around the buggy address: [ 25.450434] ffff88810496fa00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 25.450779] ffff88810496fa80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 25.451049] >ffff88810496fb00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 25.451602] ^ [ 25.451841] ffff88810496fb80: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc [ 25.452155] ffff88810496fc00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 25.452423] ==================================================================