Hay
Date
July 17, 2025, 11:11 p.m.

Environment
qemu-arm64
qemu-x86_64

[   16.782976] ==================================================================
[   16.783046] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x3f4/0x468
[   16.783104] Read of size 1 at addr fff00000c7848f28 by task kunit_try_catch/188
[   16.783373] 
[   16.783449] CPU: 1 UID: 0 PID: 188 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   16.783536] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.783564] Hardware name: linux,dummy-virt (DT)
[   16.783603] Call trace:
[   16.783653]  show_stack+0x20/0x38 (C)
[   16.783767]  dump_stack_lvl+0x8c/0xd0
[   16.783852]  print_report+0x118/0x5d0
[   16.784017]  kasan_report+0xdc/0x128
[   16.784095]  __asan_report_load1_noabort+0x20/0x30
[   16.784159]  kmalloc_uaf2+0x3f4/0x468
[   16.784321]  kunit_try_run_case+0x170/0x3f0
[   16.784370]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.784423]  kthread+0x328/0x630
[   16.784464]  ret_from_fork+0x10/0x20
[   16.785033] 
[   16.785107] Allocated by task 188:
[   16.785174]  kasan_save_stack+0x3c/0x68
[   16.785325]  kasan_save_track+0x20/0x40
[   16.785527]  kasan_save_alloc_info+0x40/0x58
[   16.785597]  __kasan_kmalloc+0xd4/0xd8
[   16.785729]  __kmalloc_cache_noprof+0x16c/0x3c0
[   16.785770]  kmalloc_uaf2+0xc4/0x468
[   16.785991]  kunit_try_run_case+0x170/0x3f0
[   16.786193]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.786343]  kthread+0x328/0x630
[   16.786478]  ret_from_fork+0x10/0x20
[   16.786636] 
[   16.786712] Freed by task 188:
[   16.786845]  kasan_save_stack+0x3c/0x68
[   16.786970]  kasan_save_track+0x20/0x40
[   16.787026]  kasan_save_free_info+0x4c/0x78
[   16.787321]  __kasan_slab_free+0x6c/0x98
[   16.787463]  kfree+0x214/0x3c8
[   16.787622]  kmalloc_uaf2+0x134/0x468
[   16.787724]  kunit_try_run_case+0x170/0x3f0
[   16.788178]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.788336]  kthread+0x328/0x630
[   16.788408]  ret_from_fork+0x10/0x20
[   16.788445] 
[   16.788466] The buggy address belongs to the object at fff00000c7848f00
[   16.788466]  which belongs to the cache kmalloc-64 of size 64
[   16.788528] The buggy address is located 40 bytes inside of
[   16.788528]  freed 64-byte region [fff00000c7848f00, fff00000c7848f40)
[   16.788823] 
[   16.789002] The buggy address belongs to the physical page:
[   16.789147] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107848
[   16.789250] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   16.789398] page_type: f5(slab)
[   16.789554] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   16.789643] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   16.789684] page dumped because: kasan: bad access detected
[   16.789979] 
[   16.790017] Memory state around the buggy address:
[   16.790051]  fff00000c7848e00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   16.790425]  fff00000c7848e80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   16.790531] >fff00000c7848f00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   16.790645]                                   ^
[   16.790782]  fff00000c7848f80: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc
[   16.790910]  fff00000c7849000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   16.790978] ==================================================================

