Hay
Date
July 12, 2025, 11:09 p.m.

Environment
qemu-arm64
qemu-x86_64

[   16.820265] ==================================================================
[   16.820334] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x3f4/0x468
[   16.820382] Read of size 1 at addr fff00000c592faa8 by task kunit_try_catch/188
[   16.820457] 
[   16.820490] CPU: 1 UID: 0 PID: 188 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   16.820619] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.820748] Hardware name: linux,dummy-virt (DT)
[   16.820792] Call trace:
[   16.820834]  show_stack+0x20/0x38 (C)
[   16.820890]  dump_stack_lvl+0x8c/0xd0
[   16.820955]  print_report+0x118/0x5d0
[   16.821020]  kasan_report+0xdc/0x128
[   16.821086]  __asan_report_load1_noabort+0x20/0x30
[   16.821158]  kmalloc_uaf2+0x3f4/0x468
[   16.821245]  kunit_try_run_case+0x170/0x3f0
[   16.821310]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.821365]  kthread+0x328/0x630
[   16.821407]  ret_from_fork+0x10/0x20
[   16.821770] 
[   16.821798] Allocated by task 188:
[   16.821829]  kasan_save_stack+0x3c/0x68
[   16.822013]  kasan_save_track+0x20/0x40
[   16.822058]  kasan_save_alloc_info+0x40/0x58
[   16.822255]  __kasan_kmalloc+0xd4/0xd8
[   16.822329]  __kmalloc_cache_noprof+0x16c/0x3c0
[   16.822397]  kmalloc_uaf2+0xc4/0x468
[   16.822434]  kunit_try_run_case+0x170/0x3f0
[   16.822473]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.822606]  kthread+0x328/0x630
[   16.822657]  ret_from_fork+0x10/0x20
[   16.822694] 
[   16.822712] Freed by task 188:
[   16.822763]  kasan_save_stack+0x3c/0x68
[   16.822820]  kasan_save_track+0x20/0x40
[   16.823157]  kasan_save_free_info+0x4c/0x78
[   16.823399]  __kasan_slab_free+0x6c/0x98
[   16.823506]  kfree+0x214/0x3c8
[   16.823608]  kmalloc_uaf2+0x134/0x468
[   16.823706]  kunit_try_run_case+0x170/0x3f0
[   16.823853]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.823920]  kthread+0x328/0x630
[   16.823953]  ret_from_fork+0x10/0x20
[   16.823988] 
[   16.824030] The buggy address belongs to the object at fff00000c592fa80
[   16.824030]  which belongs to the cache kmalloc-64 of size 64
[   16.824093] The buggy address is located 40 bytes inside of
[   16.824093]  freed 64-byte region [fff00000c592fa80, fff00000c592fac0)
[   16.824416] 
[   16.824649] The buggy address belongs to the physical page:
[   16.824729] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10592f
[   16.824863] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   16.824983] page_type: f5(slab)
[   16.825060] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   16.825194] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   16.825285] page dumped because: kasan: bad access detected
[   16.825515] 
[   16.825535] Memory state around the buggy address:
[   16.825697]  fff00000c592f980: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   16.825844]  fff00000c592fa00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   16.825919] >fff00000c592fa80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   16.826008]                                   ^
[   16.826062]  fff00000c592fb00: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc
[   16.826196]  fff00000c592fb80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.826288] ==================================================================

