Hay
Date
June 23, 2025, 7:07 a.m.

Environment
qemu-arm64
qemu-x86_64

[   33.139977] ==================================================================
[   33.140115] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x300/0x338
[   33.140234] Read of size 1 at addr fff00000c56f1308 by task kunit_try_catch/196
[   33.140347] 
[   33.140420] CPU: 1 UID: 0 PID: 196 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc3-next-20250623 #1 PREEMPT 
[   33.140613] Tainted: [B]=BAD_PAGE, [N]=TEST
[   33.140679] Hardware name: linux,dummy-virt (DT)
[   33.140763] Call trace:
[   33.140916]  show_stack+0x20/0x38 (C)
[   33.141142]  dump_stack_lvl+0x8c/0xd0
[   33.141318]  print_report+0x118/0x608
[   33.141463]  kasan_report+0xdc/0x128
[   33.141691]  __asan_report_load1_noabort+0x20/0x30
[   33.141912]  kmalloc_uaf+0x300/0x338
[   33.142064]  kunit_try_run_case+0x170/0x3f0
[   33.142248]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.142392]  kthread+0x328/0x630
[   33.142623]  ret_from_fork+0x10/0x20
[   33.142849] 
[   33.142960] Allocated by task 196:
[   33.143131]  kasan_save_stack+0x3c/0x68
[   33.143241]  kasan_save_track+0x20/0x40
[   33.143440]  kasan_save_alloc_info+0x40/0x58
[   33.143635]  __kasan_kmalloc+0xd4/0xd8
[   33.143808]  __kmalloc_cache_noprof+0x16c/0x3c0
[   33.143916]  kmalloc_uaf+0xb8/0x338
[   33.144010]  kunit_try_run_case+0x170/0x3f0
[   33.144665]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.145017]  kthread+0x328/0x630
[   33.145123]  ret_from_fork+0x10/0x20
[   33.145791] 
[   33.146051] Freed by task 196:
[   33.146125]  kasan_save_stack+0x3c/0x68
[   33.146226]  kasan_save_track+0x20/0x40
[   33.146319]  kasan_save_free_info+0x4c/0x78
[   33.147565]  __kasan_slab_free+0x6c/0x98
[   33.147915]  kfree+0x214/0x3c8
[   33.148786]  kmalloc_uaf+0x11c/0x338
[   33.149910]  kunit_try_run_case+0x170/0x3f0
[   33.150052]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.150150]  kthread+0x328/0x630
[   33.150199]  ret_from_fork+0x10/0x20
[   33.150243] 
[   33.150289] The buggy address belongs to the object at fff00000c56f1300
[   33.150289]  which belongs to the cache kmalloc-16 of size 16
[   33.150386] The buggy address is located 8 bytes inside of
[   33.150386]  freed 16-byte region [fff00000c56f1300, fff00000c56f1310)
[   33.150457] 
[   33.150483] The buggy address belongs to the physical page:
[   33.150520] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1056f1
[   33.150663] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   33.150787] page_type: f5(slab)
[   33.150874] raw: 0bfffe0000000000 fff00000c0001640 dead000000000100 dead000000000122
[   33.151100] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   33.151203] page dumped because: kasan: bad access detected
[   33.151285] 
[   33.151330] Memory state around the buggy address:
[   33.151408]  fff00000c56f1200: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   33.151509]  fff00000c56f1280: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   33.151608] >fff00000c56f1300: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   33.151734]                       ^
[   33.151859]  fff00000c56f1380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   33.151981]  fff00000c56f1400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   33.152121] ==================================================================

