Hay
Date
July 23, 2025, 2:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   15.521707] ==================================================================
[   15.521769] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x300/0x338
[   15.522515] Read of size 1 at addr fff00000c3ec4148 by task kunit_try_catch/184
[   15.522886] 
[   15.522957] CPU: 1 UID: 0 PID: 184 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7 #1 PREEMPT 
[   15.523056] Tainted: [B]=BAD_PAGE, [N]=TEST
[   15.523082] Hardware name: linux,dummy-virt (DT)
[   15.523131] Call trace:
[   15.523163]  show_stack+0x20/0x38 (C)
[   15.523225]  dump_stack_lvl+0x8c/0xd0
[   15.523277]  print_report+0x118/0x5d0
[   15.523332]  kasan_report+0xdc/0x128
[   15.523378]  __asan_report_load1_noabort+0x20/0x30
[   15.523430]  kmalloc_uaf+0x300/0x338
[   15.523471]  kunit_try_run_case+0x170/0x3f0
[   15.523518]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.523569]  kthread+0x328/0x630
[   15.523618]  ret_from_fork+0x10/0x20
[   15.523667] 
[   15.523686] Allocated by task 184:
[   15.523727]  kasan_save_stack+0x3c/0x68
[   15.523768]  kasan_save_track+0x20/0x40
[   15.523804]  kasan_save_alloc_info+0x40/0x58
[   15.523846]  __kasan_kmalloc+0xd4/0xd8
[   15.523897]  __kmalloc_cache_noprof+0x16c/0x3c0
[   15.523937]  kmalloc_uaf+0xb8/0x338
[   15.523987]  kunit_try_run_case+0x170/0x3f0
[   15.524035]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.524082]  kthread+0x328/0x630
[   15.524120]  ret_from_fork+0x10/0x20
[   15.524176] 
[   15.524195] Freed by task 184:
[   15.524222]  kasan_save_stack+0x3c/0x68
[   15.524266]  kasan_save_track+0x20/0x40
[   15.524304]  kasan_save_free_info+0x4c/0x78
[   15.524352]  __kasan_slab_free+0x6c/0x98
[   15.524390]  kfree+0x214/0x3c8
[   15.524434]  kmalloc_uaf+0x11c/0x338
[   15.524477]  kunit_try_run_case+0x170/0x3f0
[   15.524516]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.524570]  kthread+0x328/0x630
[   15.524614]  ret_from_fork+0x10/0x20
[   15.524650] 
[   15.524671] The buggy address belongs to the object at fff00000c3ec4140
[   15.524671]  which belongs to the cache kmalloc-16 of size 16
[   15.524731] The buggy address is located 8 bytes inside of
[   15.524731]  freed 16-byte region [fff00000c3ec4140, fff00000c3ec4150)
[   15.524797] 
[   15.524834] The buggy address belongs to the physical page:
[   15.525168] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103ec4
[   15.525474] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   15.525958] page_type: f5(slab)
[   15.526364] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   15.526441] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   15.526514] page dumped because: kasan: bad access detected
[   15.526580] 
[   15.526635] Memory state around the buggy address:
[   15.526878]  fff00000c3ec4000: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   15.526946]  fff00000c3ec4080: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   15.527230] >fff00000c3ec4100: fa fb fc fc fa fb fc fc fa fb fc fc fc fc fc fc
[   15.527302]                                               ^
[   15.527779]  fff00000c3ec4180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.527938]  fff00000c3ec4200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.528016] ==================================================================

