Date
July 2, 2025, 11:09 p.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 18.300027] ================================================================== [ 18.300193] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x3f4/0x468 [ 18.300416] Read of size 1 at addr fff00000c706b228 by task kunit_try_catch/188 [ 18.300590] [ 18.300627] CPU: 0 UID: 0 PID: 188 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc4 #1 PREEMPT [ 18.300797] Tainted: [B]=BAD_PAGE, [N]=TEST [ 18.300874] Hardware name: linux,dummy-virt (DT) [ 18.300967] Call trace: [ 18.300990] show_stack+0x20/0x38 (C) [ 18.301064] dump_stack_lvl+0x8c/0xd0 [ 18.301119] print_report+0x118/0x608 [ 18.301326] kasan_report+0xdc/0x128 [ 18.301598] __asan_report_load1_noabort+0x20/0x30 [ 18.302037] kmalloc_uaf2+0x3f4/0x468 [ 18.302203] kunit_try_run_case+0x170/0x3f0 [ 18.302321] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 18.302671] kthread+0x328/0x630 [ 18.302734] ret_from_fork+0x10/0x20 [ 18.303009] [ 18.303129] Allocated by task 188: [ 18.303691] kasan_save_stack+0x3c/0x68 [ 18.303747] kasan_save_track+0x20/0x40 [ 18.304001] kasan_save_alloc_info+0x40/0x58 [ 18.304186] __kasan_kmalloc+0xd4/0xd8 [ 18.304232] __kmalloc_cache_noprof+0x16c/0x3c0 [ 18.304423] kmalloc_uaf2+0xc4/0x468 [ 18.304637] kunit_try_run_case+0x170/0x3f0 [ 18.304736] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 18.304782] kthread+0x328/0x630 [ 18.305227] ret_from_fork+0x10/0x20 [ 18.305286] [ 18.305424] Freed by task 188: [ 18.305500] kasan_save_stack+0x3c/0x68 [ 18.305542] kasan_save_track+0x20/0x40 [ 18.306011] kasan_save_free_info+0x4c/0x78 [ 18.306162] __kasan_slab_free+0x6c/0x98 [ 18.306203] kfree+0x214/0x3c8 [ 18.306421] kmalloc_uaf2+0x134/0x468 [ 18.306588] kunit_try_run_case+0x170/0x3f0 [ 18.306988] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 18.307190] kthread+0x328/0x630 [ 18.307289] ret_from_fork+0x10/0x20 [ 18.307331] [ 18.307609] The buggy address belongs to the object at fff00000c706b200 [ 18.307609] which belongs to the cache kmalloc-64 of size 64 [ 18.307789] The buggy address is located 40 bytes inside of [ 18.307789] freed 64-byte region [fff00000c706b200, fff00000c706b240) [ 18.307961] [ 18.308013] The buggy address belongs to the physical page: [ 18.308058] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10706b [ 18.308542] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 18.308951] page_type: f5(slab) [ 18.309056] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000 [ 18.309293] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000 [ 18.309453] page dumped because: kasan: bad access detected [ 18.309600] [ 18.309667] Memory state around the buggy address: [ 18.309837] fff00000c706b100: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 18.309886] fff00000c706b180: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 18.310074] >fff00000c706b200: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 18.310129] ^ [ 18.310161] fff00000c706b280: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc [ 18.310213] fff00000c706b300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 18.310256] ==================================================================
[ 11.695532] ================================================================== [ 11.696155] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x4a8/0x520 [ 11.696396] Read of size 1 at addr ffff888103113728 by task kunit_try_catch/207 [ 11.696856] [ 11.697074] CPU: 0 UID: 0 PID: 207 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc4 #1 PREEMPT(voluntary) [ 11.697119] Tainted: [B]=BAD_PAGE, [N]=TEST [ 11.697130] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 11.697150] Call Trace: [ 11.697162] <TASK> [ 11.697180] dump_stack_lvl+0x73/0xb0 [ 11.697210] print_report+0xd1/0x650 [ 11.697232] ? __virt_addr_valid+0x1db/0x2d0 [ 11.697255] ? kmalloc_uaf2+0x4a8/0x520 [ 11.697273] ? kasan_complete_mode_report_info+0x64/0x200 [ 11.697293] ? kmalloc_uaf2+0x4a8/0x520 [ 11.697312] kasan_report+0x141/0x180 [ 11.697333] ? kmalloc_uaf2+0x4a8/0x520 [ 11.697356] __asan_report_load1_noabort+0x18/0x20 [ 11.697392] kmalloc_uaf2+0x4a8/0x520 [ 11.697443] ? __pfx_kmalloc_uaf2+0x10/0x10 [ 11.697462] ? finish_task_switch.isra.0+0x153/0x700 [ 11.697483] ? __switch_to+0x47/0xf50 [ 11.697520] ? __schedule+0x10cc/0x2b60 [ 11.697541] ? __pfx_read_tsc+0x10/0x10 [ 11.697582] ? ktime_get_ts64+0x86/0x230 [ 11.697606] kunit_try_run_case+0x1a5/0x480 [ 11.697629] ? __pfx_kunit_try_run_case+0x10/0x10 [ 11.697650] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 11.697672] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 11.697693] ? __kthread_parkme+0x82/0x180 [ 11.697713] ? preempt_count_sub+0x50/0x80 [ 11.697734] ? __pfx_kunit_try_run_case+0x10/0x10 [ 11.697770] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.697792] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 11.697813] kthread+0x337/0x6f0 [ 11.697831] ? trace_preempt_on+0x20/0xc0 [ 11.697855] ? __pfx_kthread+0x10/0x10 [ 11.697874] ? _raw_spin_unlock_irq+0x47/0x80 [ 11.697894] ? calculate_sigpending+0x7b/0xa0 [ 11.697916] ? __pfx_kthread+0x10/0x10 [ 11.697936] ret_from_fork+0x116/0x1d0 [ 11.697953] ? __pfx_kthread+0x10/0x10 [ 11.697972] ret_from_fork_asm+0x1a/0x30 [ 11.698002] </TASK> [ 11.698013] [ 11.709677] Allocated by task 207: [ 11.710055] kasan_save_stack+0x45/0x70 [ 11.710446] kasan_save_track+0x18/0x40 [ 11.710878] kasan_save_alloc_info+0x3b/0x50 [ 11.711031] __kasan_kmalloc+0xb7/0xc0 [ 11.711162] __kmalloc_cache_noprof+0x189/0x420 [ 11.711318] kmalloc_uaf2+0xc6/0x520 [ 11.711463] kunit_try_run_case+0x1a5/0x480 [ 11.711722] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.711999] kthread+0x337/0x6f0 [ 11.712184] ret_from_fork+0x116/0x1d0 [ 11.712332] ret_from_fork_asm+0x1a/0x30 [ 11.712518] [ 11.712828] Freed by task 207: [ 11.712992] kasan_save_stack+0x45/0x70 [ 11.713198] kasan_save_track+0x18/0x40 [ 11.713366] kasan_save_free_info+0x3f/0x60 [ 11.713643] __kasan_slab_free+0x56/0x70 [ 11.713910] kfree+0x222/0x3f0 [ 11.714063] kmalloc_uaf2+0x14c/0x520 [ 11.714226] kunit_try_run_case+0x1a5/0x480 [ 11.714394] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.714726] kthread+0x337/0x6f0 [ 11.714904] ret_from_fork+0x116/0x1d0 [ 11.715081] ret_from_fork_asm+0x1a/0x30 [ 11.715250] [ 11.715344] The buggy address belongs to the object at ffff888103113700 [ 11.715344] which belongs to the cache kmalloc-64 of size 64 [ 11.715928] The buggy address is located 40 bytes inside of [ 11.715928] freed 64-byte region [ffff888103113700, ffff888103113740) [ 11.716442] [ 11.716517] The buggy address belongs to the physical page: [ 11.716887] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103113 [ 11.717227] flags: 0x200000000000000(node=0|zone=2) [ 11.717506] page_type: f5(slab) [ 11.717899] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000 [ 11.718177] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000 [ 11.718613] page dumped because: kasan: bad access detected [ 11.718878] [ 11.718989] Memory state around the buggy address: [ 11.719200] ffff888103113600: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 11.719480] ffff888103113680: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 11.719899] >ffff888103113700: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 11.720161] ^ [ 11.720407] ffff888103113780: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc [ 11.720824] ffff888103113800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 11.721114] ==================================================================