[   13.278370] ==================================================================
[   13.278990] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x4a8/0x520
[   13.279630] Read of size 1 at addr ffff888103a503a8 by task kunit_try_catch/205
[   13.279946] 
[   13.280145] CPU: 0 UID: 0 PID: 205 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   13.280252] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.280277] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.280313] Call Trace:
[   13.280325]  <TASK>
[   13.280342]  dump_stack_lvl+0x73/0xb0
[   13.280375]  print_report+0xd1/0x610
[   13.280398]  ? __virt_addr_valid+0x1db/0x2d0
[   13.280423]  ? kmalloc_uaf2+0x4a8/0x520
[   13.280442]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.280465]  ? kmalloc_uaf2+0x4a8/0x520
[   13.280486]  kasan_report+0x141/0x180
[   13.280507]  ? kmalloc_uaf2+0x4a8/0x520
[   13.280532]  __asan_report_load1_noabort+0x18/0x20
[   13.280557]  kmalloc_uaf2+0x4a8/0x520
[   13.280589]  ? __pfx_kmalloc_uaf2+0x10/0x10
[   13.280609]  ? finish_task_switch.isra.0+0x153/0x700
[   13.280634]  ? __switch_to+0x47/0xf50
[   13.280661]  ? __schedule+0x10cc/0x2b60
[   13.280683]  ? __pfx_read_tsc+0x10/0x10
[   13.280704]  ? ktime_get_ts64+0x86/0x230
[   13.280730]  kunit_try_run_case+0x1a5/0x480
[   13.280755]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.280778]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.280803]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.280826]  ? __kthread_parkme+0x82/0x180
[   13.280848]  ? preempt_count_sub+0x50/0x80
[   13.280870]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.280895]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.280919]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.280944]  kthread+0x337/0x6f0
[   13.280963]  ? trace_preempt_on+0x20/0xc0
[   13.281004]  ? __pfx_kthread+0x10/0x10
[   13.281024]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.281046]  ? calculate_sigpending+0x7b/0xa0
[   13.281071]  ? __pfx_kthread+0x10/0x10
[   13.281093]  ret_from_fork+0x116/0x1d0
[   13.281111]  ? __pfx_kthread+0x10/0x10
[   13.281132]  ret_from_fork_asm+0x1a/0x30
[   13.281163]  </TASK>
[   13.281172] 
[   13.290046] Allocated by task 205:
[   13.290184]  kasan_save_stack+0x45/0x70
[   13.290686]  kasan_save_track+0x18/0x40
[   13.291149]  kasan_save_alloc_info+0x3b/0x50
[   13.291515]  __kasan_kmalloc+0xb7/0xc0
[   13.291652]  __kmalloc_cache_noprof+0x189/0x420
[   13.291811]  kmalloc_uaf2+0xc6/0x520
[   13.291940]  kunit_try_run_case+0x1a5/0x480
[   13.292505]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.293081]  kthread+0x337/0x6f0
[   13.293437]  ret_from_fork+0x116/0x1d0
[   13.293803]  ret_from_fork_asm+0x1a/0x30
[   13.294371] 
[   13.294535] Freed by task 205:
[   13.294871]  kasan_save_stack+0x45/0x70
[   13.295188]  kasan_save_track+0x18/0x40
[   13.295542]  kasan_save_free_info+0x3f/0x60
[   13.295694]  __kasan_slab_free+0x56/0x70
[   13.295832]  kfree+0x222/0x3f0
[   13.295950]  kmalloc_uaf2+0x14c/0x520
[   13.296380]  kunit_try_run_case+0x1a5/0x480
[   13.296792]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.297461]  kthread+0x337/0x6f0
[   13.297841]  ret_from_fork+0x116/0x1d0
[   13.298233]  ret_from_fork_asm+0x1a/0x30
[   13.298824] 
[   13.298997] The buggy address belongs to the object at ffff888103a50380
[   13.298997]  which belongs to the cache kmalloc-64 of size 64
[   13.299581] The buggy address is located 40 bytes inside of
[   13.299581]  freed 64-byte region [ffff888103a50380, ffff888103a503c0)
[   13.299932] 
[   13.300005] The buggy address belongs to the physical page:
[   13.300180] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103a50
[   13.300876] flags: 0x200000000000000(node=0|zone=2)
[   13.301428] page_type: f5(slab)
[   13.301807] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   13.302665] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   13.303413] page dumped because: kasan: bad access detected
[   13.304124] 
[   13.304311] Memory state around the buggy address:
[   13.304778]  ffff888103a50280: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   13.305579]  ffff888103a50300: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   13.305965] >ffff888103a50380: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   13.306173]                                   ^
[   13.306332]  ffff888103a50400: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc
[   13.306539]  ffff888103a50480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.306751] ==================================================================