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

Environment
qemu-arm64
qemu-x86_64

[   18.919162] ==================================================================
[   18.920019] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x300/0x338
[   18.920683] Read of size 1 at addr fff00000c59b8548 by task kunit_try_catch/173
[   18.921242] 
[   18.921590] CPU: 1 UID: 0 PID: 173 Comm: kunit_try_catch Tainted: G    B            N 6.14.7-rc1 #1
[   18.921861] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.921936] Hardware name: linux,dummy-virt (DT)
[   18.922026] Call trace:
[   18.922104]  show_stack+0x20/0x38 (C)
[   18.922230]  dump_stack_lvl+0x8c/0xd0
[   18.922357]  print_report+0x118/0x608
[   18.922456]  kasan_report+0xdc/0x128
[   18.922614]  __asan_report_load1_noabort+0x20/0x30
[   18.922754]  kmalloc_uaf+0x300/0x338
[   18.922858]  kunit_try_run_case+0x170/0x3f0
[   18.922960]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.923074]  kthread+0x318/0x620
[   18.923166]  ret_from_fork+0x10/0x20
[   18.923277] 
[   18.928053] Allocated by task 173:
[   18.928498]  kasan_save_stack+0x3c/0x68
[   18.929035]  kasan_save_track+0x20/0x40
[   18.929473]  kasan_save_alloc_info+0x40/0x58
[   18.929949]  __kasan_kmalloc+0xd4/0xd8
[   18.930430]  __kmalloc_cache_noprof+0x15c/0x3c0
[   18.931026]  kmalloc_uaf+0xb8/0x338
[   18.931328]  kunit_try_run_case+0x170/0x3f0
[   18.931624]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.932300]  kthread+0x318/0x620
[   18.932793]  ret_from_fork+0x10/0x20
[   18.933285] 
[   18.933538] Freed by task 173:
[   18.933962]  kasan_save_stack+0x3c/0x68
[   18.934443]  kasan_save_track+0x20/0x40
[   18.935010]  kasan_save_free_info+0x4c/0x78
[   18.935691]  __kasan_slab_free+0x6c/0x98
[   18.936208]  kfree+0x214/0x3c8
[   18.936686]  kmalloc_uaf+0x11c/0x338
[   18.937133]  kunit_try_run_case+0x170/0x3f0
[   18.937629]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.938277]  kthread+0x318/0x620
[   18.938948]  ret_from_fork+0x10/0x20
[   18.939392] 
[   18.939757] The buggy address belongs to the object at fff00000c59b8540
[   18.939757]  which belongs to the cache kmalloc-16 of size 16
[   18.940638] The buggy address is located 8 bytes inside of
[   18.940638]  freed 16-byte region [fff00000c59b8540, fff00000c59b8550)
[   18.941456] 
[   18.941809] The buggy address belongs to the physical page:
[   18.942521] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1059b8
[   18.943290] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.944126] page_type: f5(slab)
[   18.944646] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   18.945188] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   18.946048] page dumped because: kasan: bad access detected
[   18.946547] 
[   18.946712] Memory state around the buggy address:
[   18.947269]  fff00000c59b8400: fa fb fc fc 00 03 fc fc 00 03 fc fc 00 00 fc fc
[   18.947798]  fff00000c59b8480: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   18.948294] >fff00000c59b8500: fa fb fc fc fa fb fc fc fa fb fc fc fc fc fc fc
[   18.948850]                                               ^
[   18.949338]  fff00000c59b8580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.949875]  fff00000c59b8600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.950409] ==================================================================

