Hay
Date
July 9, 2025, 2:07 p.m.

Environment
qemu-arm64
qemu-x86_64

[   16.976535] ==================================================================
[   16.976986] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x3bc/0x438
[   16.977063] Read of size 16 at addr fff00000c3f1d760 by task kunit_try_catch/168
[   16.977571] 
[   16.977681] CPU: 0 UID: 0 PID: 168 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   16.977830] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.979013] Hardware name: linux,dummy-virt (DT)
[   16.979398] Call trace:
[   16.979439]  show_stack+0x20/0x38 (C)
[   16.979496]  dump_stack_lvl+0x8c/0xd0
[   16.979546]  print_report+0x118/0x608
[   16.979599]  kasan_report+0xdc/0x128
[   16.980446]  __asan_report_load16_noabort+0x20/0x30
[   16.980514]  kmalloc_uaf_16+0x3bc/0x438
[   16.980577]  kunit_try_run_case+0x170/0x3f0
[   16.980627]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.981039]  kthread+0x328/0x630
[   16.981105]  ret_from_fork+0x10/0x20
[   16.981156] 
[   16.981174] Allocated by task 168:
[   16.981204]  kasan_save_stack+0x3c/0x68
[   16.981367]  kasan_save_track+0x20/0x40
[   16.981412]  kasan_save_alloc_info+0x40/0x58
[   16.981506]  __kasan_kmalloc+0xd4/0xd8
[   16.981543]  __kmalloc_cache_noprof+0x16c/0x3c0
[   16.981908]  kmalloc_uaf_16+0x140/0x438
[   16.982028]  kunit_try_run_case+0x170/0x3f0
[   16.982291]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.982340]  kthread+0x328/0x630
[   16.982374]  ret_from_fork+0x10/0x20
[   16.982569] 
[   16.982593] Freed by task 168:
[   16.982622]  kasan_save_stack+0x3c/0x68
[   16.982664]  kasan_save_track+0x20/0x40
[   16.983065]  kasan_save_free_info+0x4c/0x78
[   16.983363]  __kasan_slab_free+0x6c/0x98
[   16.984337]  kfree+0x214/0x3c8
[   16.984374]  kmalloc_uaf_16+0x190/0x438
[   16.984419]  kunit_try_run_case+0x170/0x3f0
[   16.984457]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.984803]  kthread+0x328/0x630
[   16.984964]  ret_from_fork+0x10/0x20
[   16.985003] 
[   16.985023] The buggy address belongs to the object at fff00000c3f1d760
[   16.985023]  which belongs to the cache kmalloc-16 of size 16
[   16.985132] The buggy address is located 0 bytes inside of
[   16.985132]  freed 16-byte region [fff00000c3f1d760, fff00000c3f1d770)
[   16.985399] 
[   16.985426] The buggy address belongs to the physical page:
[   16.985618] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103f1d
[   16.985756] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   16.985830] page_type: f5(slab)
[   16.985963] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   16.986044] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   16.986164] page dumped because: kasan: bad access detected
[   16.986213] 
[   16.986239] Memory state around the buggy address:
[   16.986274]  fff00000c3f1d600: 00 00 fc fc 00 00 fc fc 00 00 fc fc 00 02 fc fc
[   16.986337]  fff00000c3f1d680: 00 02 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   16.986715] >fff00000c3f1d700: fa fb fc fc fa fb fc fc 00 00 fc fc fa fb fc fc
[   16.986871]                                                        ^
[   16.986949]  fff00000c3f1d780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.987025]  fff00000c3f1d800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.987136] ==================================================================

