Date
July 6, 2025, 11:09 a.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 18.212973] ================================================================== [ 18.213630] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x3f4/0x468 [ 18.213821] Read of size 1 at addr fff00000c6436028 by task kunit_try_catch/188 [ 18.213933] [ 18.214045] CPU: 1 UID: 0 PID: 188 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc4 #1 PREEMPT [ 18.214324] Tainted: [B]=BAD_PAGE, [N]=TEST [ 18.214485] Hardware name: linux,dummy-virt (DT) [ 18.214565] Call trace: [ 18.214709] show_stack+0x20/0x38 (C) [ 18.214765] dump_stack_lvl+0x8c/0xd0 [ 18.214843] print_report+0x118/0x608 [ 18.215132] kasan_report+0xdc/0x128 [ 18.215293] __asan_report_load1_noabort+0x20/0x30 [ 18.215447] kmalloc_uaf2+0x3f4/0x468 [ 18.215679] kunit_try_run_case+0x170/0x3f0 [ 18.216154] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 18.216301] kthread+0x328/0x630 [ 18.216370] ret_from_fork+0x10/0x20 [ 18.216710] [ 18.216739] Allocated by task 188: [ 18.216794] kasan_save_stack+0x3c/0x68 [ 18.217389] kasan_save_track+0x20/0x40 [ 18.217754] kasan_save_alloc_info+0x40/0x58 [ 18.217833] __kasan_kmalloc+0xd4/0xd8 [ 18.217975] __kmalloc_cache_noprof+0x16c/0x3c0 [ 18.218049] kmalloc_uaf2+0xc4/0x468 [ 18.218083] kunit_try_run_case+0x170/0x3f0 [ 18.218174] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 18.218238] kthread+0x328/0x630 [ 18.218269] ret_from_fork+0x10/0x20 [ 18.218305] [ 18.218354] Freed by task 188: [ 18.218383] kasan_save_stack+0x3c/0x68 [ 18.218528] kasan_save_track+0x20/0x40 [ 18.218702] kasan_save_free_info+0x4c/0x78 [ 18.218848] __kasan_slab_free+0x6c/0x98 [ 18.218953] kfree+0x214/0x3c8 [ 18.219026] kmalloc_uaf2+0x134/0x468 [ 18.219247] kunit_try_run_case+0x170/0x3f0 [ 18.219653] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 18.219834] kthread+0x328/0x630 [ 18.220018] ret_from_fork+0x10/0x20 [ 18.220115] [ 18.220231] The buggy address belongs to the object at fff00000c6436000 [ 18.220231] which belongs to the cache kmalloc-64 of size 64 [ 18.220512] The buggy address is located 40 bytes inside of [ 18.220512] freed 64-byte region [fff00000c6436000, fff00000c6436040) [ 18.220687] [ 18.220712] The buggy address belongs to the physical page: [ 18.221061] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106436 [ 18.221212] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 18.221362] page_type: f5(slab) [ 18.221486] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000 [ 18.221678] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000 [ 18.221860] page dumped because: kasan: bad access detected [ 18.221892] [ 18.221909] Memory state around the buggy address: [ 18.222283] fff00000c6435f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 18.222378] fff00000c6435f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 18.222499] >fff00000c6436000: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 18.222539] ^ [ 18.222573] fff00000c6436080: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc [ 18.223077] fff00000c6436100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 18.223275] ==================================================================
[ 11.879423] ================================================================== [ 11.880075] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x4a8/0x520 [ 11.880376] Read of size 1 at addr ffff888103a040a8 by task kunit_try_catch/205 [ 11.880737] [ 11.880843] CPU: 0 UID: 0 PID: 205 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc4 #1 PREEMPT(voluntary) [ 11.880887] Tainted: [B]=BAD_PAGE, [N]=TEST [ 11.880899] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 11.880920] Call Trace: [ 11.880943] <TASK> [ 11.880960] dump_stack_lvl+0x73/0xb0 [ 11.880990] print_report+0xd1/0x650 [ 11.881013] ? __virt_addr_valid+0x1db/0x2d0 [ 11.881035] ? kmalloc_uaf2+0x4a8/0x520 [ 11.881055] ? kasan_complete_mode_report_info+0x64/0x200 [ 11.881077] ? kmalloc_uaf2+0x4a8/0x520 [ 11.881097] kasan_report+0x141/0x180 [ 11.881119] ? kmalloc_uaf2+0x4a8/0x520 [ 11.881144] __asan_report_load1_noabort+0x18/0x20 [ 11.881167] kmalloc_uaf2+0x4a8/0x520 [ 11.881187] ? __pfx_kmalloc_uaf2+0x10/0x10 [ 11.881206] ? finish_task_switch.isra.0+0x153/0x700 [ 11.881228] ? __switch_to+0x47/0xf50 [ 11.881254] ? __schedule+0x10cc/0x2b60 [ 11.881276] ? __pfx_read_tsc+0x10/0x10 [ 11.881297] ? ktime_get_ts64+0x86/0x230 [ 11.881320] kunit_try_run_case+0x1a5/0x480 [ 11.881344] ? __pfx_kunit_try_run_case+0x10/0x10 [ 11.881365] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 11.881388] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 11.881410] ? __kthread_parkme+0x82/0x180 [ 11.881430] ? preempt_count_sub+0x50/0x80 [ 11.881452] ? __pfx_kunit_try_run_case+0x10/0x10 [ 11.881475] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.881497] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 11.881520] kthread+0x337/0x6f0 [ 11.881540] ? trace_preempt_on+0x20/0xc0 [ 11.881563] ? __pfx_kthread+0x10/0x10 [ 11.881601] ? _raw_spin_unlock_irq+0x47/0x80 [ 11.881622] ? calculate_sigpending+0x7b/0xa0 [ 11.881645] ? __pfx_kthread+0x10/0x10 [ 11.881666] ret_from_fork+0x116/0x1d0 [ 11.881684] ? __pfx_kthread+0x10/0x10 [ 11.881704] ret_from_fork_asm+0x1a/0x30 [ 11.881734] </TASK> [ 11.881745] [ 11.889666] Allocated by task 205: [ 11.889807] kasan_save_stack+0x45/0x70 [ 11.890027] kasan_save_track+0x18/0x40 [ 11.890221] kasan_save_alloc_info+0x3b/0x50 [ 11.890650] __kasan_kmalloc+0xb7/0xc0 [ 11.890862] __kmalloc_cache_noprof+0x189/0x420 [ 11.891134] kmalloc_uaf2+0xc6/0x520 [ 11.891271] kunit_try_run_case+0x1a5/0x480 [ 11.891417] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.891745] kthread+0x337/0x6f0 [ 11.891923] ret_from_fork+0x116/0x1d0 [ 11.892126] ret_from_fork_asm+0x1a/0x30 [ 11.892331] [ 11.892449] Freed by task 205: [ 11.892606] kasan_save_stack+0x45/0x70 [ 11.892784] kasan_save_track+0x18/0x40 [ 11.892960] kasan_save_free_info+0x3f/0x60 [ 11.893130] __kasan_slab_free+0x56/0x70 [ 11.893445] kfree+0x222/0x3f0 [ 11.893625] kmalloc_uaf2+0x14c/0x520 [ 11.893780] kunit_try_run_case+0x1a5/0x480 [ 11.893997] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.894255] kthread+0x337/0x6f0 [ 11.894428] ret_from_fork+0x116/0x1d0 [ 11.894669] ret_from_fork_asm+0x1a/0x30 [ 11.894814] [ 11.894886] The buggy address belongs to the object at ffff888103a04080 [ 11.894886] which belongs to the cache kmalloc-64 of size 64 [ 11.895252] The buggy address is located 40 bytes inside of [ 11.895252] freed 64-byte region [ffff888103a04080, ffff888103a040c0) [ 11.895762] [ 11.896037] The buggy address belongs to the physical page: [ 11.896327] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103a04 [ 11.896701] flags: 0x200000000000000(node=0|zone=2) [ 11.896878] page_type: f5(slab) [ 11.897014] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000 [ 11.897654] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000 [ 11.898005] page dumped because: kasan: bad access detected [ 11.898242] [ 11.898374] Memory state around the buggy address: [ 11.898616] ffff888103a03f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 11.898916] ffff888103a04000: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 11.899237] >ffff888103a04080: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 11.899588] ^ [ 11.899755] ffff888103a04100: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc [ 11.899992] ffff888103a04180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 11.900781] ==================================================================