Hay
Date
July 19, 2025, 11:12 p.m.

Environment
qemu-arm64
qemu-x86_64

[   15.329504] ==================================================================
[   15.329626] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x170/0x310
[   15.329678] Write of size 33 at addr fff00000c77cb800 by task kunit_try_catch/186
[   15.329817] 
[   15.329994] CPU: 1 UID: 0 PID: 186 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   15.330097] Tainted: [B]=BAD_PAGE, [N]=TEST
[   15.330171] Hardware name: linux,dummy-virt (DT)
[   15.330210] Call trace:
[   15.330260]  show_stack+0x20/0x38 (C)
[   15.330312]  dump_stack_lvl+0x8c/0xd0
[   15.330388]  print_report+0x118/0x5d0
[   15.330453]  kasan_report+0xdc/0x128
[   15.330501]  kasan_check_range+0x100/0x1a8
[   15.330549]  __asan_memset+0x34/0x78
[   15.330726]  kmalloc_uaf_memset+0x170/0x310
[   15.330882]  kunit_try_run_case+0x170/0x3f0
[   15.330966]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.331021]  kthread+0x328/0x630
[   15.331063]  ret_from_fork+0x10/0x20
[   15.331111] 
[   15.331135] Allocated by task 186:
[   15.331175]  kasan_save_stack+0x3c/0x68
[   15.331217]  kasan_save_track+0x20/0x40
[   15.331272]  kasan_save_alloc_info+0x40/0x58
[   15.331319]  __kasan_kmalloc+0xd4/0xd8
[   15.331459]  __kmalloc_cache_noprof+0x16c/0x3c0
[   15.331595]  kmalloc_uaf_memset+0xb8/0x310
[   15.331639]  kunit_try_run_case+0x170/0x3f0
[   15.331683]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.331766]  kthread+0x328/0x630
[   15.331830]  ret_from_fork+0x10/0x20
[   15.331953] 
[   15.331988] Freed by task 186:
[   15.332015]  kasan_save_stack+0x3c/0x68
[   15.332052]  kasan_save_track+0x20/0x40
[   15.332089]  kasan_save_free_info+0x4c/0x78
[   15.332424]  __kasan_slab_free+0x6c/0x98
[   15.332480]  kfree+0x214/0x3c8
[   15.332523]  kmalloc_uaf_memset+0x11c/0x310
[   15.332566]  kunit_try_run_case+0x170/0x3f0
[   15.332603]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.332646]  kthread+0x328/0x630
[   15.332677]  ret_from_fork+0x10/0x20
[   15.332724] 
[   15.332743] The buggy address belongs to the object at fff00000c77cb800
[   15.332743]  which belongs to the cache kmalloc-64 of size 64
[   15.332811] The buggy address is located 0 bytes inside of
[   15.332811]  freed 64-byte region [fff00000c77cb800, fff00000c77cb840)
[   15.332872] 
[   15.332895] The buggy address belongs to the physical page:
[   15.332925] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1077cb
[   15.332989] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   15.333046] page_type: f5(slab)
[   15.333100] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   15.333152] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   15.333211] page dumped because: kasan: bad access detected
[   15.333241] 
[   15.333269] Memory state around the buggy address:
[   15.333317]  fff00000c77cb700: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   15.333368]  fff00000c77cb780: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   15.333427] >fff00000c77cb800: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   15.333491]                    ^
[   15.333521]  fff00000c77cb880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.333575]  fff00000c77cb900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.333628] ==================================================================

