Hay
Date
July 18, 2025, 1:09 p.m.

Environment
qemu-arm64
qemu-x86_64

[   31.653119] ==================================================================
[   31.653192] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x170/0x310
[   31.653390] Write of size 33 at addr fff00000c9a42280 by task kunit_try_catch/217
[   31.653452] 
[   31.653520] CPU: 0 UID: 0 PID: 217 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6-next-20250718 #1 PREEMPT 
[   31.653613] Tainted: [B]=BAD_PAGE, [N]=TEST
[   31.653939] Hardware name: linux,dummy-virt (DT)
[   31.653989] Call trace:
[   31.654112]  show_stack+0x20/0x38 (C)
[   31.654198]  dump_stack_lvl+0x8c/0xd0
[   31.654249]  print_report+0x118/0x5e8
[   31.654553]  kasan_report+0xdc/0x128
[   31.654607]  kasan_check_range+0x100/0x1a8
[   31.654654]  __asan_memset+0x34/0x78
[   31.654697]  kmalloc_uaf_memset+0x170/0x310
[   31.655060]  kunit_try_run_case+0x170/0x3f0
[   31.655167]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.655264]  kthread+0x328/0x630
[   31.655307]  ret_from_fork+0x10/0x20
[   31.655498] 
[   31.655517] Allocated by task 217:
[   31.655546]  kasan_save_stack+0x3c/0x68
[   31.655753]  kasan_save_track+0x20/0x40
[   31.655813]  kasan_save_alloc_info+0x40/0x58
[   31.655852]  __kasan_kmalloc+0xd4/0xd8
[   31.655892]  __kmalloc_cache_noprof+0x16c/0x3c0
[   31.655932]  kmalloc_uaf_memset+0xb8/0x310
[   31.655968]  kunit_try_run_case+0x170/0x3f0
[   31.656005]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.656389]  kthread+0x328/0x630
[   31.656475]  ret_from_fork+0x10/0x20
[   31.656513] 
[   31.656569] Freed by task 217:
[   31.656882]  kasan_save_stack+0x3c/0x68
[   31.657113]  kasan_save_track+0x20/0x40
[   31.657332]  kasan_save_free_info+0x4c/0x78
[   31.657663]  __kasan_slab_free+0x6c/0x98
[   31.657736]  kfree+0x214/0x3c8
[   31.657786]  kmalloc_uaf_memset+0x11c/0x310
[   31.657943]  kunit_try_run_case+0x170/0x3f0
[   31.658103]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.658198]  kthread+0x328/0x630
[   31.658335]  ret_from_fork+0x10/0x20
[   31.658375] 
[   31.658411] The buggy address belongs to the object at fff00000c9a42280
[   31.658411]  which belongs to the cache kmalloc-64 of size 64
[   31.658478] The buggy address is located 0 bytes inside of
[   31.658478]  freed 64-byte region [fff00000c9a42280, fff00000c9a422c0)
[   31.658539] 
[   31.658671] The buggy address belongs to the physical page:
[   31.658725] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109a42
[   31.658779] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   31.658829] page_type: f5(slab)
[   31.658879] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   31.658927] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   31.658978] page dumped because: kasan: bad access detected
[   31.659016] 
[   31.659042] Memory state around the buggy address:
[   31.659088]  fff00000c9a42180: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   31.659132]  fff00000c9a42200: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   31.659174] >fff00000c9a42280: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   31.659210]                    ^
[   31.659237]  fff00000c9a42300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.659279]  fff00000c9a42380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.659318] ==================================================================