[   12.578307] ==================================================================
[   12.578811] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x4a8/0x520
[   12.579192] Read of size 1 at addr ffff888102f441a8 by task kunit_try_catch/205
[   12.579587] 
[   12.579710] CPU: 0 UID: 0 PID: 205 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   12.579757] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.579769] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.579790] Call Trace:
[   12.579802]  <TASK>
[   12.579821]  dump_stack_lvl+0x73/0xb0
[   12.579852]  print_report+0xd1/0x610
[   12.579874]  ? __virt_addr_valid+0x1db/0x2d0
[   12.579898]  ? kmalloc_uaf2+0x4a8/0x520
[   12.579917]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.579939]  ? kmalloc_uaf2+0x4a8/0x520
[   12.579959]  kasan_report+0x141/0x180
[   12.579980]  ? kmalloc_uaf2+0x4a8/0x520
[   12.580005]  __asan_report_load1_noabort+0x18/0x20
[   12.580065]  kmalloc_uaf2+0x4a8/0x520
[   12.580085]  ? __pfx_kmalloc_uaf2+0x10/0x10
[   12.580104]  ? sysvec_apic_timer_interrupt+0x50/0x90
[   12.580136]  ? __pfx_kmalloc_uaf2+0x10/0x10
[   12.580162]  kunit_try_run_case+0x1a5/0x480
[   12.580188]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.580210]  ? _raw_spin_lock_irqsave+0xf9/0x100
[   12.580235]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.580276]  ? __kthread_parkme+0x82/0x180
[   12.580297]  ? preempt_count_sub+0x50/0x80
[   12.580337]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.580360]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.580383]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.580406]  kthread+0x337/0x6f0
[   12.580424]  ? trace_preempt_on+0x20/0xc0
[   12.580448]  ? __pfx_kthread+0x10/0x10
[   12.580467]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.580488]  ? calculate_sigpending+0x7b/0xa0
[   12.580513]  ? __pfx_kthread+0x10/0x10
[   12.580533]  ret_from_fork+0x116/0x1d0
[   12.580552]  ? __pfx_kthread+0x10/0x10
[   12.580572]  ret_from_fork_asm+0x1a/0x30
[   12.580616]  </TASK>
[   12.580626] 
[   12.592224] Allocated by task 205:
[   12.592408]  kasan_save_stack+0x45/0x70
[   12.592793]  kasan_save_track+0x18/0x40
[   12.593163]  kasan_save_alloc_info+0x3b/0x50
[   12.593373]  __kasan_kmalloc+0xb7/0xc0
[   12.593550]  __kmalloc_cache_noprof+0x189/0x420
[   12.594261]  kmalloc_uaf2+0xc6/0x520
[   12.594503]  kunit_try_run_case+0x1a5/0x480
[   12.594976]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.595248]  kthread+0x337/0x6f0
[   12.595404]  ret_from_fork+0x116/0x1d0
[   12.595580]  ret_from_fork_asm+0x1a/0x30
[   12.595765] 
[   12.596159] Freed by task 205:
[   12.596439]  kasan_save_stack+0x45/0x70
[   12.597113]  kasan_save_track+0x18/0x40
[   12.597368]  kasan_save_free_info+0x3f/0x60
[   12.597699]  __kasan_slab_free+0x56/0x70
[   12.598045]  kfree+0x222/0x3f0
[   12.598221]  kmalloc_uaf2+0x14c/0x520
[   12.598397]  kunit_try_run_case+0x1a5/0x480
[   12.598588]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.599163]  kthread+0x337/0x6f0
[   12.599459]  ret_from_fork+0x116/0x1d0
[   12.599781]  ret_from_fork_asm+0x1a/0x30
[   12.600222] 
[   12.600442] The buggy address belongs to the object at ffff888102f44180
[   12.600442]  which belongs to the cache kmalloc-64 of size 64
[   12.601534] The buggy address is located 40 bytes inside of
[   12.601534]  freed 64-byte region [ffff888102f44180, ffff888102f441c0)
[   12.602565] 
[   12.602674] The buggy address belongs to the physical page:
[   12.603306] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102f44
[   12.604094] flags: 0x200000000000000(node=0|zone=2)
[   12.604335] page_type: f5(slab)
[   12.604494] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   12.605164] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   12.605622] page dumped because: kasan: bad access detected
[   12.605991] 
[   12.606230] Memory state around the buggy address:
[   12.606457]  ffff888102f44080: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   12.607072]  ffff888102f44100: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   12.607542] >ffff888102f44180: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   12.608161]                                   ^
[   12.608368]  ffff888102f44200: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc
[   12.609180]  ffff888102f44280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.609583] ==================================================================