[   12.303054] ==================================================================
[   12.303610] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x1a3/0x360
[   12.303886] Write of size 33 at addr ffff888102fd3180 by task kunit_try_catch/203
[   12.304181] 
[   12.304300] CPU: 0 UID: 0 PID: 203 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   12.304344] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.304355] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.304375] Call Trace:
[   12.304386]  <TASK>
[   12.304402]  dump_stack_lvl+0x73/0xb0
[   12.304521]  print_report+0xd1/0x610
[   12.304545]  ? __virt_addr_valid+0x1db/0x2d0
[   12.304568]  ? kmalloc_uaf_memset+0x1a3/0x360
[   12.304587]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.304608]  ? kmalloc_uaf_memset+0x1a3/0x360
[   12.304628]  kasan_report+0x141/0x180
[   12.304648]  ? kmalloc_uaf_memset+0x1a3/0x360
[   12.304674]  kasan_check_range+0x10c/0x1c0
[   12.304697]  __asan_memset+0x27/0x50
[   12.304716]  kmalloc_uaf_memset+0x1a3/0x360
[   12.304736]  ? __pfx_kmalloc_uaf_memset+0x10/0x10
[   12.304757]  ? __schedule+0x10cc/0x2b60
[   12.304780]  ? __pfx_read_tsc+0x10/0x10
[   12.304800]  ? ktime_get_ts64+0x86/0x230
[   12.304825]  kunit_try_run_case+0x1a5/0x480
[   12.304849]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.304870]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.304893]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.304915]  ? __kthread_parkme+0x82/0x180
[   12.304934]  ? preempt_count_sub+0x50/0x80
[   12.304957]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.304985]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.305019]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.305041]  kthread+0x337/0x6f0
[   12.305059]  ? trace_preempt_on+0x20/0xc0
[   12.305081]  ? __pfx_kthread+0x10/0x10
[   12.305101]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.305121]  ? calculate_sigpending+0x7b/0xa0
[   12.305144]  ? __pfx_kthread+0x10/0x10
[   12.305164]  ret_from_fork+0x116/0x1d0
[   12.305181]  ? __pfx_kthread+0x10/0x10
[   12.305200]  ret_from_fork_asm+0x1a/0x30
[   12.305230]  </TASK>
[   12.305240] 
[   12.312642] Allocated by task 203:
[   12.312798]  kasan_save_stack+0x45/0x70
[   12.312984]  kasan_save_track+0x18/0x40
[   12.313171]  kasan_save_alloc_info+0x3b/0x50
[   12.313318]  __kasan_kmalloc+0xb7/0xc0
[   12.313761]  __kmalloc_cache_noprof+0x189/0x420
[   12.313992]  kmalloc_uaf_memset+0xa9/0x360
[   12.314143]  kunit_try_run_case+0x1a5/0x480
[   12.314289]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.314666]  kthread+0x337/0x6f0
[   12.314839]  ret_from_fork+0x116/0x1d0
[   12.315040]  ret_from_fork_asm+0x1a/0x30
[   12.315235] 
[   12.315332] Freed by task 203:
[   12.315569]  kasan_save_stack+0x45/0x70
[   12.315757]  kasan_save_track+0x18/0x40
[   12.315932]  kasan_save_free_info+0x3f/0x60
[   12.316133]  __kasan_slab_free+0x56/0x70
[   12.316334]  kfree+0x222/0x3f0
[   12.316701]  kmalloc_uaf_memset+0x12b/0x360
[   12.317499]  kunit_try_run_case+0x1a5/0x480
[   12.318159]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.318467]  kthread+0x337/0x6f0
[   12.318617]  ret_from_fork+0x116/0x1d0
[   12.318791]  ret_from_fork_asm+0x1a/0x30
[   12.318956] 
[   12.319064] The buggy address belongs to the object at ffff888102fd3180
[   12.319064]  which belongs to the cache kmalloc-64 of size 64
[   12.319725] The buggy address is located 0 bytes inside of
[   12.319725]  freed 64-byte region [ffff888102fd3180, ffff888102fd31c0)
[   12.320177] 
[   12.320277] The buggy address belongs to the physical page:
[   12.320540] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102fd3
[   12.321391] flags: 0x200000000000000(node=0|zone=2)
[   12.321564] page_type: f5(slab)
[   12.321687] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   12.321919] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   12.322904] page dumped because: kasan: bad access detected
[   12.323129] 
[   12.323288] Memory state around the buggy address:
[   12.323882]  ffff888102fd3080: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   12.324499]  ffff888102fd3100: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   12.325291] >ffff888102fd3180: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   12.325514]                    ^
[   12.325630]  ffff888102fd3200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.325843]  ffff888102fd3280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.326070] ==================================================================