[   25.095168] ==================================================================
[   25.096262] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x1a3/0x360
[   25.097172] Write of size 33 at addr ffff888102b42780 by task kunit_try_catch/234
[   25.097422] 
[   25.097516] CPU: 1 UID: 0 PID: 234 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6-next-20250718 #1 PREEMPT(voluntary) 
[   25.097567] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.097579] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   25.097602] Call Trace:
[   25.097615]  <TASK>
[   25.097633]  dump_stack_lvl+0x73/0xb0
[   25.097669]  print_report+0xd1/0x640
[   25.097692]  ? __virt_addr_valid+0x1db/0x2d0
[   25.097718]  ? kmalloc_uaf_memset+0x1a3/0x360
[   25.097739]  ? kasan_complete_mode_report_info+0x64/0x200
[   25.097763]  ? kmalloc_uaf_memset+0x1a3/0x360
[   25.097784]  kasan_report+0x141/0x180
[   25.097805]  ? kmalloc_uaf_memset+0x1a3/0x360
[   25.097830]  kasan_check_range+0x10c/0x1c0
[   25.097852]  __asan_memset+0x27/0x50
[   25.097874]  kmalloc_uaf_memset+0x1a3/0x360
[   25.097893]  ? __pfx_kmalloc_uaf_memset+0x10/0x10
[   25.097914]  ? __schedule+0x10da/0x2b60
[   25.097938]  ? __pfx_read_tsc+0x10/0x10
[   25.097959]  ? ktime_get_ts64+0x86/0x230
[   25.097985]  kunit_try_run_case+0x1a5/0x480
[   25.098010]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.098031]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   25.098063]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   25.098095]  ? __kthread_parkme+0x82/0x180
[   25.098115]  ? preempt_count_sub+0x50/0x80
[   25.098138]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.098160]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.098182]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   25.098214]  kthread+0x337/0x6f0
[   25.098232]  ? trace_preempt_on+0x20/0xc0
[   25.098256]  ? __pfx_kthread+0x10/0x10
[   25.098275]  ? _raw_spin_unlock_irq+0x47/0x80
[   25.098304]  ? calculate_sigpending+0x7b/0xa0
[   25.098328]  ? __pfx_kthread+0x10/0x10
[   25.098348]  ret_from_fork+0x116/0x1d0
[   25.098366]  ? __pfx_kthread+0x10/0x10
[   25.098385]  ret_from_fork_asm+0x1a/0x30
[   25.098416]  </TASK>
[   25.098427] 
[   25.113671] Allocated by task 234:
[   25.113925]  kasan_save_stack+0x45/0x70
[   25.114730]  kasan_save_track+0x18/0x40
[   25.115255]  kasan_save_alloc_info+0x3b/0x50
[   25.115845]  __kasan_kmalloc+0xb7/0xc0
[   25.116406]  __kmalloc_cache_noprof+0x189/0x420
[   25.116921]  kmalloc_uaf_memset+0xa9/0x360
[   25.117573]  kunit_try_run_case+0x1a5/0x480
[   25.118134]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.118910]  kthread+0x337/0x6f0
[   25.119234]  ret_from_fork+0x116/0x1d0
[   25.119369]  ret_from_fork_asm+0x1a/0x30
[   25.119503] 
[   25.119568] Freed by task 234:
[   25.119674]  kasan_save_stack+0x45/0x70
[   25.119808]  kasan_save_track+0x18/0x40
[   25.120328]  kasan_save_free_info+0x3f/0x60
[   25.120479]  __kasan_slab_free+0x56/0x70
[   25.120605]  kfree+0x222/0x3f0
[   25.120713]  kmalloc_uaf_memset+0x12b/0x360
[   25.120879]  kunit_try_run_case+0x1a5/0x480
[   25.121019]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.121380]  kthread+0x337/0x6f0
[   25.121547]  ret_from_fork+0x116/0x1d0
[   25.121676]  ret_from_fork_asm+0x1a/0x30
[   25.121844] 
[   25.122015] The buggy address belongs to the object at ffff888102b42780
[   25.122015]  which belongs to the cache kmalloc-64 of size 64
[   25.122608] The buggy address is located 0 bytes inside of
[   25.122608]  freed 64-byte region [ffff888102b42780, ffff888102b427c0)
[   25.123322] 
[   25.123397] The buggy address belongs to the physical page:
[   25.123566] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102b42
[   25.123901] flags: 0x200000000000000(node=0|zone=2)
[   25.124374] page_type: f5(slab)
[   25.124707] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   25.125577] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   25.126337] page dumped because: kasan: bad access detected
[   25.126924] 
[   25.127172] Memory state around the buggy address:
[   25.127710]  ffff888102b42680: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   25.128172]  ffff888102b42700: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   25.128404] >ffff888102b42780: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   25.128623]                    ^
[   25.128736]  ffff888102b42800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.129472]  ffff888102b42880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.130175] ==================================================================