Hay
Date
July 10, 2025, 9:07 a.m.

Environment
qemu-arm64
qemu-x86_64

[   29.605399] ==================================================================
[   29.605863] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x170/0x310
[   29.605930] Write of size 33 at addr fff00000c99b0b00 by task kunit_try_catch/217
[   29.605994] 
[   29.606035] CPU: 0 UID: 0 PID: 217 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5-next-20250710 #1 PREEMPT 
[   29.606402] Tainted: [B]=BAD_PAGE, [N]=TEST
[   29.606642] Hardware name: linux,dummy-virt (DT)
[   29.606715] Call trace:
[   29.607027]  show_stack+0x20/0x38 (C)
[   29.607329]  dump_stack_lvl+0x8c/0xd0
[   29.607388]  print_report+0x118/0x5d0
[   29.607434]  kasan_report+0xdc/0x128
[   29.607518]  kasan_check_range+0x100/0x1a8
[   29.607566]  __asan_memset+0x34/0x78
[   29.607796]  kmalloc_uaf_memset+0x170/0x310
[   29.607846]  kunit_try_run_case+0x170/0x3f0
[   29.608213]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.608520]  kthread+0x328/0x630
[   29.608669]  ret_from_fork+0x10/0x20
[   29.608719] 
[   29.608738] Allocated by task 217:
[   29.609199]  kasan_save_stack+0x3c/0x68
[   29.609252]  kasan_save_track+0x20/0x40
[   29.609292]  kasan_save_alloc_info+0x40/0x58
[   29.609328]  __kasan_kmalloc+0xd4/0xd8
[   29.609366]  __kmalloc_cache_noprof+0x16c/0x3c0
[   29.610055]  kmalloc_uaf_memset+0xb8/0x310
[   29.610108]  kunit_try_run_case+0x170/0x3f0
[   29.610159]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.610206]  kthread+0x328/0x630
[   29.610749]  ret_from_fork+0x10/0x20
[   29.610797] 
[   29.610817] Freed by task 217:
[   29.610844]  kasan_save_stack+0x3c/0x68
[   29.610930]  kasan_save_track+0x20/0x40
[   29.610975]  kasan_save_free_info+0x4c/0x78
[   29.611024]  __kasan_slab_free+0x6c/0x98
[   29.611098]  kfree+0x214/0x3c8
[   29.611238]  kmalloc_uaf_memset+0x11c/0x310
[   29.611565]  kunit_try_run_case+0x170/0x3f0
[   29.611614]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.611660]  kthread+0x328/0x630
[   29.611715]  ret_from_fork+0x10/0x20
[   29.611752] 
[   29.611837] The buggy address belongs to the object at fff00000c99b0b00
[   29.611837]  which belongs to the cache kmalloc-64 of size 64
[   29.612384] The buggy address is located 0 bytes inside of
[   29.612384]  freed 64-byte region [fff00000c99b0b00, fff00000c99b0b40)
[   29.612568] 
[   29.612589] The buggy address belongs to the physical page:
[   29.612869] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1099b0
[   29.613423] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   29.613489] page_type: f5(slab)
[   29.613783] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   29.613850] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   29.614355] page dumped because: kasan: bad access detected
[   29.614393] 
[   29.614637] Memory state around the buggy address:
[   29.614688]  fff00000c99b0a00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   29.614743]  fff00000c99b0a80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   29.615102] >fff00000c99b0b00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   29.615155]                    ^
[   29.615185]  fff00000c99b0b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.615229]  fff00000c99b0c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.615269] ==================================================================

