Hay
Date
July 3, 2025, 3:13 p.m.

Environment
qemu-arm64
qemu-x86_64

[   15.699220] ==================================================================
[   15.699279] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x300/0x338
[   15.699334] Read of size 1 at addr fff00000c55f0928 by task kunit_try_catch/187
[   15.699382] 
[   15.699413] CPU: 1 UID: 0 PID: 187 Comm: kunit_try_catch Tainted: G    B            N  6.15.5-rc1 #1 PREEMPT 
[   15.699493] Tainted: [B]=BAD_PAGE, [N]=TEST
[   15.699520] Hardware name: linux,dummy-virt (DT)
[   15.699548] Call trace:
[   15.699571]  show_stack+0x20/0x38 (C)
[   15.699616]  dump_stack_lvl+0x8c/0xd0
[   15.699667]  print_report+0x118/0x608
[   15.699747]  kasan_report+0xdc/0x128
[   15.699792]  __asan_report_load1_noabort+0x20/0x30
[   15.699839]  kmalloc_uaf+0x300/0x338
[   15.699883]  kunit_try_run_case+0x170/0x3f0
[   15.699931]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.701031]  kthread+0x328/0x630
[   15.701492]  ret_from_fork+0x10/0x20
[   15.701875] 
[   15.702059] Allocated by task 187:
[   15.702144]  kasan_save_stack+0x3c/0x68
[   15.702214]  kasan_save_track+0x20/0x40
[   15.702249]  kasan_save_alloc_info+0x40/0x58
[   15.702540]  __kasan_kmalloc+0xd4/0xd8
[   15.702734]  __kmalloc_cache_noprof+0x16c/0x3c0
[   15.702812]  kmalloc_uaf+0xb8/0x338
[   15.703010]  kunit_try_run_case+0x170/0x3f0
[   15.703060]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.703206]  kthread+0x328/0x630
[   15.703532]  ret_from_fork+0x10/0x20
[   15.703681] 
[   15.703840] Freed by task 187:
[   15.704030]  kasan_save_stack+0x3c/0x68
[   15.704256]  kasan_save_track+0x20/0x40
[   15.704440]  kasan_save_free_info+0x4c/0x78
[   15.704917]  __kasan_slab_free+0x6c/0x98
[   15.705054]  kfree+0x214/0x3c8
[   15.705092]  kmalloc_uaf+0x11c/0x338
[   15.705185]  kunit_try_run_case+0x170/0x3f0
[   15.705633]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.705968]  kthread+0x328/0x630
[   15.706182]  ret_from_fork+0x10/0x20
[   15.706226] 
[   15.706410] The buggy address belongs to the object at fff00000c55f0920
[   15.706410]  which belongs to the cache kmalloc-16 of size 16
[   15.706628] The buggy address is located 8 bytes inside of
[   15.706628]  freed 16-byte region [fff00000c55f0920, fff00000c55f0930)
[   15.706743] 
[   15.706874] The buggy address belongs to the physical page:
[   15.706909] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1055f0
[   15.707099] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   15.707339] page_type: f5(slab)
[   15.707397] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   15.707447] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   15.707876] page dumped because: kasan: bad access detected
[   15.708054] 
[   15.708258] Memory state around the buggy address:
[   15.708320]  fff00000c55f0800: 00 02 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   15.708479]  fff00000c55f0880: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   15.708631] >fff00000c55f0900: fa fb fc fc fa fb fc fc fc fc fc fc fc fc fc fc
[   15.708715]                                   ^
[   15.708902]  fff00000c55f0980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.709138]  fff00000c55f0a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.709209] ==================================================================

