Hay
Date
July 19, 2025, 11:11 a.m.

Environment
qemu-arm64
qemu-x86_64

[   15.410122] ==================================================================
[   15.410182] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x300/0x338
[   15.410247] Read of size 1 at addr fff00000c5f9c4a8 by task kunit_try_catch/185
[   15.411204] 
[   15.411303] CPU: 1 UID: 0 PID: 185 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   15.411486] Tainted: [B]=BAD_PAGE, [N]=TEST
[   15.411515] Hardware name: linux,dummy-virt (DT)
[   15.411556] Call trace:
[   15.411579]  show_stack+0x20/0x38 (C)
[   15.411626]  dump_stack_lvl+0x8c/0xd0
[   15.411672]  print_report+0x118/0x5d0
[   15.411718]  kasan_report+0xdc/0x128
[   15.411827]  __asan_report_load1_noabort+0x20/0x30
[   15.412097]  kmalloc_uaf+0x300/0x338
[   15.412317]  kunit_try_run_case+0x170/0x3f0
[   15.412688]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.414155]  kthread+0x328/0x630
[   15.414214]  ret_from_fork+0x10/0x20
[   15.414493] 
[   15.414543] Allocated by task 185:
[   15.414576]  kasan_save_stack+0x3c/0x68
[   15.414620]  kasan_save_track+0x20/0x40
[   15.414658]  kasan_save_alloc_info+0x40/0x58
[   15.414977]  __kasan_kmalloc+0xd4/0xd8
[   15.415895]  __kmalloc_cache_noprof+0x16c/0x3c0
[   15.416457]  kmalloc_uaf+0xb8/0x338
[   15.416507]  kunit_try_run_case+0x170/0x3f0
[   15.416913]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.416970]  kthread+0x328/0x630
[   15.417023]  ret_from_fork+0x10/0x20
[   15.417060] 
[   15.417146] Freed by task 185:
[   15.417230]  kasan_save_stack+0x3c/0x68
[   15.417267]  kasan_save_track+0x20/0x40
[   15.417484]  kasan_save_free_info+0x4c/0x78
[   15.417523]  __kasan_slab_free+0x6c/0x98
[   15.417579]  kfree+0x214/0x3c8
[   15.417639]  kmalloc_uaf+0x11c/0x338
[   15.417675]  kunit_try_run_case+0x170/0x3f0
[   15.417723]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.417766]  kthread+0x328/0x630
[   15.417873]  ret_from_fork+0x10/0x20
[   15.418226] 
[   15.418511] The buggy address belongs to the object at fff00000c5f9c4a0
[   15.418511]  which belongs to the cache kmalloc-16 of size 16
[   15.418588] The buggy address is located 8 bytes inside of
[   15.418588]  freed 16-byte region [fff00000c5f9c4a0, fff00000c5f9c4b0)
[   15.419020] 
[   15.419134] The buggy address belongs to the physical page:
[   15.419167] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105f9c
[   15.419225] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   15.419346] page_type: f5(slab)
[   15.419456] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   15.419507] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   15.419593] page dumped because: kasan: bad access detected
[   15.419827] 
[   15.420000] Memory state around the buggy address:
[   15.420036]  fff00000c5f9c380: fa fb fc fc fa fb fc fc fa fb fc fc 00 04 fc fc
[   15.420324]  fff00000c5f9c400: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   15.420462] >fff00000c5f9c480: fa fb fc fc fa fb fc fc fc fc fc fc fc fc fc fc
[   15.420556]                                   ^
[   15.420589]  fff00000c5f9c500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.420632]  fff00000c5f9c580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.420671] ==================================================================

