Hay
Date
July 10, 2025, 6:10 p.m.

Environment
qemu-arm64
qemu-x86_64

[   17.037448] ==================================================================
[   17.037519] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x170/0x310
[   17.037627] Write of size 33 at addr fff00000c5a1de00 by task kunit_try_catch/186
[   17.037682] 
[   17.037716] CPU: 1 UID: 0 PID: 186 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   17.037928] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.038220] Hardware name: linux,dummy-virt (DT)
[   17.038291] Call trace:
[   17.038318]  show_stack+0x20/0x38 (C)
[   17.038686]  dump_stack_lvl+0x8c/0xd0
[   17.038924]  print_report+0x118/0x608
[   17.039020]  kasan_report+0xdc/0x128
[   17.039207]  kasan_check_range+0x100/0x1a8
[   17.039438]  __asan_memset+0x34/0x78
[   17.039551]  kmalloc_uaf_memset+0x170/0x310
[   17.039908]  kunit_try_run_case+0x170/0x3f0
[   17.040025]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.040207]  kthread+0x328/0x630
[   17.040254]  ret_from_fork+0x10/0x20
[   17.040497] 
[   17.040680] Allocated by task 186:
[   17.040718]  kasan_save_stack+0x3c/0x68
[   17.040981]  kasan_save_track+0x20/0x40
[   17.041161]  kasan_save_alloc_info+0x40/0x58
[   17.041275]  __kasan_kmalloc+0xd4/0xd8
[   17.041319]  __kmalloc_cache_noprof+0x16c/0x3c0
[   17.041391]  kmalloc_uaf_memset+0xb8/0x310
[   17.041429]  kunit_try_run_case+0x170/0x3f0
[   17.041476]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.041530]  kthread+0x328/0x630
[   17.041562]  ret_from_fork+0x10/0x20
[   17.041604] 
[   17.041645] Freed by task 186:
[   17.041686]  kasan_save_stack+0x3c/0x68
[   17.041739]  kasan_save_track+0x20/0x40
[   17.041777]  kasan_save_free_info+0x4c/0x78
[   17.041817]  __kasan_slab_free+0x6c/0x98
[   17.041853]  kfree+0x214/0x3c8
[   17.041888]  kmalloc_uaf_memset+0x11c/0x310
[   17.042222]  kunit_try_run_case+0x170/0x3f0
[   17.042265]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.042310]  kthread+0x328/0x630
[   17.042355]  ret_from_fork+0x10/0x20
[   17.042392] 
[   17.042914] The buggy address belongs to the object at fff00000c5a1de00
[   17.042914]  which belongs to the cache kmalloc-64 of size 64
[   17.043355] The buggy address is located 0 bytes inside of
[   17.043355]  freed 64-byte region [fff00000c5a1de00, fff00000c5a1de40)
[   17.043434] 
[   17.043455] The buggy address belongs to the physical page:
[   17.043868] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105a1d
[   17.043935] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   17.044157] page_type: f5(slab)
[   17.044267] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   17.044498] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   17.044553] page dumped because: kasan: bad access detected
[   17.045021] 
[   17.045062] Memory state around the buggy address:
[   17.045098]  fff00000c5a1dd00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   17.045141]  fff00000c5a1dd80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   17.045362] >fff00000c5a1de00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   17.045545]                    ^
[   17.045601]  fff00000c5a1de80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.045667]  fff00000c5a1df00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.045723] ==================================================================

