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

Environment
qemu-arm64
qemu-x86_64

[   19.376399] ==================================================================
[   19.376636] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x3bc/0x438
[   19.376757] Read of size 16 at addr fff00000c4561ae0 by task kunit_try_catch/169
[   19.376987] 
[   19.377161] CPU: 0 UID: 0 PID: 169 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   19.377474] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.377798] Hardware name: linux,dummy-virt (DT)
[   19.377892] Call trace:
[   19.377951]  show_stack+0x20/0x38 (C)
[   19.378072]  dump_stack_lvl+0x8c/0xd0
[   19.378177]  print_report+0x118/0x608
[   19.378386]  kasan_report+0xdc/0x128
[   19.378613]  __asan_report_load16_noabort+0x20/0x30
[   19.378832]  kmalloc_uaf_16+0x3bc/0x438
[   19.378951]  kunit_try_run_case+0x170/0x3f0
[   19.379067]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.379184]  kthread+0x328/0x630
[   19.379538]  ret_from_fork+0x10/0x20
[   19.379758] 
[   19.379815] Allocated by task 169:
[   19.379979]  kasan_save_stack+0x3c/0x68
[   19.380083]  kasan_save_track+0x20/0x40
[   19.380192]  kasan_save_alloc_info+0x40/0x58
[   19.380278]  __kasan_kmalloc+0xd4/0xd8
[   19.380356]  __kmalloc_cache_noprof+0x16c/0x3c0
[   19.380447]  kmalloc_uaf_16+0x140/0x438
[   19.380529]  kunit_try_run_case+0x170/0x3f0
[   19.381036]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.381164]  kthread+0x328/0x630
[   19.381303]  ret_from_fork+0x10/0x20
[   19.381475] 
[   19.381725] Freed by task 169:
[   19.381815]  kasan_save_stack+0x3c/0x68
[   19.381927]  kasan_save_track+0x20/0x40
[   19.382007]  kasan_save_free_info+0x4c/0x78
[   19.382230]  __kasan_slab_free+0x6c/0x98
[   19.382374]  kfree+0x214/0x3c8
[   19.382454]  kmalloc_uaf_16+0x190/0x438
[   19.382686]  kunit_try_run_case+0x170/0x3f0
[   19.382832]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.383071]  kthread+0x328/0x630
[   19.383141]  ret_from_fork+0x10/0x20
[   19.383550] 
[   19.383618] The buggy address belongs to the object at fff00000c4561ae0
[   19.383618]  which belongs to the cache kmalloc-16 of size 16
[   19.383761] The buggy address is located 0 bytes inside of
[   19.383761]  freed 16-byte region [fff00000c4561ae0, fff00000c4561af0)
[   19.383920] 
[   19.383967] The buggy address belongs to the physical page:
[   19.384035] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x104561
[   19.384158] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.384265] page_type: f5(slab)
[   19.384355] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   19.384474] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   19.384568] page dumped because: kasan: bad access detected
[   19.384638] 
[   19.385112] Memory state around the buggy address:
[   19.385288]  fff00000c4561980: fa fb fc fc fa fb fc fc 00 02 fc fc fa fb fc fc
[   19.385396]  fff00000c4561a00: fa fb fc fc 00 05 fc fc fa fb fc fc fa fb fc fc
[   19.385503] >fff00000c4561a80: fa fb fc fc fa fb fc fc 00 00 fc fc fa fb fc fc
[   19.385598]                                                        ^
[   19.386074]  fff00000c4561b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.386460]  fff00000c4561b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.386604] ==================================================================

