Hay
Date
July 9, 2025, 11:07 p.m.

Environment
qemu-arm64
qemu-x86_64

[   16.882294] ==================================================================
[   16.882368] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x300/0x338
[   16.882423] Read of size 1 at addr fff00000c61bc468 by task kunit_try_catch/184
[   16.882571] 
[   16.882691] CPU: 1 UID: 0 PID: 184 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   16.882803] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.882839] Hardware name: linux,dummy-virt (DT)
[   16.882880] Call trace:
[   16.882919]  show_stack+0x20/0x38 (C)
[   16.882986]  dump_stack_lvl+0x8c/0xd0
[   16.883070]  print_report+0x118/0x608
[   16.883168]  kasan_report+0xdc/0x128
[   16.883233]  __asan_report_load1_noabort+0x20/0x30
[   16.883294]  kmalloc_uaf+0x300/0x338
[   16.883360]  kunit_try_run_case+0x170/0x3f0
[   16.883408]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.883460]  kthread+0x328/0x630
[   16.883501]  ret_from_fork+0x10/0x20
[   16.883550] 
[   16.883568] Allocated by task 184:
[   16.883597]  kasan_save_stack+0x3c/0x68
[   16.883636]  kasan_save_track+0x20/0x40
[   16.883682]  kasan_save_alloc_info+0x40/0x58
[   16.883773]  __kasan_kmalloc+0xd4/0xd8
[   16.883820]  __kmalloc_cache_noprof+0x16c/0x3c0
[   16.883885]  kmalloc_uaf+0xb8/0x338
[   16.883951]  kunit_try_run_case+0x170/0x3f0
[   16.884029]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.884124]  kthread+0x328/0x630
[   16.884206]  ret_from_fork+0x10/0x20
[   16.884292] 
[   16.884335] Freed by task 184:
[   16.884373]  kasan_save_stack+0x3c/0x68
[   16.884409]  kasan_save_track+0x20/0x40
[   16.884446]  kasan_save_free_info+0x4c/0x78
[   16.884747]  __kasan_slab_free+0x6c/0x98
[   16.884893]  kfree+0x214/0x3c8
[   16.884973]  kmalloc_uaf+0x11c/0x338
[   16.885050]  kunit_try_run_case+0x170/0x3f0
[   16.885142]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.885224]  kthread+0x328/0x630
[   16.885295]  ret_from_fork+0x10/0x20
[   16.885342] 
[   16.885361] The buggy address belongs to the object at fff00000c61bc460
[   16.885361]  which belongs to the cache kmalloc-16 of size 16
[   16.885692] The buggy address is located 8 bytes inside of
[   16.885692]  freed 16-byte region [fff00000c61bc460, fff00000c61bc470)
[   16.885822] 
[   16.885870] The buggy address belongs to the physical page:
[   16.885913] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1061bc
[   16.885975] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   16.886041] page_type: f5(slab)
[   16.886096] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   16.886224] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   16.886266] page dumped because: kasan: bad access detected
[   16.886297] 
[   16.886342] Memory state around the buggy address:
[   16.886615]  fff00000c61bc300: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   16.886748]  fff00000c61bc380: fa fb fc fc 00 04 fc fc fa fb fc fc fa fb fc fc
[   16.886825] >fff00000c61bc400: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   16.886878]                                                           ^
[   16.886952]  fff00000c61bc480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.887005]  fff00000c61bc500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.887070] ==================================================================

