Hay
Date
July 16, 2025, 3:10 p.m.

Environment
qemu-arm64
qemu-x86_64

[   16.760903] ==================================================================
[   16.760966] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x170/0x310
[   16.761017] Write of size 33 at addr fff00000c6adf700 by task kunit_try_catch/186
[   16.761070] 
[   16.761100] CPU: 1 UID: 0 PID: 186 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   16.761185] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.761212] Hardware name: linux,dummy-virt (DT)
[   16.761243] Call trace:
[   16.761264]  show_stack+0x20/0x38 (C)
[   16.761313]  dump_stack_lvl+0x8c/0xd0
[   16.761362]  print_report+0x118/0x5d0
[   16.761410]  kasan_report+0xdc/0x128
[   16.761457]  kasan_check_range+0x100/0x1a8
[   16.761506]  __asan_memset+0x34/0x78
[   16.761548]  kmalloc_uaf_memset+0x170/0x310
[   16.761594]  kunit_try_run_case+0x170/0x3f0
[   16.761642]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.761694]  kthread+0x328/0x630
[   16.761977]  ret_from_fork+0x10/0x20
[   16.762029] 
[   16.762046] Allocated by task 186:
[   16.762074]  kasan_save_stack+0x3c/0x68
[   16.762117]  kasan_save_track+0x20/0x40
[   16.762154]  kasan_save_alloc_info+0x40/0x58
[   16.762195]  __kasan_kmalloc+0xd4/0xd8
[   16.762271]  __kmalloc_cache_noprof+0x16c/0x3c0
[   16.762312]  kmalloc_uaf_memset+0xb8/0x310
[   16.762349]  kunit_try_run_case+0x170/0x3f0
[   16.762386]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.762440]  kthread+0x328/0x630
[   16.762472]  ret_from_fork+0x10/0x20
[   16.762515] 
[   16.762533] Freed by task 186:
[   16.762561]  kasan_save_stack+0x3c/0x68
[   16.762597]  kasan_save_track+0x20/0x40
[   16.762634]  kasan_save_free_info+0x4c/0x78
[   16.762675]  __kasan_slab_free+0x6c/0x98
[   16.762733]  kfree+0x214/0x3c8
[   16.762773]  kmalloc_uaf_memset+0x11c/0x310
[   16.762809]  kunit_try_run_case+0x170/0x3f0
[   16.762846]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.762891]  kthread+0x328/0x630
[   16.762932]  ret_from_fork+0x10/0x20
[   16.762983] 
[   16.763001] The buggy address belongs to the object at fff00000c6adf700
[   16.763001]  which belongs to the cache kmalloc-64 of size 64
[   16.763069] The buggy address is located 0 bytes inside of
[   16.763069]  freed 64-byte region [fff00000c6adf700, fff00000c6adf740)
[   16.763132] 
[   16.763150] The buggy address belongs to the physical page:
[   16.763204] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106adf
[   16.763260] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   16.763311] page_type: f5(slab)
[   16.763358] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   16.763423] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   16.763466] page dumped because: kasan: bad access detected
[   16.763498] 
[   16.763517] Memory state around the buggy address:
[   16.763561]  fff00000c6adf600: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   16.763610]  fff00000c6adf680: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   16.763659] >fff00000c6adf700: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   16.763697]                    ^
[   16.763734]  fff00000c6adf780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.763776]  fff00000c6adf800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.763814] ==================================================================

