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

Environment
qemu-arm64
qemu-x86_64

[   15.923310] ==================================================================
[   15.923453] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x3bc/0x438
[   15.923529] Read of size 16 at addr fff00000c5ff7a00 by task kunit_try_catch/168
[   15.923618] 
[   15.923669] CPU: 1 UID: 0 PID: 168 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   15.923849] Tainted: [B]=BAD_PAGE, [N]=TEST
[   15.923888] Hardware name: linux,dummy-virt (DT)
[   15.923926] Call trace:
[   15.923963]  show_stack+0x20/0x38 (C)
[   15.924203]  dump_stack_lvl+0x8c/0xd0
[   15.924275]  print_report+0x118/0x608
[   15.924333]  kasan_report+0xdc/0x128
[   15.924386]  __asan_report_load16_noabort+0x20/0x30
[   15.924470]  kmalloc_uaf_16+0x3bc/0x438
[   15.924527]  kunit_try_run_case+0x170/0x3f0
[   15.924583]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.924698]  kthread+0x328/0x630
[   15.924743]  ret_from_fork+0x10/0x20
[   15.924799] 
[   15.924863] Allocated by task 168:
[   15.924901]  kasan_save_stack+0x3c/0x68
[   15.924947]  kasan_save_track+0x20/0x40
[   15.924985]  kasan_save_alloc_info+0x40/0x58
[   15.925031]  __kasan_kmalloc+0xd4/0xd8
[   15.925067]  __kmalloc_cache_noprof+0x16c/0x3c0
[   15.925313]  kmalloc_uaf_16+0x140/0x438
[   15.925378]  kunit_try_run_case+0x170/0x3f0
[   15.925421]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.925496]  kthread+0x328/0x630
[   15.925548]  ret_from_fork+0x10/0x20
[   15.925583] 
[   15.925601] Freed by task 168:
[   15.925627]  kasan_save_stack+0x3c/0x68
[   15.925714]  kasan_save_track+0x20/0x40
[   15.925777]  kasan_save_free_info+0x4c/0x78
[   15.925847]  __kasan_slab_free+0x6c/0x98
[   15.926134]  kfree+0x214/0x3c8
[   15.926187]  kmalloc_uaf_16+0x190/0x438
[   15.926315]  kunit_try_run_case+0x170/0x3f0
[   15.926392]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.926483]  kthread+0x328/0x630
[   15.926545]  ret_from_fork+0x10/0x20
[   15.926593] 
[   15.926644] The buggy address belongs to the object at fff00000c5ff7a00
[   15.926644]  which belongs to the cache kmalloc-16 of size 16
[   15.926820] The buggy address is located 0 bytes inside of
[   15.926820]  freed 16-byte region [fff00000c5ff7a00, fff00000c5ff7a10)
[   15.926885] 
[   15.926992] The buggy address belongs to the physical page:
[   15.927052] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105ff7
[   15.927203] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   15.927282] page_type: f5(slab)
[   15.927416] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   15.927492] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   15.927611] page dumped because: kasan: bad access detected
[   15.927687] 
[   15.927723] Memory state around the buggy address:
[   15.927754]  fff00000c5ff7900: fa fb fc fc fa fb fc fc fa fb fc fc 00 04 fc fc
[   15.928064]  fff00000c5ff7980: fa fb fc fc fa fb fc fc fa fb fc fc 00 00 fc fc
[   15.928222] >fff00000c5ff7a00: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.928303]                    ^
[   15.928392]  fff00000c5ff7a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.928442]  fff00000c5ff7b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.928521] ==================================================================

