Hay
Date
June 20, 2025, 12:38 p.m.

Environment
qemu-arm64
qemu-x86_64

[   32.306994] ==================================================================
[   32.307493] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x3f4/0x468
[   32.307869] Read of size 1 at addr fff00000c596cda8 by task kunit_try_catch/199
[   32.308009] 
[   32.308152] CPU: 1 UID: 0 PID: 199 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250620 #1 PREEMPT 
[   32.308469] Tainted: [B]=BAD_PAGE, [N]=TEST
[   32.308578] Hardware name: linux,dummy-virt (DT)
[   32.308667] Call trace:
[   32.308722]  show_stack+0x20/0x38 (C)
[   32.308913]  dump_stack_lvl+0x8c/0xd0
[   32.309287]  print_report+0x118/0x608
[   32.309607]  kasan_report+0xdc/0x128
[   32.309797]  __asan_report_load1_noabort+0x20/0x30
[   32.309976]  kmalloc_uaf2+0x3f4/0x468
[   32.310126]  kunit_try_run_case+0x170/0x3f0
[   32.310302]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.310441]  kthread+0x328/0x630
[   32.310547]  ret_from_fork+0x10/0x20
[   32.310686] 
[   32.310732] Allocated by task 199:
[   32.310964]  kasan_save_stack+0x3c/0x68
[   32.311283]  kasan_save_track+0x20/0x40
[   32.311480]  kasan_save_alloc_info+0x40/0x58
[   32.311601]  __kasan_kmalloc+0xd4/0xd8
[   32.311752]  __kmalloc_cache_noprof+0x16c/0x3c0
[   32.311867]  kmalloc_uaf2+0xc4/0x468
[   32.311977]  kunit_try_run_case+0x170/0x3f0
[   32.312101]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.312236]  kthread+0x328/0x630
[   32.312421]  ret_from_fork+0x10/0x20
[   32.312517] 
[   32.312572] Freed by task 199:
[   32.312654]  kasan_save_stack+0x3c/0x68
[   32.312956]  kasan_save_track+0x20/0x40
[   32.313048]  kasan_save_free_info+0x4c/0x78
[   32.313145]  __kasan_slab_free+0x6c/0x98
[   32.313254]  kfree+0x214/0x3c8
[   32.313367]  kmalloc_uaf2+0x134/0x468
[   32.313457]  kunit_try_run_case+0x170/0x3f0
[   32.313585]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.313740]  kthread+0x328/0x630
[   32.313882]  ret_from_fork+0x10/0x20
[   32.314083] 
[   32.314157] The buggy address belongs to the object at fff00000c596cd80
[   32.314157]  which belongs to the cache kmalloc-64 of size 64
[   32.314444] The buggy address is located 40 bytes inside of
[   32.314444]  freed 64-byte region [fff00000c596cd80, fff00000c596cdc0)
[   32.314652] 
[   32.314711] The buggy address belongs to the physical page:
[   32.314792] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10596c
[   32.314930] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   32.315216] page_type: f5(slab)
[   32.315569] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   32.315812] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   32.315926] page dumped because: kasan: bad access detected
[   32.316012] 
[   32.316057] Memory state around the buggy address:
[   32.316144]  fff00000c596cc80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   32.316254]  fff00000c596cd00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   32.316376] >fff00000c596cd80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   32.316482]                                   ^
[   32.316681]  fff00000c596ce00: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc
[   32.317036]  fff00000c596ce80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   32.317144] ==================================================================