[   12.327424] ==================================================================
[   12.327949] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x320/0x380
[   12.328488] Read of size 1 at addr ffff888101642a28 by task kunit_try_catch/202
[   12.328805] 
[   12.328920] CPU: 0 UID: 0 PID: 202 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   12.328987] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.328998] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.329018] Call Trace:
[   12.329030]  <TASK>
[   12.329046]  dump_stack_lvl+0x73/0xb0
[   12.329076]  print_report+0xd1/0x610
[   12.329098]  ? __virt_addr_valid+0x1db/0x2d0
[   12.329121]  ? kmalloc_uaf+0x320/0x380
[   12.329139]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.329235]  ? kmalloc_uaf+0x320/0x380
[   12.329257]  kasan_report+0x141/0x180
[   12.329278]  ? kmalloc_uaf+0x320/0x380
[   12.329301]  __asan_report_load1_noabort+0x18/0x20
[   12.329325]  kmalloc_uaf+0x320/0x380
[   12.329343]  ? __pfx_kmalloc_uaf+0x10/0x10
[   12.329362]  ? sysvec_apic_timer_interrupt+0x50/0x90
[   12.329388]  ? trace_hardirqs_on+0x37/0xe0
[   12.329412]  ? __pfx_read_tsc+0x10/0x10
[   12.329451]  ? ktime_get_ts64+0x86/0x230
[   12.329475]  kunit_try_run_case+0x1a5/0x480
[   12.329509]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.329533]  ? queued_spin_lock_slowpath+0x116/0xb40
[   12.329557]  ? __kthread_parkme+0x82/0x180
[   12.329577]  ? preempt_count_sub+0x50/0x80
[   12.329601]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.329624]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.329646]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.329670]  kthread+0x337/0x6f0
[   12.329688]  ? trace_preempt_on+0x20/0xc0
[   12.329727]  ? __pfx_kthread+0x10/0x10
[   12.329746]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.329767]  ? calculate_sigpending+0x7b/0xa0
[   12.329790]  ? __pfx_kthread+0x10/0x10
[   12.329811]  ret_from_fork+0x116/0x1d0
[   12.329829]  ? __pfx_kthread+0x10/0x10
[   12.329848]  ret_from_fork_asm+0x1a/0x30
[   12.329894]  </TASK>
[   12.329904] 
[   12.337625] Allocated by task 202:
[   12.337788]  kasan_save_stack+0x45/0x70
[   12.337932]  kasan_save_track+0x18/0x40
[   12.338064]  kasan_save_alloc_info+0x3b/0x50
[   12.338276]  __kasan_kmalloc+0xb7/0xc0
[   12.338456]  __kmalloc_cache_noprof+0x189/0x420
[   12.338683]  kmalloc_uaf+0xaa/0x380
[   12.338858]  kunit_try_run_case+0x1a5/0x480
[   12.339204]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.339467]  kthread+0x337/0x6f0
[   12.339611]  ret_from_fork+0x116/0x1d0
[   12.339740]  ret_from_fork_asm+0x1a/0x30
[   12.339930] 
[   12.340025] Freed by task 202:
[   12.340339]  kasan_save_stack+0x45/0x70
[   12.340554]  kasan_save_track+0x18/0x40
[   12.340725]  kasan_save_free_info+0x3f/0x60
[   12.340936]  __kasan_slab_free+0x56/0x70
[   12.341107]  kfree+0x222/0x3f0
[   12.341254]  kmalloc_uaf+0x12c/0x380
[   12.341451]  kunit_try_run_case+0x1a5/0x480
[   12.341812]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.342114]  kthread+0x337/0x6f0
[   12.342284]  ret_from_fork+0x116/0x1d0
[   12.342620]  ret_from_fork_asm+0x1a/0x30
[   12.342755] 
[   12.342822] The buggy address belongs to the object at ffff888101642a20
[   12.342822]  which belongs to the cache kmalloc-16 of size 16
[   12.343682] The buggy address is located 8 bytes inside of
[   12.343682]  freed 16-byte region [ffff888101642a20, ffff888101642a30)
[   12.344176] 
[   12.344336] The buggy address belongs to the physical page:
[   12.344725] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101642
[   12.345121] flags: 0x200000000000000(node=0|zone=2)
[   12.345295] page_type: f5(slab)
[   12.345418] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   12.345784] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   12.346200] page dumped because: kasan: bad access detected
[   12.346443] 
[   12.346521] Memory state around the buggy address:
[   12.346743]  ffff888101642900: 00 04 fc fc 00 01 fc fc 00 01 fc fc 00 04 fc fc
[   12.347077]  ffff888101642980: 00 04 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   12.347647] >ffff888101642a00: fa fb fc fc fa fb fc fc fc fc fc fc fc fc fc fc
[   12.347944]                                   ^
[   12.348307]  ffff888101642a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.348609]  ffff888101642b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.348927] ==================================================================