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

Environment
qemu-arm64
qemu-x86_64

[   15.187825] ==================================================================
[   15.187888] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x3bc/0x438
[   15.188077] Read of size 16 at addr fff00000c5eb7c20 by task kunit_try_catch/168
[   15.188137] 
[   15.188220] CPU: 1 UID: 0 PID: 168 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   15.188299] Tainted: [B]=BAD_PAGE, [N]=TEST
[   15.188325] Hardware name: linux,dummy-virt (DT)
[   15.188384] Call trace:
[   15.188419]  show_stack+0x20/0x38 (C)
[   15.188504]  dump_stack_lvl+0x8c/0xd0
[   15.188552]  print_report+0x118/0x5d0
[   15.188597]  kasan_report+0xdc/0x128
[   15.188651]  __asan_report_load16_noabort+0x20/0x30
[   15.188822]  kmalloc_uaf_16+0x3bc/0x438
[   15.188908]  kunit_try_run_case+0x170/0x3f0
[   15.189072]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.189124]  kthread+0x328/0x630
[   15.189220]  ret_from_fork+0x10/0x20
[   15.189267] 
[   15.189285] Allocated by task 168:
[   15.189314]  kasan_save_stack+0x3c/0x68
[   15.189478]  kasan_save_track+0x20/0x40
[   15.189561]  kasan_save_alloc_info+0x40/0x58
[   15.189634]  __kasan_kmalloc+0xd4/0xd8
[   15.189743]  __kmalloc_cache_noprof+0x16c/0x3c0
[   15.189780]  kmalloc_uaf_16+0x140/0x438
[   15.189853]  kunit_try_run_case+0x170/0x3f0
[   15.189955]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.189997]  kthread+0x328/0x630
[   15.190156]  ret_from_fork+0x10/0x20
[   15.190244] 
[   15.190311] Freed by task 168:
[   15.190381]  kasan_save_stack+0x3c/0x68
[   15.190417]  kasan_save_track+0x20/0x40
[   15.190492]  kasan_save_free_info+0x4c/0x78
[   15.190595]  __kasan_slab_free+0x6c/0x98
[   15.190664]  kfree+0x214/0x3c8
[   15.190750]  kmalloc_uaf_16+0x190/0x438
[   15.190876]  kunit_try_run_case+0x170/0x3f0
[   15.190972]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.191047]  kthread+0x328/0x630
[   15.191078]  ret_from_fork+0x10/0x20
[   15.191111] 
[   15.191130] The buggy address belongs to the object at fff00000c5eb7c20
[   15.191130]  which belongs to the cache kmalloc-16 of size 16
[   15.191185] The buggy address is located 0 bytes inside of
[   15.191185]  freed 16-byte region [fff00000c5eb7c20, fff00000c5eb7c30)
[   15.191242] 
[   15.191312] The buggy address belongs to the physical page:
[   15.191454] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105eb7
[   15.191692] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   15.191740] page_type: f5(slab)
[   15.191778] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   15.191826] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   15.191866] page dumped because: kasan: bad access detected
[   15.191895] 
[   15.191912] Memory state around the buggy address:
[   15.191941]  fff00000c5eb7b00: fa fb fc fc 00 01 fc fc 00 01 fc fc fa fb fc fc
[   15.192105]  fff00000c5eb7b80: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   15.192148] >fff00000c5eb7c00: 00 00 fc fc fa fb fc fc fc fc fc fc fc fc fc fc
[   15.192197]                                ^
[   15.192261]  fff00000c5eb7c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.192314]  fff00000c5eb7d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.193145] ==================================================================