[   12.695407] ==================================================================
[   12.695936] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x322/0x380
[   12.696265] Read of size 1 at addr ffff888101b28028 by task kunit_try_catch/192
[   12.696523] 
[   12.696636] CPU: 1 UID: 0 PID: 192 Comm: kunit_try_catch Tainted: G    B            N 6.14.7-rc1 #1
[   12.696685] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.696697] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.696734] Call Trace:
[   12.696749]  <TASK>
[   12.696771]  dump_stack_lvl+0x73/0xb0
[   12.696800]  print_report+0xd1/0x650
[   12.696823]  ? __virt_addr_valid+0x1db/0x2d0
[   12.696869]  ? kmalloc_uaf+0x322/0x380
[   12.696889]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.696934]  ? kmalloc_uaf+0x322/0x380
[   12.696954]  kasan_report+0x140/0x180
[   12.696975]  ? kmalloc_uaf+0x322/0x380
[   12.696998]  __asan_report_load1_noabort+0x18/0x20
[   12.697021]  kmalloc_uaf+0x322/0x380
[   12.697040]  ? __pfx_kmalloc_uaf+0x10/0x10
[   12.697060]  ? __schedule+0xce8/0x2840
[   12.697097]  ? __pfx_read_tsc+0x10/0x10
[   12.697119]  ? ktime_get_ts64+0x86/0x230
[   12.697145]  kunit_try_run_case+0x1a6/0x480
[   12.697169]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.697193]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   12.697215]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.697239]  ? __kthread_parkme+0x82/0x160
[   12.697262]  ? preempt_count_sub+0x50/0x80
[   12.697288]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.697311]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.697336]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.697361]  kthread+0x324/0x6e0
[   12.697383]  ? trace_preempt_on+0x20/0xc0
[   12.697407]  ? __pfx_kthread+0x10/0x10
[   12.697429]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.697452]  ? calculate_sigpending+0x7b/0xa0
[   12.697473]  ? __pfx_kthread+0x10/0x10
[   12.697495]  ret_from_fork+0x41/0x80
[   12.697514]  ? __pfx_kthread+0x10/0x10
[   12.697536]  ret_from_fork_asm+0x1a/0x30
[   12.697568]  </TASK>
[   12.697579] 
[   12.705145] Allocated by task 192:
[   12.705367]  kasan_save_stack+0x45/0x70
[   12.705591]  kasan_save_track+0x18/0x40
[   12.705759]  kasan_save_alloc_info+0x3b/0x50
[   12.705925]  __kasan_kmalloc+0xb7/0xc0
[   12.706298]  __kmalloc_cache_noprof+0x18a/0x420
[   12.706531]  kmalloc_uaf+0xab/0x380
[   12.706717]  kunit_try_run_case+0x1a6/0x480
[   12.706924]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.707223]  kthread+0x324/0x6e0
[   12.707405]  ret_from_fork+0x41/0x80
[   12.707555]  ret_from_fork_asm+0x1a/0x30
[   12.707728] 
[   12.707828] Freed by task 192:
[   12.707978]  kasan_save_stack+0x45/0x70
[   12.708180]  kasan_save_track+0x18/0x40
[   12.708789]  kasan_save_free_info+0x3f/0x60
[   12.709174]  __kasan_slab_free+0x56/0x70
[   12.709317]  kfree+0x224/0x3f0
[   12.709435]  kmalloc_uaf+0x12d/0x380
[   12.709564]  kunit_try_run_case+0x1a6/0x480
[   12.709778]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.710069]  kthread+0x324/0x6e0
[   12.710246]  ret_from_fork+0x41/0x80
[   12.710431]  ret_from_fork_asm+0x1a/0x30
[   12.710622] 
[   12.710721] The buggy address belongs to the object at ffff888101b28020
[   12.710721]  which belongs to the cache kmalloc-16 of size 16
[   12.711334] The buggy address is located 8 bytes inside of
[   12.711334]  freed 16-byte region [ffff888101b28020, ffff888101b28030)
[   12.711788] 
[   12.711880] The buggy address belongs to the physical page:
[   12.712192] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101b28
[   12.712523] flags: 0x200000000000000(node=0|zone=2)
[   12.712749] page_type: f5(slab)
[   12.712887] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   12.713154] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   12.713610] page dumped because: kasan: bad access detected
[   12.713882] 
[   12.713968] Memory state around the buggy address:
[   12.714297]  ffff888101b27f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.714556]  ffff888101b27f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.714786] >ffff888101b28000: fa fb fc fc fa fb fc fc fc fc fc fc fc fc fc fc
[   12.715111]                                   ^
[   12.715455]  ffff888101b28080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.715782]  ffff888101b28100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.716023] ==================================================================