Hay
Date
June 7, 2025, 10:40 a.m.

Environment
qemu-arm64
qemu-x86_64

[   21.643199] ==================================================================
[   21.644703] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x17c/0x328
[   21.645487] Write of size 33 at addr fff00000c41e2a00 by task kunit_try_catch/174
[   21.646280] 
[   21.646637] CPU: 0 UID: 0 PID: 174 Comm: kunit_try_catch Tainted: G    B            N 6.12.33-rc1 #1
[   21.646863] Tainted: [B]=BAD_PAGE, [N]=TEST
[   21.646939] Hardware name: linux,dummy-virt (DT)
[   21.647042] Call trace:
[   21.647112]  dump_backtrace+0x9c/0x128
[   21.647230]  show_stack+0x20/0x38
[   21.647334]  dump_stack_lvl+0x8c/0xd0
[   21.647516]  print_report+0x118/0x5f0
[   21.647656]  kasan_report+0xdc/0x128
[   21.647766]  kasan_check_range+0x100/0x1a8
[   21.647820]  __asan_memset+0x34/0x78
[   21.647866]  kmalloc_uaf_memset+0x17c/0x328
[   21.647917]  kunit_try_run_case+0x170/0x3f0
[   21.647990]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.648052]  kthread+0x24c/0x2d0
[   21.648099]  ret_from_fork+0x10/0x20
[   21.648147] 
[   21.656517] Allocated by task 174:
[   21.657417]  kasan_save_stack+0x3c/0x68
[   21.658000]  kasan_save_track+0x20/0x40
[   21.658468]  kasan_save_alloc_info+0x40/0x58
[   21.659259]  __kasan_kmalloc+0xd4/0xd8
[   21.659769]  __kmalloc_cache_noprof+0x154/0x320
[   21.660380]  kmalloc_uaf_memset+0xb8/0x328
[   21.661374]  kunit_try_run_case+0x170/0x3f0
[   21.661872]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.662513]  kthread+0x24c/0x2d0
[   21.663007]  ret_from_fork+0x10/0x20
[   21.663472] 
[   21.664229] Freed by task 174:
[   21.664665]  kasan_save_stack+0x3c/0x68
[   21.665202]  kasan_save_track+0x20/0x40
[   21.665686]  kasan_save_free_info+0x4c/0x78
[   21.666196]  __kasan_slab_free+0x6c/0x98
[   21.666773]  kfree+0x110/0x3b8
[   21.667242]  kmalloc_uaf_memset+0x120/0x328
[   21.667917]  kunit_try_run_case+0x170/0x3f0
[   21.668458]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.669135]  kthread+0x24c/0x2d0
[   21.669623]  ret_from_fork+0x10/0x20
[   21.670639] 
[   21.670948] The buggy address belongs to the object at fff00000c41e2a00
[   21.670948]  which belongs to the cache kmalloc-64 of size 64
[   21.672336] The buggy address is located 0 bytes inside of
[   21.672336]  freed 64-byte region [fff00000c41e2a00, fff00000c41e2a40)
[   21.673611] 
[   21.673894] The buggy address belongs to the physical page:
[   21.674553] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1041e2
[   21.675588] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   21.676392] page_type: f5(slab)
[   21.676832] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   21.677587] raw: 0000000000000000 0000000080200020 00000001f5000000 0000000000000000
[   21.678546] page dumped because: kasan: bad access detected
[   21.679274] 
[   21.679938] Memory state around the buggy address:
[   21.680561]  fff00000c41e2900: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   21.681399]  fff00000c41e2980: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   21.682235] >fff00000c41e2a00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   21.683043]                    ^
[   21.683805]  fff00000c41e2a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.684628]  fff00000c41e2b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.685428] ==================================================================