[   11.427277] ==================================================================
[   11.427713] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x320/0x380
[   11.428397] Read of size 1 at addr ffff888102307de8 by task kunit_try_catch/203
[   11.429251] 
[   11.429507] CPU: 1 UID: 0 PID: 203 Comm: kunit_try_catch Tainted: G    B            N  6.15.5-rc1 #1 PREEMPT(voluntary) 
[   11.429557] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.429569] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.429590] Call Trace:
[   11.429602]  <TASK>
[   11.429616]  dump_stack_lvl+0x73/0xb0
[   11.429640]  print_report+0xd1/0x650
[   11.429701]  ? __virt_addr_valid+0x1db/0x2d0
[   11.429723]  ? kmalloc_uaf+0x320/0x380
[   11.429743]  ? kasan_complete_mode_report_info+0x64/0x200
[   11.429772]  ? kmalloc_uaf+0x320/0x380
[   11.429793]  kasan_report+0x141/0x180
[   11.429815]  ? kmalloc_uaf+0x320/0x380
[   11.429840]  __asan_report_load1_noabort+0x18/0x20
[   11.429861]  kmalloc_uaf+0x320/0x380
[   11.429881]  ? __pfx_kmalloc_uaf+0x10/0x10
[   11.429902]  ? __schedule+0x10cc/0x2b60
[   11.429924]  ? __pfx_read_tsc+0x10/0x10
[   11.429943]  ? ktime_get_ts64+0x86/0x230
[   11.429967]  kunit_try_run_case+0x1a5/0x480
[   11.429991]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.430012]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.430036]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.430059]  ? __kthread_parkme+0x82/0x180
[   11.430080]  ? preempt_count_sub+0x50/0x80
[   11.430104]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.430127]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.430150]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.430173]  kthread+0x337/0x6f0
[   11.430189]  ? trace_preempt_on+0x20/0xc0
[   11.430212]  ? __pfx_kthread+0x10/0x10
[   11.430229]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.430260]  ? calculate_sigpending+0x7b/0xa0
[   11.430281]  ? __pfx_kthread+0x10/0x10
[   11.430300]  ret_from_fork+0x41/0x80
[   11.430319]  ? __pfx_kthread+0x10/0x10
[   11.430337]  ret_from_fork_asm+0x1a/0x30
[   11.430366]  </TASK>
[   11.430376] 
[   11.442166] Allocated by task 203:
[   11.442571]  kasan_save_stack+0x45/0x70
[   11.442990]  kasan_save_track+0x18/0x40
[   11.443443]  kasan_save_alloc_info+0x3b/0x50
[   11.443895]  __kasan_kmalloc+0xb7/0xc0
[   11.444286]  __kmalloc_cache_noprof+0x189/0x420
[   11.444750]  kmalloc_uaf+0xaa/0x380
[   11.445084]  kunit_try_run_case+0x1a5/0x480
[   11.445549]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.446061]  kthread+0x337/0x6f0
[   11.446430]  ret_from_fork+0x41/0x80
[   11.446828]  ret_from_fork_asm+0x1a/0x30
[   11.447197] 
[   11.447408] Freed by task 203:
[   11.447637]  kasan_save_stack+0x45/0x70
[   11.447966]  kasan_save_track+0x18/0x40
[   11.448098]  kasan_save_free_info+0x3f/0x60
[   11.448247]  __kasan_slab_free+0x56/0x70
[   11.448382]  kfree+0x222/0x3f0
[   11.448716]  kmalloc_uaf+0x12c/0x380
[   11.449089]  kunit_try_run_case+0x1a5/0x480
[   11.449629]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.450305]  kthread+0x337/0x6f0
[   11.450615]  ret_from_fork+0x41/0x80
[   11.451041]  ret_from_fork_asm+0x1a/0x30
[   11.451508] 
[   11.451747] The buggy address belongs to the object at ffff888102307de0
[   11.451747]  which belongs to the cache kmalloc-16 of size 16
[   11.452336] The buggy address is located 8 bytes inside of
[   11.452336]  freed 16-byte region [ffff888102307de0, ffff888102307df0)
[   11.453073] 
[   11.453290] The buggy address belongs to the physical page:
[   11.453827] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102307
[   11.454602] flags: 0x200000000000000(node=0|zone=2)
[   11.455069] page_type: f5(slab)
[   11.455389] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   11.455615] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   11.456392] page dumped because: kasan: bad access detected
[   11.456898] 
[   11.457054] Memory state around the buggy address:
[   11.457564]  ffff888102307c80: 00 02 fc fc 00 06 fc fc 00 06 fc fc 00 04 fc fc
[   11.457787]  ffff888102307d00: 00 04 fc fc 00 01 fc fc 00 01 fc fc 00 04 fc fc
[   11.457996] >ffff888102307d80: 00 04 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   11.458210]                                                           ^
[   11.458892]  ffff888102307e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.459781]  ffff888102307e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.460511] ==================================================================