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

Environment
qemu-arm64
qemu-x86_64

[   19.856655] ==================================================================
[   19.856792] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x170/0x310
[   19.856908] Write of size 33 at addr fff00000c667a080 by task kunit_try_catch/186
[   19.858582] 
[   19.858687] CPU: 0 UID: 0 PID: 186 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   19.858876] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.859042] Hardware name: linux,dummy-virt (DT)
[   19.859124] Call trace:
[   19.859186]  show_stack+0x20/0x38 (C)
[   19.859285]  dump_stack_lvl+0x8c/0xd0
[   19.859405]  print_report+0x118/0x608
[   19.859505]  kasan_report+0xdc/0x128
[   19.860051]  kasan_check_range+0x100/0x1a8
[   19.860343]  __asan_memset+0x34/0x78
[   19.860460]  kmalloc_uaf_memset+0x170/0x310
[   19.860578]  kunit_try_run_case+0x170/0x3f0
[   19.860710]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.860845]  kthread+0x328/0x630
[   19.860954]  ret_from_fork+0x10/0x20
[   19.861089] 
[   19.861137] Allocated by task 186:
[   19.861211]  kasan_save_stack+0x3c/0x68
[   19.861303]  kasan_save_track+0x20/0x40
[   19.861390]  kasan_save_alloc_info+0x40/0x58
[   19.861479]  __kasan_kmalloc+0xd4/0xd8
[   19.862035]  __kmalloc_cache_noprof+0x16c/0x3c0
[   19.862130]  kmalloc_uaf_memset+0xb8/0x310
[   19.862203]  kunit_try_run_case+0x170/0x3f0
[   19.862282]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.862367]  kthread+0x328/0x630
[   19.862430]  ret_from_fork+0x10/0x20
[   19.862509] 
[   19.862601] Freed by task 186:
[   19.862681]  kasan_save_stack+0x3c/0x68
[   19.862768]  kasan_save_track+0x20/0x40
[   19.862834]  kasan_save_free_info+0x4c/0x78
[   19.862914]  __kasan_slab_free+0x6c/0x98
[   19.863000]  kfree+0x214/0x3c8
[   19.863093]  kmalloc_uaf_memset+0x11c/0x310
[   19.863180]  kunit_try_run_case+0x170/0x3f0
[   19.863263]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.863360]  kthread+0x328/0x630
[   19.863433]  ret_from_fork+0x10/0x20
[   19.863510] 
[   19.863553] The buggy address belongs to the object at fff00000c667a080
[   19.863553]  which belongs to the cache kmalloc-64 of size 64
[   19.863717] The buggy address is located 0 bytes inside of
[   19.863717]  freed 64-byte region [fff00000c667a080, fff00000c667a0c0)
[   19.863865] 
[   19.863910] The buggy address belongs to the physical page:
[   19.863983] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10667a
[   19.864123] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.864239] page_type: f5(slab)
[   19.864327] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   19.864447] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   19.865219] page dumped because: kasan: bad access detected
[   19.865296] 
[   19.865339] Memory state around the buggy address:
[   19.865410]  fff00000c6679f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   19.865876]  fff00000c667a000: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   19.866190] >fff00000c667a080: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   19.866294]                    ^
[   19.866354]  fff00000c667a100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.866442]  fff00000c667a180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.866533] ==================================================================