[   12.667779] ==================================================================
[   12.668234] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x47b/0x4c0
[   12.668541] Read of size 16 at addr ffff888101c05ce0 by task kunit_try_catch/186
[   12.669016] 
[   12.669130] CPU: 1 UID: 0 PID: 186 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   12.669172] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.669183] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.669202] Call Trace:
[   12.669215]  <TASK>
[   12.669230]  dump_stack_lvl+0x73/0xb0
[   12.669258]  print_report+0xd1/0x650
[   12.669280]  ? __virt_addr_valid+0x1db/0x2d0
[   12.669303]  ? kmalloc_uaf_16+0x47b/0x4c0
[   12.669347]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.669371]  ? kmalloc_uaf_16+0x47b/0x4c0
[   12.669392]  kasan_report+0x141/0x180
[   12.669414]  ? kmalloc_uaf_16+0x47b/0x4c0
[   12.669460]  __asan_report_load16_noabort+0x18/0x20
[   12.669499]  kmalloc_uaf_16+0x47b/0x4c0
[   12.669520]  ? __pfx_kmalloc_uaf_16+0x10/0x10
[   12.669542]  ? __schedule+0x10cc/0x2b60
[   12.669564]  ? __pfx_read_tsc+0x10/0x10
[   12.669585]  ? ktime_get_ts64+0x86/0x230
[   12.669627]  kunit_try_run_case+0x1a5/0x480
[   12.669651]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.669673]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.669697]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.669928]  ? __kthread_parkme+0x82/0x180
[   12.669949]  ? preempt_count_sub+0x50/0x80
[   12.669984]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.670028]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.670053]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.670078]  kthread+0x337/0x6f0
[   12.670097]  ? trace_preempt_on+0x20/0xc0
[   12.670120]  ? __pfx_kthread+0x10/0x10
[   12.670140]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.670173]  ? calculate_sigpending+0x7b/0xa0
[   12.670197]  ? __pfx_kthread+0x10/0x10
[   12.670218]  ret_from_fork+0x116/0x1d0
[   12.670236]  ? __pfx_kthread+0x10/0x10
[   12.670256]  ret_from_fork_asm+0x1a/0x30
[   12.670286]  </TASK>
[   12.670296] 
[   12.678087] Allocated by task 186:
[   12.678407]  kasan_save_stack+0x45/0x70
[   12.678575]  kasan_save_track+0x18/0x40
[   12.678972]  kasan_save_alloc_info+0x3b/0x50
[   12.679160]  __kasan_kmalloc+0xb7/0xc0
[   12.679399]  __kmalloc_cache_noprof+0x189/0x420
[   12.679638]  kmalloc_uaf_16+0x15b/0x4c0
[   12.679803]  kunit_try_run_case+0x1a5/0x480
[   12.679952]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.680248]  kthread+0x337/0x6f0
[   12.680507]  ret_from_fork+0x116/0x1d0
[   12.680687]  ret_from_fork_asm+0x1a/0x30
[   12.681076] 
[   12.681157] Freed by task 186:
[   12.681291]  kasan_save_stack+0x45/0x70
[   12.681512]  kasan_save_track+0x18/0x40
[   12.681759]  kasan_save_free_info+0x3f/0x60
[   12.681915]  __kasan_slab_free+0x56/0x70
[   12.682053]  kfree+0x222/0x3f0
[   12.682169]  kmalloc_uaf_16+0x1d6/0x4c0
[   12.682382]  kunit_try_run_case+0x1a5/0x480
[   12.682595]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.683037]  kthread+0x337/0x6f0
[   12.683333]  ret_from_fork+0x116/0x1d0
[   12.683518]  ret_from_fork_asm+0x1a/0x30
[   12.683805] 
[   12.683878] The buggy address belongs to the object at ffff888101c05ce0
[   12.683878]  which belongs to the cache kmalloc-16 of size 16
[   12.684359] The buggy address is located 0 bytes inside of
[   12.684359]  freed 16-byte region [ffff888101c05ce0, ffff888101c05cf0)
[   12.684833] 
[   12.684905] The buggy address belongs to the physical page:
[   12.685073] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101c05
[   12.685437] flags: 0x200000000000000(node=0|zone=2)
[   12.685936] page_type: f5(slab)
[   12.686190] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   12.686530] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   12.686874] page dumped because: kasan: bad access detected
[   12.687216] 
[   12.687286] Memory state around the buggy address:
[   12.687531]  ffff888101c05b80: 00 04 fc fc 00 04 fc fc 00 00 fc fc fa fb fc fc
[   12.687857]  ffff888101c05c00: fa fb fc fc fa fb fc fc fa fb fc fc 00 05 fc fc
[   12.688153] >ffff888101c05c80: fa fb fc fc fa fb fc fc 00 00 fc fc fa fb fc fc
[   12.688455]                                                        ^
[   12.688781]  ffff888101c05d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.688995]  ffff888101c05d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.689482] ==================================================================