[   12.039102] ==================================================================
[   12.039506] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x47b/0x4c0
[   12.039729] Read of size 16 at addr ffff888101ccd2c0 by task kunit_try_catch/185
[   12.039953] 
[   12.040050] CPU: 0 UID: 0 PID: 185 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   12.040091] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.040102] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.040121] Call Trace:
[   12.040132]  <TASK>
[   12.040146]  dump_stack_lvl+0x73/0xb0
[   12.040172]  print_report+0xd1/0x610
[   12.040193]  ? __virt_addr_valid+0x1db/0x2d0
[   12.040214]  ? kmalloc_uaf_16+0x47b/0x4c0
[   12.040232]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.040252]  ? kmalloc_uaf_16+0x47b/0x4c0
[   12.040272]  kasan_report+0x141/0x180
[   12.040292]  ? kmalloc_uaf_16+0x47b/0x4c0
[   12.040315]  __asan_report_load16_noabort+0x18/0x20
[   12.040338]  kmalloc_uaf_16+0x47b/0x4c0
[   12.040357]  ? __pfx_kmalloc_uaf_16+0x10/0x10
[   12.040377]  ? __schedule+0x10cc/0x2b60
[   12.040399]  ? __pfx_read_tsc+0x10/0x10
[   12.040418]  ? ktime_get_ts64+0x86/0x230
[   12.040441]  kunit_try_run_case+0x1a5/0x480
[   12.040463]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.040484]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.040506]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.040527]  ? __kthread_parkme+0x82/0x180
[   12.040546]  ? preempt_count_sub+0x50/0x80
[   12.040568]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.040590]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.040612]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.040633]  kthread+0x337/0x6f0
[   12.040651]  ? trace_preempt_on+0x20/0xc0
[   12.040672]  ? __pfx_kthread+0x10/0x10
[   12.040691]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.040710]  ? calculate_sigpending+0x7b/0xa0
[   12.040734]  ? __pfx_kthread+0x10/0x10
[   12.040754]  ret_from_fork+0x116/0x1d0
[   12.040770]  ? __pfx_kthread+0x10/0x10
[   12.040789]  ret_from_fork_asm+0x1a/0x30
[   12.040818]  </TASK>
[   12.040828] 
[   12.053950] Allocated by task 185:
[   12.054138]  kasan_save_stack+0x45/0x70
[   12.054559]  kasan_save_track+0x18/0x40
[   12.054948]  kasan_save_alloc_info+0x3b/0x50
[   12.055293]  __kasan_kmalloc+0xb7/0xc0
[   12.055656]  __kmalloc_cache_noprof+0x189/0x420
[   12.055956]  kmalloc_uaf_16+0x15b/0x4c0
[   12.056155]  kunit_try_run_case+0x1a5/0x480
[   12.056348]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.056950]  kthread+0x337/0x6f0
[   12.057296]  ret_from_fork+0x116/0x1d0
[   12.057591]  ret_from_fork_asm+0x1a/0x30
[   12.057749] 
[   12.057847] Freed by task 185:
[   12.058025]  kasan_save_stack+0x45/0x70
[   12.058216]  kasan_save_track+0x18/0x40
[   12.058374]  kasan_save_free_info+0x3f/0x60
[   12.059074]  __kasan_slab_free+0x56/0x70
[   12.059271]  kfree+0x222/0x3f0
[   12.059752]  kmalloc_uaf_16+0x1d6/0x4c0
[   12.059951]  kunit_try_run_case+0x1a5/0x480
[   12.060277]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.060751]  kthread+0x337/0x6f0
[   12.060931]  ret_from_fork+0x116/0x1d0
[   12.061313]  ret_from_fork_asm+0x1a/0x30
[   12.061768] 
[   12.062015] The buggy address belongs to the object at ffff888101ccd2c0
[   12.062015]  which belongs to the cache kmalloc-16 of size 16
[   12.062752] The buggy address is located 0 bytes inside of
[   12.062752]  freed 16-byte region [ffff888101ccd2c0, ffff888101ccd2d0)
[   12.063293] 
[   12.063613] The buggy address belongs to the physical page:
[   12.063847] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101ccd
[   12.064350] flags: 0x200000000000000(node=0|zone=2)
[   12.064832] page_type: f5(slab)
[   12.065019] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   12.065617] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   12.066135] page dumped because: kasan: bad access detected
[   12.066558] 
[   12.066635] Memory state around the buggy address:
[   12.066842]  ffff888101ccd180: fa fb fc fc fa fb fc fc 00 00 fc fc 00 00 fc fc
[   12.067155]  ffff888101ccd200: 00 00 fc fc 00 00 fc fc fa fb fc fc fa fb fc fc
[   12.067780] >ffff888101ccd280: fa fb fc fc 00 00 fc fc fa fb fc fc fc fc fc fc
[   12.068092]                                            ^
[   12.068305]  ffff888101ccd300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.068856]  ffff888101ccd380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.069247] ==================================================================