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

Environment
qemu-arm64
qemu-x86_64

[   18.142294] ==================================================================
[   18.142447] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x300/0x338
[   18.142549] Read of size 1 at addr fff00000c59fcc08 by task kunit_try_catch/184
[   18.142599] 
[   18.142631] CPU: 0 UID: 0 PID: 184 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   18.142856] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.142987] Hardware name: linux,dummy-virt (DT)
[   18.143050] Call trace:
[   18.143083]  show_stack+0x20/0x38 (C)
[   18.143134]  dump_stack_lvl+0x8c/0xd0
[   18.143446]  print_report+0x118/0x608
[   18.143520]  kasan_report+0xdc/0x128
[   18.143565]  __asan_report_load1_noabort+0x20/0x30
[   18.143812]  kmalloc_uaf+0x300/0x338
[   18.144039]  kunit_try_run_case+0x170/0x3f0
[   18.144104]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.144171]  kthread+0x328/0x630
[   18.144212]  ret_from_fork+0x10/0x20
[   18.144569] 
[   18.144680] Allocated by task 184:
[   18.144751]  kasan_save_stack+0x3c/0x68
[   18.145233]  kasan_save_track+0x20/0x40
[   18.145293]  kasan_save_alloc_info+0x40/0x58
[   18.145696]  __kasan_kmalloc+0xd4/0xd8
[   18.145841]  __kmalloc_cache_noprof+0x16c/0x3c0
[   18.146047]  kmalloc_uaf+0xb8/0x338
[   18.146231]  kunit_try_run_case+0x170/0x3f0
[   18.146314]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.146792]  kthread+0x328/0x630
[   18.146880]  ret_from_fork+0x10/0x20
[   18.146941] 
[   18.147106] Freed by task 184:
[   18.147210]  kasan_save_stack+0x3c/0x68
[   18.147471]  kasan_save_track+0x20/0x40
[   18.147560]  kasan_save_free_info+0x4c/0x78
[   18.147739]  __kasan_slab_free+0x6c/0x98
[   18.147866]  kfree+0x214/0x3c8
[   18.147949]  kmalloc_uaf+0x11c/0x338
[   18.148008]  kunit_try_run_case+0x170/0x3f0
[   18.148230]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.148461]  kthread+0x328/0x630
[   18.148554]  ret_from_fork+0x10/0x20
[   18.148592] 
[   18.148812] The buggy address belongs to the object at fff00000c59fcc00
[   18.148812]  which belongs to the cache kmalloc-16 of size 16
[   18.148972] The buggy address is located 8 bytes inside of
[   18.148972]  freed 16-byte region [fff00000c59fcc00, fff00000c59fcc10)
[   18.149036] 
[   18.149271] The buggy address belongs to the physical page:
[   18.149432] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1059fc
[   18.149498] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.149547] page_type: f5(slab)
[   18.149593] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   18.149642] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   18.149683] page dumped because: kasan: bad access detected
[   18.149714] 
[   18.149732] Memory state around the buggy address:
[   18.150171]  fff00000c59fcb00: fa fb fc fc fa fb fc fc 00 04 fc fc fa fb fc fc
[   18.150263]  fff00000c59fcb80: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   18.150455] >fff00000c59fcc00: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.150518]                       ^
[   18.150623]  fff00000c59fcc80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.150725]  fff00000c59fcd00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.151011] ==================================================================

