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

Environment
qemu-arm64
qemu-x86_64

[   30.760670] ==================================================================
[   30.760884] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x3f4/0x468
[   30.761051] Read of size 1 at addr fff00000c637afa8 by task kunit_try_catch/219
[   30.761127] 
[   30.761230] CPU: 0 UID: 0 PID: 219 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6-next-20250716 #1 PREEMPT 
[   30.761331] Tainted: [B]=BAD_PAGE, [N]=TEST
[   30.761358] Hardware name: linux,dummy-virt (DT)
[   30.761392] Call trace:
[   30.761450]  show_stack+0x20/0x38 (C)
[   30.761660]  dump_stack_lvl+0x8c/0xd0
[   30.761780]  print_report+0x118/0x5d0
[   30.761865]  kasan_report+0xdc/0x128
[   30.761956]  __asan_report_load1_noabort+0x20/0x30
[   30.762010]  kmalloc_uaf2+0x3f4/0x468
[   30.762056]  kunit_try_run_case+0x170/0x3f0
[   30.762110]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.762244]  kthread+0x328/0x630
[   30.762319]  ret_from_fork+0x10/0x20
[   30.762462] 
[   30.762482] Allocated by task 219:
[   30.762523]  kasan_save_stack+0x3c/0x68
[   30.762726]  kasan_save_track+0x20/0x40
[   30.762885]  kasan_save_alloc_info+0x40/0x58
[   30.762951]  __kasan_kmalloc+0xd4/0xd8
[   30.763091]  __kmalloc_cache_noprof+0x16c/0x3c0
[   30.763185]  kmalloc_uaf2+0xc4/0x468
[   30.763229]  kunit_try_run_case+0x170/0x3f0
[   30.763310]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.763356]  kthread+0x328/0x630
[   30.763390]  ret_from_fork+0x10/0x20
[   30.763426] 
[   30.763455] Freed by task 219:
[   30.763625]  kasan_save_stack+0x3c/0x68
[   30.763733]  kasan_save_track+0x20/0x40
[   30.763795]  kasan_save_free_info+0x4c/0x78
[   30.763926]  __kasan_slab_free+0x6c/0x98
[   30.764144]  kfree+0x214/0x3c8
[   30.764231]  kmalloc_uaf2+0x134/0x468
[   30.764362]  kunit_try_run_case+0x170/0x3f0
[   30.764436]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.764487]  kthread+0x328/0x630
[   30.764649]  ret_from_fork+0x10/0x20
[   30.764761] 
[   30.764936] The buggy address belongs to the object at fff00000c637af80
[   30.764936]  which belongs to the cache kmalloc-64 of size 64
[   30.765082] The buggy address is located 40 bytes inside of
[   30.765082]  freed 64-byte region [fff00000c637af80, fff00000c637afc0)
[   30.765348] 
[   30.765560] The buggy address belongs to the physical page:
[   30.765672] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10637a
[   30.765818] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   30.765976] page_type: f5(slab)
[   30.766073] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   30.766285] raw: 0000000000000000 0000000000200020 00000000f5000000 0000000000000000
[   30.766429] page dumped because: kasan: bad access detected
[   30.766592] 
[   30.766634] Memory state around the buggy address:
[   30.766780]  fff00000c637ae80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   30.766876]  fff00000c637af00: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   30.767011] >fff00000c637af80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   30.767108]                                   ^
[   30.767231]  fff00000c637b000: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   30.767276]  fff00000c637b080: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   30.767349] ==================================================================

