Hay
Date
July 18, 2025, 11:11 p.m.

Environment
qemu-arm64
qemu-x86_64

[   15.505217] ==================================================================
[   15.505299] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x300/0x338
[   15.505438] Read of size 1 at addr fff00000c3ef7de8 by task kunit_try_catch/184
[   15.505493] 
[   15.505829] CPU: 1 UID: 0 PID: 184 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   15.505957] Tainted: [B]=BAD_PAGE, [N]=TEST
[   15.506215] Hardware name: linux,dummy-virt (DT)
[   15.506436] Call trace:
[   15.506537]  show_stack+0x20/0x38 (C)
[   15.506638]  dump_stack_lvl+0x8c/0xd0
[   15.506752]  print_report+0x118/0x5d0
[   15.506845]  kasan_report+0xdc/0x128
[   15.506970]  __asan_report_load1_noabort+0x20/0x30
[   15.507070]  kmalloc_uaf+0x300/0x338
[   15.507150]  kunit_try_run_case+0x170/0x3f0
[   15.507252]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.507628]  kthread+0x328/0x630
[   15.508012]  ret_from_fork+0x10/0x20
[   15.508202] 
[   15.508344] Allocated by task 184:
[   15.508418]  kasan_save_stack+0x3c/0x68
[   15.508734]  kasan_save_track+0x20/0x40
[   15.508984]  kasan_save_alloc_info+0x40/0x58
[   15.509143]  __kasan_kmalloc+0xd4/0xd8
[   15.509261]  __kmalloc_cache_noprof+0x16c/0x3c0
[   15.509478]  kmalloc_uaf+0xb8/0x338
[   15.509660]  kunit_try_run_case+0x170/0x3f0
[   15.509736]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.509882]  kthread+0x328/0x630
[   15.509942]  ret_from_fork+0x10/0x20
[   15.510005] 
[   15.510025] Freed by task 184:
[   15.510177]  kasan_save_stack+0x3c/0x68
[   15.510422]  kasan_save_track+0x20/0x40
[   15.510631]  kasan_save_free_info+0x4c/0x78
[   15.510838]  __kasan_slab_free+0x6c/0x98
[   15.510945]  kfree+0x214/0x3c8
[   15.511023]  kmalloc_uaf+0x11c/0x338
[   15.511065]  kunit_try_run_case+0x170/0x3f0
[   15.511246]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.511454]  kthread+0x328/0x630
[   15.511604]  ret_from_fork+0x10/0x20
[   15.511679] 
[   15.511699] The buggy address belongs to the object at fff00000c3ef7de0
[   15.511699]  which belongs to the cache kmalloc-16 of size 16
[   15.512143] The buggy address is located 8 bytes inside of
[   15.512143]  freed 16-byte region [fff00000c3ef7de0, fff00000c3ef7df0)
[   15.512299] 
[   15.512591] The buggy address belongs to the physical page:
[   15.512650] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103ef7
[   15.512777] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   15.512857] page_type: f5(slab)
[   15.513198] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   15.513391] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   15.513481] page dumped because: kasan: bad access detected
[   15.513514] 
[   15.513532] Memory state around the buggy address:
[   15.513566]  fff00000c3ef7c80: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   15.513925]  fff00000c3ef7d00: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   15.514065] >fff00000c3ef7d80: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   15.514173]                                                           ^
[   15.514294]  fff00000c3ef7e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.514572]  fff00000c3ef7e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.514741] ==================================================================