[   22.032296] ==================================================================
[   22.032768] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x320/0x380
[   22.033535] Read of size 1 at addr ffff888102370308 by task kunit_try_catch/213
[   22.033859] 
[   22.034043] CPU: 0 UID: 0 PID: 213 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc3-next-20250623 #1 PREEMPT(voluntary) 
[   22.034124] Tainted: [B]=BAD_PAGE, [N]=TEST
[   22.034366] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   22.034422] Call Trace:
[   22.034472]  <TASK>
[   22.034505]  dump_stack_lvl+0x73/0xb0
[   22.034584]  print_report+0xd1/0x650
[   22.034628]  ? __virt_addr_valid+0x1db/0x2d0
[   22.034673]  ? kmalloc_uaf+0x320/0x380
[   22.034945]  ? kasan_complete_mode_report_info+0x64/0x200
[   22.034971]  ? kmalloc_uaf+0x320/0x380
[   22.034988]  kasan_report+0x141/0x180
[   22.035007]  ? kmalloc_uaf+0x320/0x380
[   22.035028]  __asan_report_load1_noabort+0x18/0x20
[   22.035048]  kmalloc_uaf+0x320/0x380
[   22.035065]  ? __pfx_kmalloc_uaf+0x10/0x10
[   22.035093]  ? __schedule+0x10cc/0x2b60
[   22.035122]  ? __pfx_read_tsc+0x10/0x10
[   22.035151]  ? ktime_get_ts64+0x86/0x230
[   22.035184]  kunit_try_run_case+0x1a5/0x480
[   22.035207]  ? __pfx_kunit_try_run_case+0x10/0x10
[   22.035226]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   22.035246]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   22.035265]  ? __kthread_parkme+0x82/0x180
[   22.035282]  ? preempt_count_sub+0x50/0x80
[   22.035302]  ? __pfx_kunit_try_run_case+0x10/0x10
[   22.035323]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.035342]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   22.035362]  kthread+0x337/0x6f0
[   22.035395]  ? trace_preempt_on+0x20/0xc0
[   22.035419]  ? __pfx_kthread+0x10/0x10
[   22.035437]  ? _raw_spin_unlock_irq+0x47/0x80
[   22.035454]  ? calculate_sigpending+0x7b/0xa0
[   22.035475]  ? __pfx_kthread+0x10/0x10
[   22.035493]  ret_from_fork+0x116/0x1d0
[   22.035509]  ? __pfx_kthread+0x10/0x10
[   22.035526]  ret_from_fork_asm+0x1a/0x30
[   22.035555]  </TASK>
[   22.035566] 
[   22.047361] Allocated by task 213:
[   22.047506]  kasan_save_stack+0x45/0x70
[   22.048073]  kasan_save_track+0x18/0x40
[   22.048401]  kasan_save_alloc_info+0x3b/0x50
[   22.048904]  __kasan_kmalloc+0xb7/0xc0
[   22.049072]  __kmalloc_cache_noprof+0x189/0x420
[   22.049545]  kmalloc_uaf+0xaa/0x380
[   22.049765]  kunit_try_run_case+0x1a5/0x480
[   22.050609]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.050869]  kthread+0x337/0x6f0
[   22.051561]  ret_from_fork+0x116/0x1d0
[   22.051705]  ret_from_fork_asm+0x1a/0x30
[   22.051836] 
[   22.052109] Freed by task 213:
[   22.052367]  kasan_save_stack+0x45/0x70
[   22.052956]  kasan_save_track+0x18/0x40
[   22.053264]  kasan_save_free_info+0x3f/0x60
[   22.053519]  __kasan_slab_free+0x56/0x70
[   22.053727]  kfree+0x222/0x3f0
[   22.053870]  kmalloc_uaf+0x12c/0x380
[   22.054661]  kunit_try_run_case+0x1a5/0x480
[   22.054900]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.055050]  kthread+0x337/0x6f0
[   22.055278]  ret_from_fork+0x116/0x1d0
[   22.055587]  ret_from_fork_asm+0x1a/0x30
[   22.056613] 
[   22.056761] The buggy address belongs to the object at ffff888102370300
[   22.056761]  which belongs to the cache kmalloc-16 of size 16
[   22.057723] The buggy address is located 8 bytes inside of
[   22.057723]  freed 16-byte region [ffff888102370300, ffff888102370310)
[   22.058506] 
[   22.058678] The buggy address belongs to the physical page:
[   22.059397] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102370
[   22.059641] flags: 0x200000000000000(node=0|zone=2)
[   22.060066] page_type: f5(slab)
[   22.060439] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   22.060827] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   22.061656] page dumped because: kasan: bad access detected
[   22.061920] 
[   22.061992] Memory state around the buggy address:
[   22.062499]  ffff888102370200: 00 00 fc fc fa fb fc fc 00 04 fc fc fa fb fc fc
[   22.062772]  ffff888102370280: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   22.063789] >ffff888102370300: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.064092]                       ^
[   22.064730]  ffff888102370380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.065432]  ffff888102370400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.065794] ==================================================================