[   25.326614] ==================================================================
[   25.327038] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x1a3/0x360
[   25.327340] Write of size 33 at addr ffff888105847b00 by task kunit_try_catch/234
[   25.327873] 
[   25.327980] CPU: 0 UID: 0 PID: 234 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5-next-20250710 #1 PREEMPT(voluntary) 
[   25.328029] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.328041] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   25.328063] Call Trace:
[   25.328076]  <TASK>
[   25.328094]  dump_stack_lvl+0x73/0xb0
[   25.328122]  print_report+0xd1/0x610
[   25.328145]  ? __virt_addr_valid+0x1db/0x2d0
[   25.328169]  ? kmalloc_uaf_memset+0x1a3/0x360
[   25.328189]  ? kasan_complete_mode_report_info+0x64/0x200
[   25.328214]  ? kmalloc_uaf_memset+0x1a3/0x360
[   25.328235]  kasan_report+0x141/0x180
[   25.328256]  ? kmalloc_uaf_memset+0x1a3/0x360
[   25.328281]  kasan_check_range+0x10c/0x1c0
[   25.328303]  __asan_memset+0x27/0x50
[   25.328326]  kmalloc_uaf_memset+0x1a3/0x360
[   25.328346]  ? __pfx_kmalloc_uaf_memset+0x10/0x10
[   25.328368]  ? __schedule+0x10cc/0x2b60
[   25.328390]  ? __pfx_read_tsc+0x10/0x10
[   25.328411]  ? ktime_get_ts64+0x86/0x230
[   25.328435]  kunit_try_run_case+0x1a5/0x480
[   25.328457]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.328477]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   25.328500]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   25.328522]  ? __kthread_parkme+0x82/0x180
[   25.328600]  ? preempt_count_sub+0x50/0x80
[   25.328624]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.328646]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.328670]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   25.328694]  kthread+0x337/0x6f0
[   25.328740]  ? trace_preempt_on+0x20/0xc0
[   25.328763]  ? __pfx_kthread+0x10/0x10
[   25.328831]  ? _raw_spin_unlock_irq+0x47/0x80
[   25.328853]  ? calculate_sigpending+0x7b/0xa0
[   25.328877]  ? __pfx_kthread+0x10/0x10
[   25.328898]  ret_from_fork+0x116/0x1d0
[   25.328918]  ? __pfx_kthread+0x10/0x10
[   25.328938]  ret_from_fork_asm+0x1a/0x30
[   25.328969]  </TASK>
[   25.328981] 
[   25.335861] Allocated by task 234:
[   25.336097]  kasan_save_stack+0x45/0x70
[   25.336302]  kasan_save_track+0x18/0x40
[   25.336485]  kasan_save_alloc_info+0x3b/0x50
[   25.336995]  __kasan_kmalloc+0xb7/0xc0
[   25.337169]  __kmalloc_cache_noprof+0x189/0x420
[   25.337379]  kmalloc_uaf_memset+0xa9/0x360
[   25.337590]  kunit_try_run_case+0x1a5/0x480
[   25.337741]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.337913]  kthread+0x337/0x6f0
[   25.338096]  ret_from_fork+0x116/0x1d0
[   25.338283]  ret_from_fork_asm+0x1a/0x30
[   25.338474] 
[   25.338563] Freed by task 234:
[   25.338728]  kasan_save_stack+0x45/0x70
[   25.338913]  kasan_save_track+0x18/0x40
[   25.339043]  kasan_save_free_info+0x3f/0x60
[   25.339184]  __kasan_slab_free+0x56/0x70
[   25.339317]  kfree+0x222/0x3f0
[   25.339603]  kmalloc_uaf_memset+0x12b/0x360
[   25.340072]  kunit_try_run_case+0x1a5/0x480
[   25.340305]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.340663]  kthread+0x337/0x6f0
[   25.340854]  ret_from_fork+0x116/0x1d0
[   25.341069]  ret_from_fork_asm+0x1a/0x30
[   25.341243] 
[   25.341310] The buggy address belongs to the object at ffff888105847b00
[   25.341310]  which belongs to the cache kmalloc-64 of size 64
[   25.341744] The buggy address is located 0 bytes inside of
[   25.341744]  freed 64-byte region [ffff888105847b00, ffff888105847b40)
[   25.342323] 
[   25.342420] The buggy address belongs to the physical page:
[   25.342611] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105847
[   25.342860] flags: 0x200000000000000(node=0|zone=2)
[   25.343021] page_type: f5(slab)
[   25.343140] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   25.343863] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   25.344204] page dumped because: kasan: bad access detected
[   25.344449] 
[   25.344575] Memory state around the buggy address:
[   25.344742]  ffff888105847a00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   25.345270]  ffff888105847a80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   25.345615] >ffff888105847b00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   25.346082]                    ^
[   25.346232]  ffff888105847b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.346510]  ffff888105847c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.346831] ==================================================================