[   11.821288] ==================================================================
[   11.821701] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x1a3/0x360
[   11.821943] Write of size 33 at addr ffff888103184600 by task kunit_try_catch/203
[   11.822431] 
[   11.822635] CPU: 0 UID: 0 PID: 203 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   11.822681] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.822693] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.822714] Call Trace:
[   11.822727]  <TASK>
[   11.822746]  dump_stack_lvl+0x73/0xb0
[   11.823018]  print_report+0xd1/0x650
[   11.823047]  ? __virt_addr_valid+0x1db/0x2d0
[   11.823070]  ? kmalloc_uaf_memset+0x1a3/0x360
[   11.823090]  ? kasan_complete_mode_report_info+0x64/0x200
[   11.823111]  ? kmalloc_uaf_memset+0x1a3/0x360
[   11.823165]  kasan_report+0x141/0x180
[   11.823186]  ? kmalloc_uaf_memset+0x1a3/0x360
[   11.823211]  kasan_check_range+0x10c/0x1c0
[   11.823234]  __asan_memset+0x27/0x50
[   11.823252]  kmalloc_uaf_memset+0x1a3/0x360
[   11.823272]  ? __pfx_kmalloc_uaf_memset+0x10/0x10
[   11.823372]  ? __schedule+0x10cc/0x2b60
[   11.823399]  ? __pfx_read_tsc+0x10/0x10
[   11.823419]  ? ktime_get_ts64+0x86/0x230
[   11.823443]  kunit_try_run_case+0x1a5/0x480
[   11.823468]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.823488]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.823510]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.823532]  ? __kthread_parkme+0x82/0x180
[   11.823551]  ? preempt_count_sub+0x50/0x80
[   11.823574]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.823596]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.823617]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.823639]  kthread+0x337/0x6f0
[   11.823657]  ? trace_preempt_on+0x20/0xc0
[   11.823679]  ? __pfx_kthread+0x10/0x10
[   11.823698]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.823717]  ? calculate_sigpending+0x7b/0xa0
[   11.823741]  ? __pfx_kthread+0x10/0x10
[   11.823761]  ret_from_fork+0x116/0x1d0
[   11.823778]  ? __pfx_kthread+0x10/0x10
[   11.823797]  ret_from_fork_asm+0x1a/0x30
[   11.823827]  </TASK>
[   11.823838] 
[   11.840047] Allocated by task 203:
[   11.840626]  kasan_save_stack+0x45/0x70
[   11.841081]  kasan_save_track+0x18/0x40
[   11.841662]  kasan_save_alloc_info+0x3b/0x50
[   11.842270]  __kasan_kmalloc+0xb7/0xc0
[   11.842776]  __kmalloc_cache_noprof+0x189/0x420
[   11.843350]  kmalloc_uaf_memset+0xa9/0x360
[   11.843607]  kunit_try_run_case+0x1a5/0x480
[   11.843755]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.843929]  kthread+0x337/0x6f0
[   11.844049]  ret_from_fork+0x116/0x1d0
[   11.844632]  ret_from_fork_asm+0x1a/0x30
[   11.845072] 
[   11.845256] Freed by task 203:
[   11.845698]  kasan_save_stack+0x45/0x70
[   11.846144]  kasan_save_track+0x18/0x40
[   11.846661]  kasan_save_free_info+0x3f/0x60
[   11.847211]  __kasan_slab_free+0x56/0x70
[   11.847716]  kfree+0x222/0x3f0
[   11.848115]  kmalloc_uaf_memset+0x12b/0x360
[   11.848677]  kunit_try_run_case+0x1a5/0x480
[   11.849047]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.849282]  kthread+0x337/0x6f0
[   11.849768]  ret_from_fork+0x116/0x1d0
[   11.850226]  ret_from_fork_asm+0x1a/0x30
[   11.850758] 
[   11.850924] The buggy address belongs to the object at ffff888103184600
[   11.850924]  which belongs to the cache kmalloc-64 of size 64
[   11.851911] The buggy address is located 0 bytes inside of
[   11.851911]  freed 64-byte region [ffff888103184600, ffff888103184640)
[   11.853441] 
[   11.853732] The buggy address belongs to the physical page:
[   11.853914] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103184
[   11.854228] flags: 0x200000000000000(node=0|zone=2)
[   11.854728] page_type: f5(slab)
[   11.855154] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   11.855934] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   11.856841] page dumped because: kasan: bad access detected
[   11.857345] 
[   11.857649] Memory state around the buggy address:
[   11.858034]  ffff888103184500: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.858485]  ffff888103184580: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.859136] >ffff888103184600: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.859776]                    ^
[   11.859998]  ffff888103184680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.860423]  ffff888103184700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.861198] ==================================================================