Hay
Date
May 12, 2025, 6:12 p.m.

Environment
qemu-arm64
qemu-x86_64

[   19.003345] ==================================================================
[   19.003949] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x3f4/0x468
[   19.004785] Read of size 1 at addr fff00000c5a02e28 by task kunit_try_catch/177
[   19.005419] 
[   19.005760] CPU: 1 UID: 0 PID: 177 Comm: kunit_try_catch Tainted: G    B            N 6.14.7-rc1 #1
[   19.006015] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.006139] Hardware name: linux,dummy-virt (DT)
[   19.006227] Call trace:
[   19.006282]  show_stack+0x20/0x38 (C)
[   19.006404]  dump_stack_lvl+0x8c/0xd0
[   19.006462]  print_report+0x118/0x608
[   19.006587]  kasan_report+0xdc/0x128
[   19.006713]  __asan_report_load1_noabort+0x20/0x30
[   19.006822]  kmalloc_uaf2+0x3f4/0x468
[   19.006932]  kunit_try_run_case+0x170/0x3f0
[   19.007028]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.007122]  kthread+0x318/0x620
[   19.007173]  ret_from_fork+0x10/0x20
[   19.007227] 
[   19.012229] Allocated by task 177:
[   19.012776]  kasan_save_stack+0x3c/0x68
[   19.013323]  kasan_save_track+0x20/0x40
[   19.013811]  kasan_save_alloc_info+0x40/0x58
[   19.014258]  __kasan_kmalloc+0xd4/0xd8
[   19.015082]  __kmalloc_cache_noprof+0x15c/0x3c0
[   19.015534]  kmalloc_uaf2+0xc4/0x468
[   19.016036]  kunit_try_run_case+0x170/0x3f0
[   19.016573]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.016969]  kthread+0x318/0x620
[   19.017411]  ret_from_fork+0x10/0x20
[   19.017860] 
[   19.018161] Freed by task 177:
[   19.018581]  kasan_save_stack+0x3c/0x68
[   19.019391]  kasan_save_track+0x20/0x40
[   19.019660]  kasan_save_free_info+0x4c/0x78
[   19.020173]  __kasan_slab_free+0x6c/0x98
[   19.020659]  kfree+0x214/0x3c8
[   19.021098]  kmalloc_uaf2+0x134/0x468
[   19.021518]  kunit_try_run_case+0x170/0x3f0
[   19.022022]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.022482]  kthread+0x318/0x620
[   19.023150]  ret_from_fork+0x10/0x20
[   19.023348] 
[   19.023453] The buggy address belongs to the object at fff00000c5a02e00
[   19.023453]  which belongs to the cache kmalloc-64 of size 64
[   19.023805] The buggy address is located 40 bytes inside of
[   19.023805]  freed 64-byte region [fff00000c5a02e00, fff00000c5a02e40)
[   19.024120] 
[   19.024219] The buggy address belongs to the physical page:
[   19.024393] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105a02
[   19.024632] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.025180] page_type: f5(slab)
[   19.025620] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   19.026405] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   19.027698] page dumped because: kasan: bad access detected
[   19.028312] 
[   19.028544] Memory state around the buggy address:
[   19.028951]  fff00000c5a02d00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   19.029474]  fff00000c5a02d80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   19.030797] >fff00000c5a02e00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   19.031336]                                   ^
[   19.032039]  fff00000c5a02e80: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc
[   19.032860]  fff00000c5a02f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.033513] ==================================================================