[   13.841027] ==================================================================
[   13.841810] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x320/0x380
[   13.842172] Read of size 1 at addr ffff88810216f108 by task kunit_try_catch/202
[   13.842608] 
[   13.842765] CPU: 0 UID: 0 PID: 202 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   13.842839] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.842854] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.842878] Call Trace:
[   13.842893]  <TASK>
[   13.842915]  dump_stack_lvl+0x73/0xb0
[   13.842954]  print_report+0xd1/0x650
[   13.842991]  ? __virt_addr_valid+0x1db/0x2d0
[   13.843020]  ? kmalloc_uaf+0x320/0x380
[   13.843054]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.843079]  ? kmalloc_uaf+0x320/0x380
[   13.843101]  kasan_report+0x141/0x180
[   13.843135]  ? kmalloc_uaf+0x320/0x380
[   13.843163]  __asan_report_load1_noabort+0x18/0x20
[   13.843190]  kmalloc_uaf+0x320/0x380
[   13.843378]  ? __pfx_kmalloc_uaf+0x10/0x10
[   13.843418]  ? __schedule+0x10cc/0x2b60
[   13.843445]  ? __pfx_read_tsc+0x10/0x10
[   13.843483]  ? ktime_get_ts64+0x86/0x230
[   13.843513]  kunit_try_run_case+0x1a5/0x480
[   13.843553]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.843577]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.843604]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.843641]  ? __kthread_parkme+0x82/0x180
[   13.843665]  ? preempt_count_sub+0x50/0x80
[   13.843693]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.843719]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.843743]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.843768]  kthread+0x337/0x6f0
[   13.843799]  ? trace_preempt_on+0x20/0xc0
[   13.843826]  ? __pfx_kthread+0x10/0x10
[   13.843848]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.843871]  ? calculate_sigpending+0x7b/0xa0
[   13.843899]  ? __pfx_kthread+0x10/0x10
[   13.843922]  ret_from_fork+0x116/0x1d0
[   13.843943]  ? __pfx_kthread+0x10/0x10
[   13.843965]  ret_from_fork_asm+0x1a/0x30
[   13.844001]  </TASK>
[   13.844015] 
[   13.854417] Allocated by task 202:
[   13.854632]  kasan_save_stack+0x45/0x70
[   13.854860]  kasan_save_track+0x18/0x40
[   13.855061]  kasan_save_alloc_info+0x3b/0x50
[   13.856155]  __kasan_kmalloc+0xb7/0xc0
[   13.856409]  __kmalloc_cache_noprof+0x189/0x420
[   13.856741]  kmalloc_uaf+0xaa/0x380
[   13.856933]  kunit_try_run_case+0x1a5/0x480
[   13.857448]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.857866]  kthread+0x337/0x6f0
[   13.858281]  ret_from_fork+0x116/0x1d0
[   13.858650]  ret_from_fork_asm+0x1a/0x30
[   13.858979] 
[   13.859378] Freed by task 202:
[   13.859578]  kasan_save_stack+0x45/0x70
[   13.859976]  kasan_save_track+0x18/0x40
[   13.860447]  kasan_save_free_info+0x3f/0x60
[   13.860826]  __kasan_slab_free+0x56/0x70
[   13.861367]  kfree+0x222/0x3f0
[   13.861652]  kmalloc_uaf+0x12c/0x380
[   13.861866]  kunit_try_run_case+0x1a5/0x480
[   13.862317]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.862697]  kthread+0x337/0x6f0
[   13.862920]  ret_from_fork+0x116/0x1d0
[   13.863368]  ret_from_fork_asm+0x1a/0x30
[   13.863594] 
[   13.863852] The buggy address belongs to the object at ffff88810216f100
[   13.863852]  which belongs to the cache kmalloc-16 of size 16
[   13.864613] The buggy address is located 8 bytes inside of
[   13.864613]  freed 16-byte region [ffff88810216f100, ffff88810216f110)
[   13.865641] 
[   13.865769] The buggy address belongs to the physical page:
[   13.866114] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10216f
[   13.866633] flags: 0x200000000000000(node=0|zone=2)
[   13.867078] page_type: f5(slab)
[   13.867735] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   13.868117] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   13.868989] page dumped because: kasan: bad access detected
[   13.869406] 
[   13.869525] Memory state around the buggy address:
[   13.869863]  ffff88810216f000: fa fb fc fc 00 00 fc fc 00 00 fc fc fa fb fc fc
[   13.870609]  ffff88810216f080: 00 05 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   13.871050] >ffff88810216f100: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.871631]                       ^
[   13.872070]  ffff88810216f180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.872463]  ffff88810216f200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.872905] ==================================================================