[   12.776710] ==================================================================
[   12.777677] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x47b/0x4c0
[   12.777941] Read of size 16 at addr ffff8881024345e0 by task kunit_try_catch/185
[   12.778224] 
[   12.778349] CPU: 0 UID: 0 PID: 185 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   12.778396] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.778408] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.778429] Call Trace:
[   12.778440]  <TASK>
[   12.778455]  dump_stack_lvl+0x73/0xb0
[   12.778484]  print_report+0xd1/0x650
[   12.778506]  ? __virt_addr_valid+0x1db/0x2d0
[   12.778528]  ? kmalloc_uaf_16+0x47b/0x4c0
[   12.778548]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.778570]  ? kmalloc_uaf_16+0x47b/0x4c0
[   12.778591]  kasan_report+0x141/0x180
[   12.778624]  ? kmalloc_uaf_16+0x47b/0x4c0
[   12.778648]  __asan_report_load16_noabort+0x18/0x20
[   12.778672]  kmalloc_uaf_16+0x47b/0x4c0
[   12.778693]  ? __pfx_kmalloc_uaf_16+0x10/0x10
[   12.778714]  ? __schedule+0x10cc/0x2b60
[   12.778736]  ? __pfx_read_tsc+0x10/0x10
[   12.778757]  ? ktime_get_ts64+0x86/0x230
[   12.778792]  kunit_try_run_case+0x1a5/0x480
[   12.778831]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.778854]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.778877]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.778900]  ? __kthread_parkme+0x82/0x180
[   12.778932]  ? preempt_count_sub+0x50/0x80
[   12.778957]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.778981]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.779004]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.779031]  kthread+0x337/0x6f0
[   12.779050]  ? trace_preempt_on+0x20/0xc0
[   12.779074]  ? __pfx_kthread+0x10/0x10
[   12.779093]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.779114]  ? calculate_sigpending+0x7b/0xa0
[   12.779138]  ? __pfx_kthread+0x10/0x10
[   12.779158]  ret_from_fork+0x116/0x1d0
[   12.779177]  ? __pfx_kthread+0x10/0x10
[   12.779196]  ret_from_fork_asm+0x1a/0x30
[   12.779227]  </TASK>
[   12.779237] 
[   12.786534] Allocated by task 185:
[   12.786725]  kasan_save_stack+0x45/0x70
[   12.787081]  kasan_save_track+0x18/0x40
[   12.787240]  kasan_save_alloc_info+0x3b/0x50
[   12.787388]  __kasan_kmalloc+0xb7/0xc0
[   12.787520]  __kmalloc_cache_noprof+0x189/0x420
[   12.787688]  kmalloc_uaf_16+0x15b/0x4c0
[   12.787823]  kunit_try_run_case+0x1a5/0x480
[   12.788491]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.788994]  kthread+0x337/0x6f0
[   12.789163]  ret_from_fork+0x116/0x1d0
[   12.789351]  ret_from_fork_asm+0x1a/0x30
[   12.789548] 
[   12.789721] Freed by task 185:
[   12.790044]  kasan_save_stack+0x45/0x70
[   12.790217]  kasan_save_track+0x18/0x40
[   12.790415]  kasan_save_free_info+0x3f/0x60
[   12.790638]  __kasan_slab_free+0x56/0x70
[   12.791250]  kfree+0x222/0x3f0
[   12.791723]  kmalloc_uaf_16+0x1d6/0x4c0
[   12.792008]  kunit_try_run_case+0x1a5/0x480
[   12.792271]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.792501]  kthread+0x337/0x6f0
[   12.792655]  ret_from_fork+0x116/0x1d0
[   12.793084]  ret_from_fork_asm+0x1a/0x30
[   12.793501] 
[   12.793578] The buggy address belongs to the object at ffff8881024345e0
[   12.793578]  which belongs to the cache kmalloc-16 of size 16
[   12.794528] The buggy address is located 0 bytes inside of
[   12.794528]  freed 16-byte region [ffff8881024345e0, ffff8881024345f0)
[   12.795001] 
[   12.795204] The buggy address belongs to the physical page:
[   12.795530] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102434
[   12.796044] flags: 0x200000000000000(node=0|zone=2)
[   12.796365] page_type: f5(slab)
[   12.796580] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   12.796952] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   12.797405] page dumped because: kasan: bad access detected
[   12.797622] 
[   12.797887] Memory state around the buggy address:
[   12.798177]  ffff888102434480: 00 01 fc fc 00 01 fc fc 00 04 fc fc 00 04 fc fc
[   12.798494]  ffff888102434500: fa fb fc fc fa fb fc fc fa fb fc fc 00 05 fc fc
[   12.798790] >ffff888102434580: fa fb fc fc fa fb fc fc 00 00 fc fc fa fb fc fc
[   12.799260]                                                        ^
[   12.799621]  ffff888102434600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.800188]  ffff888102434680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.800693] ==================================================================