Hay
Date
July 20, 2025, 11:12 a.m.

Environment
qemu-arm64
qemu-x86_64

[   15.444279] ==================================================================
[   15.444438] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x3f4/0x468
[   15.444582] Read of size 1 at addr fff00000c70109a8 by task kunit_try_catch/188
[   15.444636] 
[   15.444679] CPU: 0 UID: 0 PID: 188 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   15.444760] Tainted: [B]=BAD_PAGE, [N]=TEST
[   15.444895] Hardware name: linux,dummy-virt (DT)
[   15.445062] Call trace:
[   15.445109]  show_stack+0x20/0x38 (C)
[   15.445162]  dump_stack_lvl+0x8c/0xd0
[   15.445226]  print_report+0x118/0x5d0
[   15.445302]  kasan_report+0xdc/0x128
[   15.445483]  __asan_report_load1_noabort+0x20/0x30
[   15.445534]  kmalloc_uaf2+0x3f4/0x468
[   15.445677]  kunit_try_run_case+0x170/0x3f0
[   15.445738]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.445792]  kthread+0x328/0x630
[   15.445847]  ret_from_fork+0x10/0x20
[   15.445899] 
[   15.445917] Allocated by task 188:
[   15.445965]  kasan_save_stack+0x3c/0x68
[   15.446008]  kasan_save_track+0x20/0x40
[   15.446045]  kasan_save_alloc_info+0x40/0x58
[   15.446086]  __kasan_kmalloc+0xd4/0xd8
[   15.446130]  __kmalloc_cache_noprof+0x16c/0x3c0
[   15.446169]  kmalloc_uaf2+0xc4/0x468
[   15.446202]  kunit_try_run_case+0x170/0x3f0
[   15.446237]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.446282]  kthread+0x328/0x630
[   15.446320]  ret_from_fork+0x10/0x20
[   15.446364] 
[   15.446383] Freed by task 188:
[   15.446418]  kasan_save_stack+0x3c/0x68
[   15.446456]  kasan_save_track+0x20/0x40
[   15.446493]  kasan_save_free_info+0x4c/0x78
[   15.446530]  __kasan_slab_free+0x6c/0x98
[   15.446566]  kfree+0x214/0x3c8
[   15.446607]  kmalloc_uaf2+0x134/0x468
[   15.446642]  kunit_try_run_case+0x170/0x3f0
[   15.446689]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.446731]  kthread+0x328/0x630
[   15.446761]  ret_from_fork+0x10/0x20
[   15.446796] 
[   15.446814] The buggy address belongs to the object at fff00000c7010980
[   15.446814]  which belongs to the cache kmalloc-64 of size 64
[   15.446872] The buggy address is located 40 bytes inside of
[   15.446872]  freed 64-byte region [fff00000c7010980, fff00000c70109c0)
[   15.447254] 
[   15.447304] The buggy address belongs to the physical page:
[   15.447341] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107010
[   15.447395] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   15.447443] page_type: f5(slab)
[   15.447481] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   15.447716] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   15.447814] page dumped because: kasan: bad access detected
[   15.447909] 
[   15.447990] Memory state around the buggy address:
[   15.448110]  fff00000c7010880: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   15.448167]  fff00000c7010900: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   15.448379] >fff00000c7010980: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   15.448517]                                   ^
[   15.448602]  fff00000c7010a00: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc
[   15.448690]  fff00000c7010a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.448790] ==================================================================

