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

Environment
qemu-arm64
qemu-x86_64

[   30.585639] ==================================================================
[   30.586091] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x3bc/0x438
[   30.586210] Read of size 16 at addr fff00000c63602c0 by task kunit_try_catch/199
[   30.586282] 
[   30.586315] CPU: 0 UID: 0 PID: 199 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6-next-20250716 #1 PREEMPT 
[   30.586711] Tainted: [B]=BAD_PAGE, [N]=TEST
[   30.586784] Hardware name: linux,dummy-virt (DT)
[   30.586818] Call trace:
[   30.586850]  show_stack+0x20/0x38 (C)
[   30.586902]  dump_stack_lvl+0x8c/0xd0
[   30.587039]  print_report+0x118/0x5d0
[   30.587151]  kasan_report+0xdc/0x128
[   30.587344]  __asan_report_load16_noabort+0x20/0x30
[   30.587479]  kmalloc_uaf_16+0x3bc/0x438
[   30.587549]  kunit_try_run_case+0x170/0x3f0
[   30.587597]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.587984]  kthread+0x328/0x630
[   30.588186]  ret_from_fork+0x10/0x20
[   30.588303] 
[   30.588454] Allocated by task 199:
[   30.588495]  kasan_save_stack+0x3c/0x68
[   30.588713]  kasan_save_track+0x20/0x40
[   30.588919]  kasan_save_alloc_info+0x40/0x58
[   30.589074]  __kasan_kmalloc+0xd4/0xd8
[   30.589181]  __kmalloc_cache_noprof+0x16c/0x3c0
[   30.589315]  kmalloc_uaf_16+0x140/0x438
[   30.589430]  kunit_try_run_case+0x170/0x3f0
[   30.589476]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.589676]  kthread+0x328/0x630
[   30.589826]  ret_from_fork+0x10/0x20
[   30.589955] 
[   30.590012] Freed by task 199:
[   30.590115]  kasan_save_stack+0x3c/0x68
[   30.590211]  kasan_save_track+0x20/0x40
[   30.590589]  kasan_save_free_info+0x4c/0x78
[   30.590674]  __kasan_slab_free+0x6c/0x98
[   30.590820]  kfree+0x214/0x3c8
[   30.590888]  kmalloc_uaf_16+0x190/0x438
[   30.591334]  kunit_try_run_case+0x170/0x3f0
[   30.591729]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.591831]  kthread+0x328/0x630
[   30.591898]  ret_from_fork+0x10/0x20
[   30.591953] 
[   30.592007] The buggy address belongs to the object at fff00000c63602c0
[   30.592007]  which belongs to the cache kmalloc-16 of size 16
[   30.592607] The buggy address is located 0 bytes inside of
[   30.592607]  freed 16-byte region [fff00000c63602c0, fff00000c63602d0)
[   30.592799] 
[   30.593153] The buggy address belongs to the physical page:
[   30.593367] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106360
[   30.593605] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   30.593734] page_type: f5(slab)
[   30.593774] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   30.594005] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   30.594109] page dumped because: kasan: bad access detected
[   30.594429] 
[   30.594613] Memory state around the buggy address:
[   30.594767]  fff00000c6360180: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   30.594986]  fff00000c6360200: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   30.595111] >fff00000c6360280: fa fb fc fc 00 00 fc fc fa fb fc fc fc fc fc fc
[   30.595198]                                            ^
[   30.595303]  fff00000c6360300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.595347]  fff00000c6360380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.595848] ==================================================================