[   18.041839] ==================================================================
[   18.043178] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x1a4/0x360
[   18.044144] Write of size 33 at addr ffff88810230b880 by task kunit_try_catch/191
[   18.045453] 
[   18.045725] CPU: 1 UID: 0 PID: 191 Comm: kunit_try_catch Tainted: G    B            N 6.12.33-rc1 #1
[   18.045787] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.045804] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   18.045856] Call Trace:
[   18.045899]  <TASK>
[   18.045949]  dump_stack_lvl+0x73/0xb0
[   18.046346]  print_report+0xd1/0x640
[   18.046415]  ? __virt_addr_valid+0x1db/0x2d0
[   18.046474]  ? kmalloc_uaf_memset+0x1a4/0x360
[   18.046550]  ? kasan_complete_mode_report_info+0x64/0x200
[   18.046623]  ? kmalloc_uaf_memset+0x1a4/0x360
[   18.046691]  kasan_report+0x140/0x180
[   18.046764]  ? kmalloc_uaf_memset+0x1a4/0x360
[   18.046850]  kasan_check_range+0x10c/0x1c0
[   18.046897]  __asan_memset+0x27/0x50
[   18.046927]  kmalloc_uaf_memset+0x1a4/0x360
[   18.046960]  ? __pfx_kmalloc_uaf_memset+0x10/0x10
[   18.046994]  ? __schedule+0xc49/0x27a0
[   18.047025]  ? __pfx_read_tsc+0x10/0x10
[   18.047052]  ? ktime_get_ts64+0x84/0x230
[   18.047089]  kunit_try_run_case+0x1a6/0x480
[   18.047121]  ? __pfx_kunit_try_run_case+0x10/0x10
[   18.047149]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   18.047177]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   18.047211]  ? __kthread_parkme+0x82/0x160
[   18.047279]  ? preempt_count_sub+0x50/0x80
[   18.047312]  ? __pfx_kunit_try_run_case+0x10/0x10
[   18.047340]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   18.047375]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   18.047412]  kthread+0x257/0x310
[   18.047439]  ? __pfx_kthread+0x10/0x10
[   18.047544]  ret_from_fork+0x41/0x80
[   18.047589]  ? __pfx_kthread+0x10/0x10
[   18.047616]  ret_from_fork_asm+0x1a/0x30
[   18.047658]  </TASK>
[   18.047672] 
[   18.068247] Allocated by task 191:
[   18.069362]  kasan_save_stack+0x45/0x70
[   18.069671]  kasan_save_track+0x18/0x40
[   18.070148]  kasan_save_alloc_info+0x3b/0x50
[   18.070784]  __kasan_kmalloc+0xb7/0xc0
[   18.071366]  __kmalloc_cache_noprof+0x168/0x350
[   18.072366]  kmalloc_uaf_memset+0xaa/0x360
[   18.073018]  kunit_try_run_case+0x1a6/0x480
[   18.073361]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   18.073852]  kthread+0x257/0x310
[   18.074602]  ret_from_fork+0x41/0x80
[   18.075324]  ret_from_fork_asm+0x1a/0x30
[   18.076192] 
[   18.076392] Freed by task 191:
[   18.076624]  kasan_save_stack+0x45/0x70
[   18.077753]  kasan_save_track+0x18/0x40
[   18.078281]  kasan_save_free_info+0x3f/0x60
[   18.079155]  __kasan_slab_free+0x56/0x70
[   18.079503]  kfree+0x123/0x3d0
[   18.080049]  kmalloc_uaf_memset+0x12c/0x360
[   18.080364]  kunit_try_run_case+0x1a6/0x480
[   18.080794]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   18.081773]  kthread+0x257/0x310
[   18.082027]  ret_from_fork+0x41/0x80
[   18.082595]  ret_from_fork_asm+0x1a/0x30
[   18.083357] 
[   18.083711] The buggy address belongs to the object at ffff88810230b880
[   18.083711]  which belongs to the cache kmalloc-64 of size 64
[   18.085321] The buggy address is located 0 bytes inside of
[   18.085321]  freed 64-byte region [ffff88810230b880, ffff88810230b8c0)
[   18.086704] 
[   18.087313] The buggy address belongs to the physical page:
[   18.087918] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10230b
[   18.088490] flags: 0x200000000000000(node=0|zone=2)
[   18.089412] page_type: f5(slab)
[   18.089720] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   18.090420] raw: 0000000000000000 0000000080200020 00000001f5000000 0000000000000000
[   18.092163] page dumped because: kasan: bad access detected
[   18.092737] 
[   18.093287] Memory state around the buggy address:
[   18.094105]  ffff88810230b780: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   18.094787]  ffff88810230b800: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   18.095854] >ffff88810230b880: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   18.096393]                    ^
[   18.097171]  ffff88810230b900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.098094]  ffff88810230b980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.098902] ==================================================================