[   12.609514] ==================================================================
[   12.609987] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x4a8/0x520
[   12.610308] Read of size 1 at addr ffff8881027362a8 by task kunit_try_catch/205
[   12.610657] 
[   12.610777] CPU: 1 UID: 0 PID: 205 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   12.610820] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.610831] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.610850] Call Trace:
[   12.610862]  <TASK>
[   12.610876]  dump_stack_lvl+0x73/0xb0
[   12.610913]  print_report+0xd1/0x610
[   12.610935]  ? __virt_addr_valid+0x1db/0x2d0
[   12.610956]  ? kmalloc_uaf2+0x4a8/0x520
[   12.610974]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.610995]  ? kmalloc_uaf2+0x4a8/0x520
[   12.611014]  kasan_report+0x141/0x180
[   12.611034]  ? kmalloc_uaf2+0x4a8/0x520
[   12.611061]  __asan_report_load1_noabort+0x18/0x20
[   12.611084]  kmalloc_uaf2+0x4a8/0x520
[   12.611102]  ? __pfx_kmalloc_uaf2+0x10/0x10
[   12.611120]  ? finish_task_switch.isra.0+0x153/0x700
[   12.611140]  ? __switch_to+0x47/0xf50
[   12.611165]  ? __schedule+0x10cc/0x2b60
[   12.611186]  ? __pfx_read_tsc+0x10/0x10
[   12.611205]  ? ktime_get_ts64+0x86/0x230
[   12.611228]  kunit_try_run_case+0x1a5/0x480
[   12.611250]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.611271]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.611292]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.611314]  ? __kthread_parkme+0x82/0x180
[   12.611354]  ? preempt_count_sub+0x50/0x80
[   12.611377]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.611399]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.611421]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.611442]  kthread+0x337/0x6f0
[   12.611460]  ? trace_preempt_on+0x20/0xc0
[   12.611481]  ? __pfx_kthread+0x10/0x10
[   12.611501]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.611521]  ? calculate_sigpending+0x7b/0xa0
[   12.611543]  ? __pfx_kthread+0x10/0x10
[   12.611563]  ret_from_fork+0x116/0x1d0
[   12.611579]  ? __pfx_kthread+0x10/0x10
[   12.611598]  ret_from_fork_asm+0x1a/0x30
[   12.611627]  </TASK>
[   12.611636] 
[   12.618941] Allocated by task 205:
[   12.619147]  kasan_save_stack+0x45/0x70
[   12.619450]  kasan_save_track+0x18/0x40
[   12.619639]  kasan_save_alloc_info+0x3b/0x50
[   12.619864]  __kasan_kmalloc+0xb7/0xc0
[   12.620059]  __kmalloc_cache_noprof+0x189/0x420
[   12.620254]  kmalloc_uaf2+0xc6/0x520
[   12.620413]  kunit_try_run_case+0x1a5/0x480
[   12.620559]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.620917]  kthread+0x337/0x6f0
[   12.621261]  ret_from_fork+0x116/0x1d0
[   12.621497]  ret_from_fork_asm+0x1a/0x30
[   12.621699] 
[   12.621839] Freed by task 205:
[   12.622005]  kasan_save_stack+0x45/0x70
[   12.622167]  kasan_save_track+0x18/0x40
[   12.622400]  kasan_save_free_info+0x3f/0x60
[   12.622612]  __kasan_slab_free+0x56/0x70
[   12.622795]  kfree+0x222/0x3f0
[   12.622987]  kmalloc_uaf2+0x14c/0x520
[   12.623153]  kunit_try_run_case+0x1a5/0x480
[   12.623318]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.623583]  kthread+0x337/0x6f0
[   12.623892]  ret_from_fork+0x116/0x1d0
[   12.624260]  ret_from_fork_asm+0x1a/0x30
[   12.624635] 
[   12.624816] The buggy address belongs to the object at ffff888102736280
[   12.624816]  which belongs to the cache kmalloc-64 of size 64
[   12.625846] The buggy address is located 40 bytes inside of
[   12.625846]  freed 64-byte region [ffff888102736280, ffff8881027362c0)
[   12.626976] 
[   12.627229] The buggy address belongs to the physical page:
[   12.627737] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102736
[   12.627986] flags: 0x200000000000000(node=0|zone=2)
[   12.628147] page_type: f5(slab)
[   12.628269] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   12.628627] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   12.629360] page dumped because: kasan: bad access detected
[   12.629539] 
[   12.629608] Memory state around the buggy address:
[   12.629965]  ffff888102736180: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   12.630615]  ffff888102736200: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   12.631316] >ffff888102736280: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   12.632001]                                   ^
[   12.632480]  ffff888102736300: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc
[   12.633110]  ffff888102736380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.633483] ==================================================================