[   12.808353] ==================================================================
[   12.808802] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x320/0x380
[   12.809085] Read of size 1 at addr ffff8881031eb028 by task kunit_try_catch/201
[   12.809972] 
[   12.810305] CPU: 0 UID: 0 PID: 201 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   12.810355] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.810367] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.810389] Call Trace:
[   12.810402]  <TASK>
[   12.810420]  dump_stack_lvl+0x73/0xb0
[   12.810453]  print_report+0xd1/0x650
[   12.810475]  ? __virt_addr_valid+0x1db/0x2d0
[   12.810499]  ? kmalloc_uaf+0x320/0x380
[   12.810518]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.810541]  ? kmalloc_uaf+0x320/0x380
[   12.810560]  kasan_report+0x141/0x180
[   12.810581]  ? kmalloc_uaf+0x320/0x380
[   12.810604]  __asan_report_load1_noabort+0x18/0x20
[   12.810629]  kmalloc_uaf+0x320/0x380
[   12.810648]  ? __pfx_kmalloc_uaf+0x10/0x10
[   12.810668]  ? __schedule+0x10cc/0x2b60
[   12.810690]  ? __pfx_read_tsc+0x10/0x10
[   12.810726]  ? ktime_get_ts64+0x86/0x230
[   12.810774]  kunit_try_run_case+0x1a5/0x480
[   12.810798]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.810821]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.810846]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.810869]  ? __kthread_parkme+0x82/0x180
[   12.810890]  ? preempt_count_sub+0x50/0x80
[   12.810913]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.810937]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.810961]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.810986]  kthread+0x337/0x6f0
[   12.811004]  ? trace_preempt_on+0x20/0xc0
[   12.811111]  ? __pfx_kthread+0x10/0x10
[   12.811131]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.811153]  ? calculate_sigpending+0x7b/0xa0
[   12.811177]  ? __pfx_kthread+0x10/0x10
[   12.811198]  ret_from_fork+0x116/0x1d0
[   12.811216]  ? __pfx_kthread+0x10/0x10
[   12.811236]  ret_from_fork_asm+0x1a/0x30
[   12.811268]  </TASK>
[   12.811278] 
[   12.819479] Allocated by task 201:
[   12.819654]  kasan_save_stack+0x45/0x70
[   12.819954]  kasan_save_track+0x18/0x40
[   12.820168]  kasan_save_alloc_info+0x3b/0x50
[   12.820388]  __kasan_kmalloc+0xb7/0xc0
[   12.820600]  __kmalloc_cache_noprof+0x189/0x420
[   12.820850]  kmalloc_uaf+0xaa/0x380
[   12.821164]  kunit_try_run_case+0x1a5/0x480
[   12.821399]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.821608]  kthread+0x337/0x6f0
[   12.821737]  ret_from_fork+0x116/0x1d0
[   12.821869]  ret_from_fork_asm+0x1a/0x30
[   12.822165] 
[   12.822262] Freed by task 201:
[   12.822419]  kasan_save_stack+0x45/0x70
[   12.822609]  kasan_save_track+0x18/0x40
[   12.822809]  kasan_save_free_info+0x3f/0x60
[   12.822987]  __kasan_slab_free+0x56/0x70
[   12.823238]  kfree+0x222/0x3f0
[   12.823357]  kmalloc_uaf+0x12c/0x380
[   12.823484]  kunit_try_run_case+0x1a5/0x480
[   12.823720]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.823970]  kthread+0x337/0x6f0
[   12.824214]  ret_from_fork+0x116/0x1d0
[   12.824423]  ret_from_fork_asm+0x1a/0x30
[   12.824584] 
[   12.824654] The buggy address belongs to the object at ffff8881031eb020
[   12.824654]  which belongs to the cache kmalloc-16 of size 16
[   12.825279] The buggy address is located 8 bytes inside of
[   12.825279]  freed 16-byte region [ffff8881031eb020, ffff8881031eb030)
[   12.825693] 
[   12.825824] The buggy address belongs to the physical page:
[   12.826156] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1031eb
[   12.826474] flags: 0x200000000000000(node=0|zone=2)
[   12.826637] page_type: f5(slab)
[   12.826768] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   12.827204] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   12.827560] page dumped because: kasan: bad access detected
[   12.827823] 
[   12.827892] Memory state around the buggy address:
[   12.828204]  ffff8881031eaf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.828492]  ffff8881031eaf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.828759] >ffff8881031eb000: fa fb fc fc fa fb fc fc fc fc fc fc fc fc fc fc
[   12.829164]                                   ^
[   12.829386]  ffff8881031eb080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.829716]  ffff8881031eb100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.829947] ==================================================================