[   12.766552] ==================================================================
[   12.767013] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x1a3/0x360
[   12.767538] Write of size 33 at addr ffff888102798c80 by task kunit_try_catch/203
[   12.768074] 
[   12.768443] CPU: 1 UID: 0 PID: 203 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   12.768490] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.768605] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.768628] Call Trace:
[   12.768642]  <TASK>
[   12.768658]  dump_stack_lvl+0x73/0xb0
[   12.768689]  print_report+0xd1/0x650
[   12.768711]  ? __virt_addr_valid+0x1db/0x2d0
[   12.768735]  ? kmalloc_uaf_memset+0x1a3/0x360
[   12.768755]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.768778]  ? kmalloc_uaf_memset+0x1a3/0x360
[   12.768799]  kasan_report+0x141/0x180
[   12.768833]  ? kmalloc_uaf_memset+0x1a3/0x360
[   12.768859]  kasan_check_range+0x10c/0x1c0
[   12.768882]  __asan_memset+0x27/0x50
[   12.768901]  kmalloc_uaf_memset+0x1a3/0x360
[   12.768922]  ? __pfx_kmalloc_uaf_memset+0x10/0x10
[   12.768944]  ? __schedule+0x10cc/0x2b60
[   12.768966]  ? __pfx_read_tsc+0x10/0x10
[   12.768986]  ? ktime_get_ts64+0x86/0x230
[   12.769012]  kunit_try_run_case+0x1a5/0x480
[   12.769063]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.769086]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.769109]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.769132]  ? __kthread_parkme+0x82/0x180
[   12.769152]  ? preempt_count_sub+0x50/0x80
[   12.769176]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.769200]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.769223]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.769248]  kthread+0x337/0x6f0
[   12.769266]  ? trace_preempt_on+0x20/0xc0
[   12.769289]  ? __pfx_kthread+0x10/0x10
[   12.769310]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.769330]  ? calculate_sigpending+0x7b/0xa0
[   12.769354]  ? __pfx_kthread+0x10/0x10
[   12.769375]  ret_from_fork+0x116/0x1d0
[   12.769393]  ? __pfx_kthread+0x10/0x10
[   12.769413]  ret_from_fork_asm+0x1a/0x30
[   12.769443]  </TASK>
[   12.769453] 
[   12.780451] Allocated by task 203:
[   12.780643]  kasan_save_stack+0x45/0x70
[   12.781094]  kasan_save_track+0x18/0x40
[   12.781263]  kasan_save_alloc_info+0x3b/0x50
[   12.781473]  __kasan_kmalloc+0xb7/0xc0
[   12.781648]  __kmalloc_cache_noprof+0x189/0x420
[   12.782513]  kmalloc_uaf_memset+0xa9/0x360
[   12.782737]  kunit_try_run_case+0x1a5/0x480
[   12.782935]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.783184]  kthread+0x337/0x6f0
[   12.783342]  ret_from_fork+0x116/0x1d0
[   12.783510]  ret_from_fork_asm+0x1a/0x30
[   12.783682] 
[   12.783773] Freed by task 203:
[   12.783913]  kasan_save_stack+0x45/0x70
[   12.784187]  kasan_save_track+0x18/0x40
[   12.784537]  kasan_save_free_info+0x3f/0x60
[   12.784745]  __kasan_slab_free+0x56/0x70
[   12.784966]  kfree+0x222/0x3f0
[   12.785138]  kmalloc_uaf_memset+0x12b/0x360
[   12.785754]  kunit_try_run_case+0x1a5/0x480
[   12.786494]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.786773]  kthread+0x337/0x6f0
[   12.787501]  ret_from_fork+0x116/0x1d0
[   12.788236]  ret_from_fork_asm+0x1a/0x30
[   12.788462] 
[   12.788759] The buggy address belongs to the object at ffff888102798c80
[   12.788759]  which belongs to the cache kmalloc-64 of size 64
[   12.789315] The buggy address is located 0 bytes inside of
[   12.789315]  freed 64-byte region [ffff888102798c80, ffff888102798cc0)
[   12.789755] 
[   12.789876] The buggy address belongs to the physical page:
[   12.790854] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102798
[   12.791777] flags: 0x200000000000000(node=0|zone=2)
[   12.792441] page_type: f5(slab)
[   12.792942] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   12.793799] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   12.794677] page dumped because: kasan: bad access detected
[   12.795295] 
[   12.795464] Memory state around the buggy address:
[   12.795994]  ffff888102798b80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   12.796637]  ffff888102798c00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   12.796924] >ffff888102798c80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   12.798045]                    ^
[   12.798548]  ffff888102798d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.800223]  ffff888102798d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.800876] ==================================================================