[   23.299024] ==================================================================
[   23.299502] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x47b/0x4c0
[   23.299761] Read of size 16 at addr ffff888101683a00 by task kunit_try_catch/217
[   23.300133] 
[   23.300219] CPU: 1 UID: 0 PID: 217 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6-next-20250716 #1 PREEMPT(voluntary) 
[   23.300280] Tainted: [B]=BAD_PAGE, [N]=TEST
[   23.300293] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   23.300313] Call Trace:
[   23.300326]  <TASK>
[   23.300343]  dump_stack_lvl+0x73/0xb0
[   23.300373]  print_report+0xd1/0x610
[   23.300395]  ? __virt_addr_valid+0x1db/0x2d0
[   23.300441]  ? kmalloc_uaf_16+0x47b/0x4c0
[   23.300462]  ? kasan_complete_mode_report_info+0x64/0x200
[   23.300487]  ? kmalloc_uaf_16+0x47b/0x4c0
[   23.300519]  kasan_report+0x141/0x180
[   23.300540]  ? kmalloc_uaf_16+0x47b/0x4c0
[   23.300576]  __asan_report_load16_noabort+0x18/0x20
[   23.300600]  kmalloc_uaf_16+0x47b/0x4c0
[   23.300621]  ? __pfx_kmalloc_uaf_16+0x10/0x10
[   23.300642]  ? __schedule+0x10c6/0x2b60
[   23.300664]  ? __pfx_read_tsc+0x10/0x10
[   23.300686]  ? ktime_get_ts64+0x86/0x230
[   23.300711]  kunit_try_run_case+0x1a5/0x480
[   23.300736]  ? __pfx_kunit_try_run_case+0x10/0x10
[   23.300759]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   23.300784]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   23.300806]  ? __kthread_parkme+0x82/0x180
[   23.300827]  ? preempt_count_sub+0x50/0x80
[   23.300867]  ? __pfx_kunit_try_run_case+0x10/0x10
[   23.300890]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   23.300916]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   23.300942]  kthread+0x337/0x6f0
[   23.300961]  ? trace_preempt_on+0x20/0xc0
[   23.300985]  ? __pfx_kthread+0x10/0x10
[   23.301005]  ? _raw_spin_unlock_irq+0x47/0x80
[   23.301025]  ? calculate_sigpending+0x7b/0xa0
[   23.301049]  ? __pfx_kthread+0x10/0x10
[   23.301070]  ret_from_fork+0x116/0x1d0
[   23.301089]  ? __pfx_kthread+0x10/0x10
[   23.301109]  ret_from_fork_asm+0x1a/0x30
[   23.301140]  </TASK>
[   23.301151] 
[   23.307135] Allocated by task 217:
[   23.307314]  kasan_save_stack+0x45/0x70
[   23.307448]  kasan_save_track+0x18/0x40
[   23.307572]  kasan_save_alloc_info+0x3b/0x50
[   23.307708]  __kasan_kmalloc+0xb7/0xc0
[   23.307865]  __kmalloc_cache_noprof+0x189/0x420
[   23.308075]  kmalloc_uaf_16+0x15b/0x4c0
[   23.308257]  kunit_try_run_case+0x1a5/0x480
[   23.308490]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   23.308890]  kthread+0x337/0x6f0
[   23.309002]  ret_from_fork+0x116/0x1d0
[   23.309126]  ret_from_fork_asm+0x1a/0x30
[   23.309256] 
[   23.309328] Freed by task 217:
[   23.309475]  kasan_save_stack+0x45/0x70
[   23.309797]  kasan_save_track+0x18/0x40
[   23.309985]  kasan_save_free_info+0x3f/0x60
[   23.310185]  __kasan_slab_free+0x56/0x70
[   23.310408]  kfree+0x222/0x3f0
[   23.310590]  kmalloc_uaf_16+0x1d6/0x4c0
[   23.310777]  kunit_try_run_case+0x1a5/0x480
[   23.310962]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   23.311129]  kthread+0x337/0x6f0
[   23.311237]  ret_from_fork+0x116/0x1d0
[   23.311370]  ret_from_fork_asm+0x1a/0x30
[   23.311499] 
[   23.311585] The buggy address belongs to the object at ffff888101683a00
[   23.311585]  which belongs to the cache kmalloc-16 of size 16
[   23.312102] The buggy address is located 0 bytes inside of
[   23.312102]  freed 16-byte region [ffff888101683a00, ffff888101683a10)
[   23.312631] 
[   23.312793] The buggy address belongs to the physical page:
[   23.313030] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101683
[   23.313259] flags: 0x200000000000000(node=0|zone=2)
[   23.313424] page_type: f5(slab)
[   23.313534] raw: 0200000000000000 ffff888100041640 dead000000000100 dead000000000122
[   23.313881] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   23.314213] page dumped because: kasan: bad access detected
[   23.314471] 
[   23.314596] Memory state around the buggy address:
[   23.314816]  ffff888101683900: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   23.315042]  ffff888101683980: fa fb fc fc fa fb fc fc fa fb fc fc 00 00 fc fc
[   23.315283] >ffff888101683a00: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.315631]                    ^
[   23.315750]  ffff888101683a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.315958]  ffff888101683b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.316258] ==================================================================