[   12.427766] ==================================================================
[   12.428821] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x320/0x380
[   12.429311] Read of size 1 at addr ffff88810216cb48 by task kunit_try_catch/203
[   12.429979] 
[   12.430301] CPU: 0 UID: 0 PID: 203 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   12.430354] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.430366] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.430387] Call Trace:
[   12.430400]  <TASK>
[   12.430417]  dump_stack_lvl+0x73/0xb0
[   12.430449]  print_report+0xd1/0x610
[   12.430472]  ? __virt_addr_valid+0x1db/0x2d0
[   12.430495]  ? kmalloc_uaf+0x320/0x380
[   12.430514]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.430536]  ? kmalloc_uaf+0x320/0x380
[   12.430555]  kasan_report+0x141/0x180
[   12.430578]  ? kmalloc_uaf+0x320/0x380
[   12.430602]  __asan_report_load1_noabort+0x18/0x20
[   12.430625]  kmalloc_uaf+0x320/0x380
[   12.430644]  ? __pfx_kmalloc_uaf+0x10/0x10
[   12.430665]  ? __schedule+0x10cc/0x2b60
[   12.430688]  ? __pfx_read_tsc+0x10/0x10
[   12.430708]  ? ktime_get_ts64+0x86/0x230
[   12.430733]  kunit_try_run_case+0x1a5/0x480
[   12.430757]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.430779]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.430802]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.430825]  ? __kthread_parkme+0x82/0x180
[   12.430847]  ? preempt_count_sub+0x50/0x80
[   12.430872]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.430897]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.430921]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.430944]  kthread+0x337/0x6f0
[   12.430962]  ? trace_preempt_on+0x20/0xc0
[   12.430986]  ? __pfx_kthread+0x10/0x10
[   12.431006]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.431026]  ? calculate_sigpending+0x7b/0xa0
[   12.431050]  ? __pfx_kthread+0x10/0x10
[   12.431070]  ret_from_fork+0x116/0x1d0
[   12.431089]  ? __pfx_kthread+0x10/0x10
[   12.431110]  ret_from_fork_asm+0x1a/0x30
[   12.431140]  </TASK>
[   12.431150] 
[   12.444105] Allocated by task 203:
[   12.444477]  kasan_save_stack+0x45/0x70
[   12.444848]  kasan_save_track+0x18/0x40
[   12.445216]  kasan_save_alloc_info+0x3b/0x50
[   12.445573]  __kasan_kmalloc+0xb7/0xc0
[   12.445845]  __kmalloc_cache_noprof+0x189/0x420
[   12.446006]  kmalloc_uaf+0xaa/0x380
[   12.446132]  kunit_try_run_case+0x1a5/0x480
[   12.446286]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.446521]  kthread+0x337/0x6f0
[   12.446663]  ret_from_fork+0x116/0x1d0
[   12.446795]  ret_from_fork_asm+0x1a/0x30
[   12.446988] 
[   12.447092] Freed by task 203:
[   12.447223]  kasan_save_stack+0x45/0x70
[   12.447412]  kasan_save_track+0x18/0x40
[   12.447658]  kasan_save_free_info+0x3f/0x60
[   12.447870]  __kasan_slab_free+0x56/0x70
[   12.448049]  kfree+0x222/0x3f0
[   12.448221]  kmalloc_uaf+0x12c/0x380
[   12.448361]  kunit_try_run_case+0x1a5/0x480
[   12.448507]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.448827]  kthread+0x337/0x6f0
[   12.449000]  ret_from_fork+0x116/0x1d0
[   12.449185]  ret_from_fork_asm+0x1a/0x30
[   12.449386] 
[   12.449488] The buggy address belongs to the object at ffff88810216cb40
[   12.449488]  which belongs to the cache kmalloc-16 of size 16
[   12.449903] The buggy address is located 8 bytes inside of
[   12.449903]  freed 16-byte region [ffff88810216cb40, ffff88810216cb50)
[   12.450442] 
[   12.450542] The buggy address belongs to the physical page:
[   12.450761] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10216c
[   12.451100] flags: 0x200000000000000(node=0|zone=2)
[   12.451322] page_type: f5(slab)
[   12.451502] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   12.451809] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   12.452052] page dumped because: kasan: bad access detected
[   12.452223] 
[   12.452300] Memory state around the buggy address:
[   12.452485]  ffff88810216ca00: 00 02 fc fc 00 02 fc fc 00 02 fc fc 00 02 fc fc
[   12.452821]  ffff88810216ca80: fa fb fc fc fa fb fc fc fa fb fc fc 00 05 fc fc
[   12.453143] >ffff88810216cb00: fa fb fc fc fa fb fc fc fa fb fc fc fc fc fc fc
[   12.453390]                                               ^
[   12.453562]  ffff88810216cb80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.453874]  ffff88810216cc00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.454217] ==================================================================