[   23.567679] ==================================================================
[   23.568999] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x4a8/0x520
[   23.569798] Read of size 1 at addr ffff8881053a95a8 by task kunit_try_catch/237
[   23.570522] 
[   23.570777] CPU: 0 UID: 0 PID: 237 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6-next-20250716 #1 PREEMPT(voluntary) 
[   23.570826] Tainted: [B]=BAD_PAGE, [N]=TEST
[   23.570838] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   23.570858] Call Trace:
[   23.570871]  <TASK>
[   23.570888]  dump_stack_lvl+0x73/0xb0
[   23.570918]  print_report+0xd1/0x610
[   23.570939]  ? __virt_addr_valid+0x1db/0x2d0
[   23.570961]  ? kmalloc_uaf2+0x4a8/0x520
[   23.571054]  ? kasan_complete_mode_report_info+0x64/0x200
[   23.571080]  ? kmalloc_uaf2+0x4a8/0x520
[   23.571100]  kasan_report+0x141/0x180
[   23.571121]  ? kmalloc_uaf2+0x4a8/0x520
[   23.571145]  __asan_report_load1_noabort+0x18/0x20
[   23.571168]  kmalloc_uaf2+0x4a8/0x520
[   23.571187]  ? __pfx_kmalloc_uaf2+0x10/0x10
[   23.571206]  ? finish_task_switch.isra.0+0x153/0x700
[   23.571227]  ? __switch_to+0x47/0xf80
[   23.571254]  ? __schedule+0x10c6/0x2b60
[   23.571288]  ? __pfx_read_tsc+0x10/0x10
[   23.571308]  ? ktime_get_ts64+0x86/0x230
[   23.571333]  kunit_try_run_case+0x1a5/0x480
[   23.571356]  ? __pfx_kunit_try_run_case+0x10/0x10
[   23.571378]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   23.571400]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   23.571421]  ? __kthread_parkme+0x82/0x180
[   23.571441]  ? preempt_count_sub+0x50/0x80
[   23.571462]  ? __pfx_kunit_try_run_case+0x10/0x10
[   23.571484]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   23.571510]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   23.571535]  kthread+0x337/0x6f0
[   23.571564]  ? trace_preempt_on+0x20/0xc0
[   23.571587]  ? __pfx_kthread+0x10/0x10
[   23.571607]  ? _raw_spin_unlock_irq+0x47/0x80
[   23.571627]  ? calculate_sigpending+0x7b/0xa0
[   23.571651]  ? __pfx_kthread+0x10/0x10
[   23.571671]  ret_from_fork+0x116/0x1d0
[   23.571689]  ? __pfx_kthread+0x10/0x10
[   23.571709]  ret_from_fork_asm+0x1a/0x30
[   23.571738]  </TASK>
[   23.571749] 
[   23.585229] Allocated by task 237:
[   23.585605]  kasan_save_stack+0x45/0x70
[   23.585961]  kasan_save_track+0x18/0x40
[   23.586112]  kasan_save_alloc_info+0x3b/0x50
[   23.586253]  __kasan_kmalloc+0xb7/0xc0
[   23.586390]  __kmalloc_cache_noprof+0x189/0x420
[   23.586538]  kmalloc_uaf2+0xc6/0x520
[   23.586892]  kunit_try_run_case+0x1a5/0x480
[   23.587343]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   23.587923]  kthread+0x337/0x6f0
[   23.588287]  ret_from_fork+0x116/0x1d0
[   23.588689]  ret_from_fork_asm+0x1a/0x30
[   23.589118] 
[   23.589306] Freed by task 237:
[   23.589652]  kasan_save_stack+0x45/0x70
[   23.590039]  kasan_save_track+0x18/0x40
[   23.590511]  kasan_save_free_info+0x3f/0x60
[   23.590903]  __kasan_slab_free+0x56/0x70
[   23.591252]  kfree+0x222/0x3f0
[   23.591377]  kmalloc_uaf2+0x14c/0x520
[   23.591572]  kunit_try_run_case+0x1a5/0x480
[   23.592014]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   23.592563]  kthread+0x337/0x6f0
[   23.592879]  ret_from_fork+0x116/0x1d0
[   23.593199]  ret_from_fork_asm+0x1a/0x30
[   23.593346] 
[   23.593436] The buggy address belongs to the object at ffff8881053a9580
[   23.593436]  which belongs to the cache kmalloc-64 of size 64
[   23.594454] The buggy address is located 40 bytes inside of
[   23.594454]  freed 64-byte region [ffff8881053a9580, ffff8881053a95c0)
[   23.595490] 
[   23.595565] The buggy address belongs to the physical page:
[   23.595727] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1053a9
[   23.596245] flags: 0x200000000000000(node=0|zone=2)
[   23.596790] page_type: f5(slab)
[   23.597093] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   23.597475] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   23.598184] page dumped because: kasan: bad access detected
[   23.598784] 
[   23.598941] Memory state around the buggy address:
[   23.599236]  ffff8881053a9480: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   23.599862]  ffff8881053a9500: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   23.600540] >ffff8881053a9580: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   23.600748]                                   ^
[   23.600902]  ffff8881053a9600: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc
[   23.601595]  ffff8881053a9680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.602300] ==================================================================