[   25.952580] ==================================================================
[   25.953237] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x4a8/0x520
[   25.953731] Read of size 1 at addr ffff88810232b328 by task kunit_try_catch/217
[   25.954048] 
[   25.954187] CPU: 0 UID: 0 PID: 217 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250620 #1 PREEMPT(voluntary) 
[   25.954293] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.954315] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   25.954354] Call Trace:
[   25.954380]  <TASK>
[   25.954412]  dump_stack_lvl+0x73/0xb0
[   25.954490]  print_report+0xd1/0x650
[   25.954536]  ? __virt_addr_valid+0x1db/0x2d0
[   25.954577]  ? kmalloc_uaf2+0x4a8/0x520
[   25.954609]  ? kasan_complete_mode_report_info+0x64/0x200
[   25.954652]  ? kmalloc_uaf2+0x4a8/0x520
[   25.954684]  kasan_report+0x141/0x180
[   25.954722]  ? kmalloc_uaf2+0x4a8/0x520
[   25.954768]  __asan_report_load1_noabort+0x18/0x20
[   25.954815]  kmalloc_uaf2+0x4a8/0x520
[   25.954853]  ? __pfx_kmalloc_uaf2+0x10/0x10
[   25.954886]  ? finish_task_switch.isra.0+0x153/0x700
[   25.954930]  ? __switch_to+0x47/0xf50
[   25.954983]  ? __schedule+0x10cc/0x2b60
[   25.955029]  ? __pfx_read_tsc+0x10/0x10
[   25.955070]  ? ktime_get_ts64+0x86/0x230
[   25.955121]  kunit_try_run_case+0x1a5/0x480
[   25.955169]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.955208]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   25.955252]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   25.955290]  ? __kthread_parkme+0x82/0x180
[   25.955324]  ? preempt_count_sub+0x50/0x80
[   25.955362]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.955402]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.955455]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   25.955501]  kthread+0x337/0x6f0
[   25.955542]  ? trace_preempt_on+0x20/0xc0
[   25.955585]  ? __pfx_kthread+0x10/0x10
[   25.955627]  ? _raw_spin_unlock_irq+0x47/0x80
[   25.955673]  ? calculate_sigpending+0x7b/0xa0
[   25.955719]  ? __pfx_kthread+0x10/0x10
[   25.955755]  ret_from_fork+0x116/0x1d0
[   25.955793]  ? __pfx_kthread+0x10/0x10
[   25.955834]  ret_from_fork_asm+0x1a/0x30
[   25.955901]  </TASK>
[   25.955930] 
[   25.968007] Allocated by task 217:
[   25.968421]  kasan_save_stack+0x45/0x70
[   25.968979]  kasan_save_track+0x18/0x40
[   25.969337]  kasan_save_alloc_info+0x3b/0x50
[   25.969829]  __kasan_kmalloc+0xb7/0xc0
[   25.970200]  __kmalloc_cache_noprof+0x189/0x420
[   25.971346]  kmalloc_uaf2+0xc6/0x520
[   25.971871]  kunit_try_run_case+0x1a5/0x480
[   25.972291]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.972893]  kthread+0x337/0x6f0
[   25.973237]  ret_from_fork+0x116/0x1d0
[   25.973723]  ret_from_fork_asm+0x1a/0x30
[   25.973987] 
[   25.974193] Freed by task 217:
[   25.974497]  kasan_save_stack+0x45/0x70
[   25.974842]  kasan_save_track+0x18/0x40
[   25.975030]  kasan_save_free_info+0x3f/0x60
[   25.975428]  __kasan_slab_free+0x56/0x70
[   25.976534]  kfree+0x222/0x3f0
[   25.976886]  kmalloc_uaf2+0x14c/0x520
[   25.977063]  kunit_try_run_case+0x1a5/0x480
[   25.977415]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.977786]  kthread+0x337/0x6f0
[   25.978138]  ret_from_fork+0x116/0x1d0
[   25.978492]  ret_from_fork_asm+0x1a/0x30
[   25.978895] 
[   25.979041] The buggy address belongs to the object at ffff88810232b300
[   25.979041]  which belongs to the cache kmalloc-64 of size 64
[   25.979863] The buggy address is located 40 bytes inside of
[   25.979863]  freed 64-byte region [ffff88810232b300, ffff88810232b340)
[   25.980497] 
[   25.980671] The buggy address belongs to the physical page:
[   25.981054] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10232b
[   25.981456] flags: 0x200000000000000(node=0|zone=2)
[   25.981707] page_type: f5(slab)
[   25.981876] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   25.982508] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   25.983194] page dumped because: kasan: bad access detected
[   25.983437] 
[   25.983518] Memory state around the buggy address:
[   25.983656]  ffff88810232b200: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   25.983833]  ffff88810232b280: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   25.984405] >ffff88810232b300: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   25.984857]                                   ^
[   25.985036]  ffff88810232b380: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc
[   25.985328]  ffff88810232b400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.985586] ==================================================================