[   12.728899] ==================================================================
[   12.729312] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x47b/0x4c0
[   12.729663] Read of size 16 at addr ffff888102749d80 by task kunit_try_catch/185
[   12.729954] 
[   12.730040] CPU: 0 UID: 0 PID: 185 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   12.730078] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.730090] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.730109] Call Trace:
[   12.730119]  <TASK>
[   12.730133]  dump_stack_lvl+0x73/0xb0
[   12.730162]  print_report+0xd1/0x650
[   12.730184]  ? __virt_addr_valid+0x1db/0x2d0
[   12.730206]  ? kmalloc_uaf_16+0x47b/0x4c0
[   12.730226]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.730248]  ? kmalloc_uaf_16+0x47b/0x4c0
[   12.730269]  kasan_report+0x141/0x180
[   12.730290]  ? kmalloc_uaf_16+0x47b/0x4c0
[   12.730315]  __asan_report_load16_noabort+0x18/0x20
[   12.730340]  kmalloc_uaf_16+0x47b/0x4c0
[   12.730370]  ? __pfx_kmalloc_uaf_16+0x10/0x10
[   12.730392]  ? __schedule+0x10cc/0x2b60
[   12.730413]  ? __pfx_read_tsc+0x10/0x10
[   12.730433]  ? ktime_get_ts64+0x86/0x230
[   12.730456]  kunit_try_run_case+0x1a5/0x480
[   12.730567]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.730593]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.730617]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.730640]  ? __kthread_parkme+0x82/0x180
[   12.730661]  ? preempt_count_sub+0x50/0x80
[   12.730684]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.730708]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.730733]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.730758]  kthread+0x337/0x6f0
[   12.730776]  ? trace_preempt_on+0x20/0xc0
[   12.730799]  ? __pfx_kthread+0x10/0x10
[   12.730819]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.730841]  ? calculate_sigpending+0x7b/0xa0
[   12.730864]  ? __pfx_kthread+0x10/0x10
[   12.730886]  ret_from_fork+0x116/0x1d0
[   12.730904]  ? __pfx_kthread+0x10/0x10
[   12.730924]  ret_from_fork_asm+0x1a/0x30
[   12.730954]  </TASK>
[   12.730964] 
[   12.737879] Allocated by task 185:
[   12.738030]  kasan_save_stack+0x45/0x70
[   12.738173]  kasan_save_track+0x18/0x40
[   12.738307]  kasan_save_alloc_info+0x3b/0x50
[   12.738745]  __kasan_kmalloc+0xb7/0xc0
[   12.738945]  __kmalloc_cache_noprof+0x189/0x420
[   12.739169]  kmalloc_uaf_16+0x15b/0x4c0
[   12.739384]  kunit_try_run_case+0x1a5/0x480
[   12.739601]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.739801]  kthread+0x337/0x6f0
[   12.739971]  ret_from_fork+0x116/0x1d0
[   12.740156]  ret_from_fork_asm+0x1a/0x30
[   12.740421] 
[   12.740505] Freed by task 185:
[   12.740659]  kasan_save_stack+0x45/0x70
[   12.740801]  kasan_save_track+0x18/0x40
[   12.740988]  kasan_save_free_info+0x3f/0x60
[   12.741193]  __kasan_slab_free+0x56/0x70
[   12.741453]  kfree+0x222/0x3f0
[   12.741594]  kmalloc_uaf_16+0x1d6/0x4c0
[   12.741747]  kunit_try_run_case+0x1a5/0x480
[   12.741951]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.742124]  kthread+0x337/0x6f0
[   12.742244]  ret_from_fork+0x116/0x1d0
[   12.742386]  ret_from_fork_asm+0x1a/0x30
[   12.742524] 
[   12.742592] The buggy address belongs to the object at ffff888102749d80
[   12.742592]  which belongs to the cache kmalloc-16 of size 16
[   12.743138] The buggy address is located 0 bytes inside of
[   12.743138]  freed 16-byte region [ffff888102749d80, ffff888102749d90)
[   12.743987] 
[   12.744085] The buggy address belongs to the physical page:
[   12.744314] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102749
[   12.744807] flags: 0x200000000000000(node=0|zone=2)
[   12.744973] page_type: f5(slab)
[   12.745092] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   12.745411] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   12.745760] page dumped because: kasan: bad access detected
[   12.746010] 
[   12.746101] Memory state around the buggy address:
[   12.746318]  ffff888102749c80: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   12.747080]  ffff888102749d00: 00 05 fc fc fa fb fc fc fa fb fc fc 00 00 fc fc
[   12.747389] >ffff888102749d80: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.747735]                    ^
[   12.747896]  ffff888102749e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.748170]  ffff888102749e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.748503] ==================================================================