[   12.849601] ==================================================================
[   12.850042] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x1a3/0x360
[   12.850356] Write of size 33 at addr ffff888103084480 by task kunit_try_catch/203
[   12.850679] 
[   12.850779] CPU: 1 UID: 0 PID: 203 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   12.850823] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.850835] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.850855] Call Trace:
[   12.850867]  <TASK>
[   12.850883]  dump_stack_lvl+0x73/0xb0
[   12.850913]  print_report+0xd1/0x610
[   12.850935]  ? __virt_addr_valid+0x1db/0x2d0
[   12.850958]  ? kmalloc_uaf_memset+0x1a3/0x360
[   12.850977]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.850999]  ? kmalloc_uaf_memset+0x1a3/0x360
[   12.851019]  kasan_report+0x141/0x180
[   12.851040]  ? kmalloc_uaf_memset+0x1a3/0x360
[   12.851066]  kasan_check_range+0x10c/0x1c0
[   12.851089]  __asan_memset+0x27/0x50
[   12.851107]  kmalloc_uaf_memset+0x1a3/0x360
[   12.851127]  ? __pfx_kmalloc_uaf_memset+0x10/0x10
[   12.851148]  ? __schedule+0x10cc/0x2b60
[   12.851170]  ? __pfx_read_tsc+0x10/0x10
[   12.851194]  ? ktime_get_ts64+0x86/0x230
[   12.851218]  kunit_try_run_case+0x1a5/0x480
[   12.851242]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.851264]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.851288]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.851310]  ? __kthread_parkme+0x82/0x180
[   12.851331]  ? preempt_count_sub+0x50/0x80
[   12.851354]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.851377]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.851400]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.851423]  kthread+0x337/0x6f0
[   12.851441]  ? trace_preempt_on+0x20/0xc0
[   12.851465]  ? __pfx_kthread+0x10/0x10
[   12.851484]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.851505]  ? calculate_sigpending+0x7b/0xa0
[   12.851528]  ? __pfx_kthread+0x10/0x10
[   12.851548]  ret_from_fork+0x116/0x1d0
[   12.851566]  ? __pfx_kthread+0x10/0x10
[   12.851586]  ret_from_fork_asm+0x1a/0x30
[   12.851616]  </TASK>
[   12.851626] 
[   12.863902] Allocated by task 203:
[   12.864159]  kasan_save_stack+0x45/0x70
[   12.864499]  kasan_save_track+0x18/0x40
[   12.864844]  kasan_save_alloc_info+0x3b/0x50
[   12.865242]  __kasan_kmalloc+0xb7/0xc0
[   12.865543]  __kmalloc_cache_noprof+0x189/0x420
[   12.865892]  kmalloc_uaf_memset+0xa9/0x360
[   12.866399]  kunit_try_run_case+0x1a5/0x480
[   12.866737]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.867160]  kthread+0x337/0x6f0
[   12.867467]  ret_from_fork+0x116/0x1d0
[   12.867763]  ret_from_fork_asm+0x1a/0x30
[   12.868070] 
[   12.868171] Freed by task 203:
[   12.868342]  kasan_save_stack+0x45/0x70
[   12.868525]  kasan_save_track+0x18/0x40
[   12.868689]  kasan_save_free_info+0x3f/0x60
[   12.869317]  __kasan_slab_free+0x56/0x70
[   12.869634]  kfree+0x222/0x3f0
[   12.870064]  kmalloc_uaf_memset+0x12b/0x360
[   12.870271]  kunit_try_run_case+0x1a5/0x480
[   12.870578]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.871248]  kthread+0x337/0x6f0
[   12.871449]  ret_from_fork+0x116/0x1d0
[   12.871712]  ret_from_fork_asm+0x1a/0x30
[   12.872083] 
[   12.872294] The buggy address belongs to the object at ffff888103084480
[   12.872294]  which belongs to the cache kmalloc-64 of size 64
[   12.873070] The buggy address is located 0 bytes inside of
[   12.873070]  freed 64-byte region [ffff888103084480, ffff8881030844c0)
[   12.873577] 
[   12.873677] The buggy address belongs to the physical page:
[   12.874287] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103084
[   12.874810] flags: 0x200000000000000(node=0|zone=2)
[   12.875239] page_type: f5(slab)
[   12.875522] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   12.876269] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   12.876575] page dumped because: kasan: bad access detected
[   12.876951] 
[   12.877234] Memory state around the buggy address:
[   12.877500]  ffff888103084380: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   12.877819]  ffff888103084400: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   12.878100] >ffff888103084480: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   12.878426]                    ^
[   12.878583]  ffff888103084500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.879337]  ffff888103084580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.879945] ==================================================================