Date
July 17, 2025, 11:11 p.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 16.769978] ================================================================== [ 16.770052] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x170/0x310 [ 16.770180] Write of size 33 at addr fff00000c7848d80 by task kunit_try_catch/186 [ 16.770233] [ 16.770335] CPU: 1 UID: 0 PID: 186 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc6 #1 PREEMPT [ 16.770442] Tainted: [B]=BAD_PAGE, [N]=TEST [ 16.770469] Hardware name: linux,dummy-virt (DT) [ 16.770507] Call trace: [ 16.770536] show_stack+0x20/0x38 (C) [ 16.770587] dump_stack_lvl+0x8c/0xd0 [ 16.770637] print_report+0x118/0x5d0 [ 16.770931] kasan_report+0xdc/0x128 [ 16.771065] kasan_check_range+0x100/0x1a8 [ 16.771120] __asan_memset+0x34/0x78 [ 16.771164] kmalloc_uaf_memset+0x170/0x310 [ 16.771253] kunit_try_run_case+0x170/0x3f0 [ 16.771303] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 16.771361] kthread+0x328/0x630 [ 16.771404] ret_from_fork+0x10/0x20 [ 16.771453] [ 16.771476] Allocated by task 186: [ 16.771566] kasan_save_stack+0x3c/0x68 [ 16.771623] kasan_save_track+0x20/0x40 [ 16.771699] kasan_save_alloc_info+0x40/0x58 [ 16.771869] __kasan_kmalloc+0xd4/0xd8 [ 16.771908] __kmalloc_cache_noprof+0x16c/0x3c0 [ 16.771964] kmalloc_uaf_memset+0xb8/0x310 [ 16.771999] kunit_try_run_case+0x170/0x3f0 [ 16.772189] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 16.772333] kthread+0x328/0x630 [ 16.772555] ret_from_fork+0x10/0x20 [ 16.772702] [ 16.772819] Freed by task 186: [ 16.772948] kasan_save_stack+0x3c/0x68 [ 16.773114] kasan_save_track+0x20/0x40 [ 16.773199] kasan_save_free_info+0x4c/0x78 [ 16.773326] __kasan_slab_free+0x6c/0x98 [ 16.773381] kfree+0x214/0x3c8 [ 16.773452] kmalloc_uaf_memset+0x11c/0x310 [ 16.773852] kunit_try_run_case+0x170/0x3f0 [ 16.774061] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 16.774175] kthread+0x328/0x630 [ 16.774393] ret_from_fork+0x10/0x20 [ 16.774554] [ 16.774650] The buggy address belongs to the object at fff00000c7848d80 [ 16.774650] which belongs to the cache kmalloc-64 of size 64 [ 16.774712] The buggy address is located 0 bytes inside of [ 16.774712] freed 64-byte region [fff00000c7848d80, fff00000c7848dc0) [ 16.774936] [ 16.775225] The buggy address belongs to the physical page: [ 16.775327] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107848 [ 16.775441] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 16.775615] page_type: f5(slab) [ 16.775717] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000 [ 16.775926] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000 [ 16.775968] page dumped because: kasan: bad access detected [ 16.775999] [ 16.776035] Memory state around the buggy address: [ 16.776067] fff00000c7848c80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 16.776110] fff00000c7848d00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 16.776155] >fff00000c7848d80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 16.776195] ^ [ 16.776491] fff00000c7848e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 16.776554] fff00000c7848e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 16.776608] ==================================================================
[ 12.545361] ================================================================== [ 12.546156] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x1a3/0x360 [ 12.546480] Write of size 33 at addr ffff8881026b9300 by task kunit_try_catch/203 [ 12.546804] [ 12.546970] CPU: 1 UID: 0 PID: 203 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc6 #1 PREEMPT(voluntary) [ 12.547043] Tainted: [B]=BAD_PAGE, [N]=TEST [ 12.547066] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 12.547105] Call Trace: [ 12.547118] <TASK> [ 12.547135] dump_stack_lvl+0x73/0xb0 [ 12.547181] print_report+0xd1/0x610 [ 12.547217] ? __virt_addr_valid+0x1db/0x2d0 [ 12.547240] ? kmalloc_uaf_memset+0x1a3/0x360 [ 12.547260] ? kasan_complete_mode_report_info+0x64/0x200 [ 12.547282] ? kmalloc_uaf_memset+0x1a3/0x360 [ 12.547303] kasan_report+0x141/0x180 [ 12.547324] ? kmalloc_uaf_memset+0x1a3/0x360 [ 12.547351] kasan_check_range+0x10c/0x1c0 [ 12.547374] __asan_memset+0x27/0x50 [ 12.547392] kmalloc_uaf_memset+0x1a3/0x360 [ 12.547413] ? __pfx_kmalloc_uaf_memset+0x10/0x10 [ 12.547434] ? __schedule+0x10cc/0x2b60 [ 12.547457] ? __pfx_read_tsc+0x10/0x10 [ 12.547477] ? ktime_get_ts64+0x86/0x230 [ 12.547501] kunit_try_run_case+0x1a5/0x480 [ 12.547526] ? __pfx_kunit_try_run_case+0x10/0x10 [ 12.547547] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 12.547571] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 12.547605] ? __kthread_parkme+0x82/0x180 [ 12.547625] ? preempt_count_sub+0x50/0x80 [ 12.547649] ? __pfx_kunit_try_run_case+0x10/0x10 [ 12.547672] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.547695] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 12.547720] kthread+0x337/0x6f0 [ 12.547738] ? trace_preempt_on+0x20/0xc0 [ 12.547761] ? __pfx_kthread+0x10/0x10 [ 12.547780] ? _raw_spin_unlock_irq+0x47/0x80 [ 12.547801] ? calculate_sigpending+0x7b/0xa0 [ 12.547835] ? __pfx_kthread+0x10/0x10 [ 12.547855] ret_from_fork+0x116/0x1d0 [ 12.547873] ? __pfx_kthread+0x10/0x10 [ 12.547893] ret_from_fork_asm+0x1a/0x30 [ 12.547926] </TASK> [ 12.547936] [ 12.556622] Allocated by task 203: [ 12.556800] kasan_save_stack+0x45/0x70 [ 12.556998] kasan_save_track+0x18/0x40 [ 12.557152] kasan_save_alloc_info+0x3b/0x50 [ 12.557464] __kasan_kmalloc+0xb7/0xc0 [ 12.557667] __kmalloc_cache_noprof+0x189/0x420 [ 12.558429] kmalloc_uaf_memset+0xa9/0x360 [ 12.558873] kunit_try_run_case+0x1a5/0x480 [ 12.559111] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.559340] kthread+0x337/0x6f0 [ 12.559496] ret_from_fork+0x116/0x1d0 [ 12.560094] ret_from_fork_asm+0x1a/0x30 [ 12.560423] [ 12.560519] Freed by task 203: [ 12.560844] kasan_save_stack+0x45/0x70 [ 12.561098] kasan_save_track+0x18/0x40 [ 12.561279] kasan_save_free_info+0x3f/0x60 [ 12.561468] __kasan_slab_free+0x56/0x70 [ 12.561905] kfree+0x222/0x3f0 [ 12.562223] kmalloc_uaf_memset+0x12b/0x360 [ 12.562577] kunit_try_run_case+0x1a5/0x480 [ 12.562953] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.563241] kthread+0x337/0x6f0 [ 12.563513] ret_from_fork+0x116/0x1d0 [ 12.563712] ret_from_fork_asm+0x1a/0x30 [ 12.564061] [ 12.564301] The buggy address belongs to the object at ffff8881026b9300 [ 12.564301] which belongs to the cache kmalloc-64 of size 64 [ 12.565071] The buggy address is located 0 bytes inside of [ 12.565071] freed 64-byte region [ffff8881026b9300, ffff8881026b9340) [ 12.565541] [ 12.565849] The buggy address belongs to the physical page: [ 12.566338] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1026b9 [ 12.566840] flags: 0x200000000000000(node=0|zone=2) [ 12.567431] page_type: f5(slab) [ 12.567772] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000 [ 12.568574] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000 [ 12.569272] page dumped because: kasan: bad access detected [ 12.569585] [ 12.569806] Memory state around the buggy address: [ 12.570072] ffff8881026b9200: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 12.570374] ffff8881026b9280: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 12.571109] >ffff8881026b9300: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 12.571608] ^ [ 12.572015] ffff8881026b9380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 12.572330] ffff8881026b9400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 12.572659] ==================================================================