[   12.833467] ==================================================================
[   12.834430] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x320/0x380
[   12.834754] Read of size 1 at addr ffff888102261f88 by task kunit_try_catch/201
[   12.835075] 
[   12.835197] CPU: 0 UID: 0 PID: 201 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7 #1 PREEMPT(voluntary) 
[   12.835239] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.835250] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.835270] Call Trace:
[   12.835281]  <TASK>
[   12.835295]  dump_stack_lvl+0x73/0xb0
[   12.835323]  print_report+0xd1/0x610
[   12.835344]  ? __virt_addr_valid+0x1db/0x2d0
[   12.835366]  ? kmalloc_uaf+0x320/0x380
[   12.835385]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.835406]  ? kmalloc_uaf+0x320/0x380
[   12.835425]  kasan_report+0x141/0x180
[   12.835446]  ? kmalloc_uaf+0x320/0x380
[   12.835470]  __asan_report_load1_noabort+0x18/0x20
[   12.835493]  kmalloc_uaf+0x320/0x380
[   12.835513]  ? __pfx_kmalloc_uaf+0x10/0x10
[   12.835533]  ? __schedule+0x10c6/0x2b60
[   12.835555]  ? __pfx_read_tsc+0x10/0x10
[   12.835574]  ? ktime_get_ts64+0x86/0x230
[   12.835597]  kunit_try_run_case+0x1a5/0x480
[   12.835621]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.835643]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.835666]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.835688]  ? __kthread_parkme+0x82/0x180
[   12.835708]  ? preempt_count_sub+0x50/0x80
[   12.835731]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.835754]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.835776]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.835799]  kthread+0x337/0x6f0
[   12.835830]  ? trace_preempt_on+0x20/0xc0
[   12.835852]  ? __pfx_kthread+0x10/0x10
[   12.835872]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.835893]  ? calculate_sigpending+0x7b/0xa0
[   12.835916]  ? __pfx_kthread+0x10/0x10
[   12.835937]  ret_from_fork+0x116/0x1d0
[   12.835955]  ? __pfx_kthread+0x10/0x10
[   12.835975]  ret_from_fork_asm+0x1a/0x30
[   12.836003]  </TASK>
[   12.836013] 
[   12.842738] Allocated by task 201:
[   12.842927]  kasan_save_stack+0x45/0x70
[   12.843395]  kasan_save_track+0x18/0x40
[   12.843582]  kasan_save_alloc_info+0x3b/0x50
[   12.843775]  __kasan_kmalloc+0xb7/0xc0
[   12.843972]  __kmalloc_cache_noprof+0x189/0x420
[   12.844193]  kmalloc_uaf+0xaa/0x380
[   12.844389]  kunit_try_run_case+0x1a5/0x480
[   12.844541]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.844718]  kthread+0x337/0x6f0
[   12.844857]  ret_from_fork+0x116/0x1d0
[   12.844994]  ret_from_fork_asm+0x1a/0x30
[   12.845215] 
[   12.845310] Freed by task 201:
[   12.845581]  kasan_save_stack+0x45/0x70
[   12.846017]  kasan_save_track+0x18/0x40
[   12.846173]  kasan_save_free_info+0x3f/0x60
[   12.846364]  __kasan_slab_free+0x56/0x70
[   12.846503]  kfree+0x222/0x3f0
[   12.846621]  kmalloc_uaf+0x12c/0x380
[   12.846924]  kunit_try_run_case+0x1a5/0x480
[   12.847150]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.847549]  kthread+0x337/0x6f0
[   12.847730]  ret_from_fork+0x116/0x1d0
[   12.847935]  ret_from_fork_asm+0x1a/0x30
[   12.848188] 
[   12.848287] The buggy address belongs to the object at ffff888102261f80
[   12.848287]  which belongs to the cache kmalloc-16 of size 16
[   12.848669] The buggy address is located 8 bytes inside of
[   12.848669]  freed 16-byte region [ffff888102261f80, ffff888102261f90)
[   12.850758] 
[   12.851141] The buggy address belongs to the physical page:
[   12.852012] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102261
[   12.852771] flags: 0x200000000000000(node=0|zone=2)
[   12.852961] page_type: f5(slab)
[   12.853090] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   12.853316] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   12.853535] page dumped because: kasan: bad access detected
[   12.853702] 
[   12.853772] Memory state around the buggy address:
[   12.853937]  ffff888102261e80: 00 02 fc fc 00 02 fc fc 00 02 fc fc fa fb fc fc
[   12.854151]  ffff888102261f00: fa fb fc fc fa fb fc fc 00 05 fc fc fa fb fc fc
[   12.854361] >ffff888102261f80: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.854574]                       ^
[   12.854700]  ffff888102262000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   12.855253]  ffff888102262080: fb fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb
[   12.856055] ==================================================================