[   12.749018] ==================================================================
[   12.750240] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x4aa/0x520
[   12.750699] Read of size 1 at addr ffff888101b2b4a8 by task kunit_try_catch/196
[   12.750938] 
[   12.751104] CPU: 1 UID: 0 PID: 196 Comm: kunit_try_catch Tainted: G    B            N 6.14.7-rc1 #1
[   12.751157] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.751169] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.751191] Call Trace:
[   12.751206]  <TASK>
[   12.751260]  dump_stack_lvl+0x73/0xb0
[   12.751505]  print_report+0xd1/0x650
[   12.751530]  ? __virt_addr_valid+0x1db/0x2d0
[   12.751652]  ? kmalloc_uaf2+0x4aa/0x520
[   12.751673]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.751698]  ? kmalloc_uaf2+0x4aa/0x520
[   12.751717]  kasan_report+0x140/0x180
[   12.751739]  ? kmalloc_uaf2+0x4aa/0x520
[   12.751762]  __asan_report_load1_noabort+0x18/0x20
[   12.751784]  kmalloc_uaf2+0x4aa/0x520
[   12.751803]  ? __pfx_kmalloc_uaf2+0x10/0x10
[   12.751821]  ? finish_task_switch.isra.0+0x153/0x700
[   12.751854]  ? __switch_to+0x5d9/0xf60
[   12.751881]  ? __schedule+0xce8/0x2840
[   12.751905]  ? __pfx_read_tsc+0x10/0x10
[   12.751926]  ? ktime_get_ts64+0x86/0x230
[   12.751951]  kunit_try_run_case+0x1a6/0x480
[   12.751974]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.752000]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   12.752021]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.752044]  ? __kthread_parkme+0x82/0x160
[   12.752066]  ? preempt_count_sub+0x50/0x80
[   12.752089]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.752110]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.752135]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.752160]  kthread+0x324/0x6e0
[   12.752180]  ? trace_preempt_on+0x20/0xc0
[   12.752203]  ? __pfx_kthread+0x10/0x10
[   12.752225]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.752247]  ? calculate_sigpending+0x7b/0xa0
[   12.752268]  ? __pfx_kthread+0x10/0x10
[   12.752289]  ret_from_fork+0x41/0x80
[   12.752308]  ? __pfx_kthread+0x10/0x10
[   12.752329]  ret_from_fork_asm+0x1a/0x30
[   12.752360]  </TASK>
[   12.752372] 
[   12.767170] Allocated by task 196:
[   12.767407]  kasan_save_stack+0x45/0x70
[   12.767628]  kasan_save_track+0x18/0x40
[   12.767811]  kasan_save_alloc_info+0x3b/0x50
[   12.768139]  __kasan_kmalloc+0xb7/0xc0
[   12.768291]  __kmalloc_cache_noprof+0x18a/0x420
[   12.768537]  kmalloc_uaf2+0xc7/0x520
[   12.768720]  kunit_try_run_case+0x1a6/0x480
[   12.768912]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.769248]  kthread+0x324/0x6e0
[   12.769433]  ret_from_fork+0x41/0x80
[   12.769638]  ret_from_fork_asm+0x1a/0x30
[   12.769860] 
[   12.769978] Freed by task 196:
[   12.770288]  kasan_save_stack+0x45/0x70
[   12.770507]  kasan_save_track+0x18/0x40
[   12.770714]  kasan_save_free_info+0x3f/0x60
[   12.770919]  __kasan_slab_free+0x56/0x70
[   12.771166]  kfree+0x224/0x3f0
[   12.771310]  kmalloc_uaf2+0x14d/0x520
[   12.771496]  kunit_try_run_case+0x1a6/0x480
[   12.771725]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.772104]  kthread+0x324/0x6e0
[   12.772286]  ret_from_fork+0x41/0x80
[   12.772421]  ret_from_fork_asm+0x1a/0x30
[   12.772562] 
[   12.772638] The buggy address belongs to the object at ffff888101b2b480
[   12.772638]  which belongs to the cache kmalloc-64 of size 64
[   12.773395] The buggy address is located 40 bytes inside of
[   12.773395]  freed 64-byte region [ffff888101b2b480, ffff888101b2b4c0)
[   12.773940] 
[   12.774126] The buggy address belongs to the physical page:
[   12.774360] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101b2b
[   12.774716] flags: 0x200000000000000(node=0|zone=2)
[   12.774965] page_type: f5(slab)
[   12.775187] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   12.775508] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   12.775828] page dumped because: kasan: bad access detected
[   12.776179] 
[   12.776281] Memory state around the buggy address:
[   12.776515]  ffff888101b2b380: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   12.776820]  ffff888101b2b400: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   12.777218] >ffff888101b2b480: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   12.777558]                                   ^
[   12.777786]  ffff888101b2b500: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc
[   12.778219]  ffff888101b2b580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.778530] ==================================================================