Hay
Date
July 20, 2025, 8:11 p.m.

Environment
qemu-arm64
qemu-x86_64

[   15.300064] ==================================================================
[   15.300148] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x300/0x338
[   15.300278] Read of size 1 at addr fff00000c6086768 by task kunit_try_catch/185
[   15.300357] 
[   15.300414] CPU: 1 UID: 0 PID: 185 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   15.300562] Tainted: [B]=BAD_PAGE, [N]=TEST
[   15.300589] Hardware name: linux,dummy-virt (DT)
[   15.300879] Call trace:
[   15.300959]  show_stack+0x20/0x38 (C)
[   15.301055]  dump_stack_lvl+0x8c/0xd0
[   15.301731]  print_report+0x118/0x5d0
[   15.301792]  kasan_report+0xdc/0x128
[   15.301839]  __asan_report_load1_noabort+0x20/0x30
[   15.301919]  kmalloc_uaf+0x300/0x338
[   15.301982]  kunit_try_run_case+0x170/0x3f0
[   15.302304]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.302779]  kthread+0x328/0x630
[   15.302946]  ret_from_fork+0x10/0x20
[   15.303252] 
[   15.303304] Allocated by task 185:
[   15.303345]  kasan_save_stack+0x3c/0x68
[   15.303916]  kasan_save_track+0x20/0x40
[   15.304024]  kasan_save_alloc_info+0x40/0x58
[   15.304069]  __kasan_kmalloc+0xd4/0xd8
[   15.304133]  __kmalloc_cache_noprof+0x16c/0x3c0
[   15.304536]  kmalloc_uaf+0xb8/0x338
[   15.304656]  kunit_try_run_case+0x170/0x3f0
[   15.304816]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.304928]  kthread+0x328/0x630
[   15.305006]  ret_from_fork+0x10/0x20
[   15.305114] 
[   15.305196] Freed by task 185:
[   15.305310]  kasan_save_stack+0x3c/0x68
[   15.305389]  kasan_save_track+0x20/0x40
[   15.305490]  kasan_save_free_info+0x4c/0x78
[   15.305533]  __kasan_slab_free+0x6c/0x98
[   15.305571]  kfree+0x214/0x3c8
[   15.305609]  kmalloc_uaf+0x11c/0x338
[   15.305645]  kunit_try_run_case+0x170/0x3f0
[   15.305951]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.306111]  kthread+0x328/0x630
[   15.306179]  ret_from_fork+0x10/0x20
[   15.306264] 
[   15.306301] The buggy address belongs to the object at fff00000c6086760
[   15.306301]  which belongs to the cache kmalloc-16 of size 16
[   15.306375] The buggy address is located 8 bytes inside of
[   15.306375]  freed 16-byte region [fff00000c6086760, fff00000c6086770)
[   15.306447] 
[   15.306476] The buggy address belongs to the physical page:
[   15.306509] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106086
[   15.306561] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   15.306609] page_type: f5(slab)
[   15.306649] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   15.306707] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   15.306748] page dumped because: kasan: bad access detected
[   15.306780] 
[   15.306804] Memory state around the buggy address:
[   15.306836]  fff00000c6086600: 00 05 fc fc 00 00 fc fc 00 06 fc fc 00 06 fc fc
[   15.306889]  fff00000c6086680: 00 00 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   15.306954] >fff00000c6086700: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   15.306993]                                                           ^
[   15.307044]  fff00000c6086780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.307101]  fff00000c6086800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.307139] ==================================================================

[   13.191668] ==================================================================
[   13.192279] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x320/0x380
[   13.192834] Read of size 1 at addr ffff888101c73588 by task kunit_try_catch/202
[   13.193228] 
[   13.193553] CPU: 0 UID: 0 PID: 202 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   13.193614] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.193626] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.193648] Call Trace:
[   13.193660]  <TASK>
[   13.193676]  dump_stack_lvl+0x73/0xb0
[   13.193740]  print_report+0xd1/0x610
[   13.193764]  ? __virt_addr_valid+0x1db/0x2d0
[   13.193789]  ? kmalloc_uaf+0x320/0x380
[   13.193820]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.193842]  ? kmalloc_uaf+0x320/0x380
[   13.193862]  kasan_report+0x141/0x180
[   13.193884]  ? kmalloc_uaf+0x320/0x380
[   13.193936]  __asan_report_load1_noabort+0x18/0x20
[   13.193960]  kmalloc_uaf+0x320/0x380
[   13.193980]  ? __pfx_kmalloc_uaf+0x10/0x10
[   13.194011]  ? __schedule+0x10c6/0x2b60
[   13.194034]  ? __pfx_read_tsc+0x10/0x10
[   13.194177]  ? ktime_get_ts64+0x86/0x230
[   13.194204]  kunit_try_run_case+0x1a5/0x480
[   13.194230]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.194253]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.194277]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.194300]  ? __kthread_parkme+0x82/0x180
[   13.194322]  ? preempt_count_sub+0x50/0x80
[   13.194346]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.194369]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.194392]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.194415]  kthread+0x337/0x6f0
[   13.194434]  ? trace_preempt_on+0x20/0xc0
[   13.194458]  ? __pfx_kthread+0x10/0x10
[   13.194490]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.194512]  ? calculate_sigpending+0x7b/0xa0
[   13.194535]  ? __pfx_kthread+0x10/0x10
[   13.194556]  ret_from_fork+0x116/0x1d0
[   13.194575]  ? __pfx_kthread+0x10/0x10
[   13.194595]  ret_from_fork_asm+0x1a/0x30
[   13.194625]  </TASK>
[   13.194636] 
[   13.203354] Allocated by task 202:
[   13.203545]  kasan_save_stack+0x45/0x70
[   13.203693]  kasan_save_track+0x18/0x40
[   13.203830]  kasan_save_alloc_info+0x3b/0x50
[   13.204016]  __kasan_kmalloc+0xb7/0xc0
[   13.204257]  __kmalloc_cache_noprof+0x189/0x420
[   13.204693]  kmalloc_uaf+0xaa/0x380
[   13.204924]  kunit_try_run_case+0x1a5/0x480
[   13.205238]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.205449]  kthread+0x337/0x6f0
[   13.205637]  ret_from_fork+0x116/0x1d0
[   13.205952]  ret_from_fork_asm+0x1a/0x30
[   13.206240] 
[   13.206338] Freed by task 202:
[   13.206532]  kasan_save_stack+0x45/0x70
[   13.206720]  kasan_save_track+0x18/0x40
[   13.206964]  kasan_save_free_info+0x3f/0x60
[   13.207464]  __kasan_slab_free+0x56/0x70
[   13.207689]  kfree+0x222/0x3f0
[   13.207809]  kmalloc_uaf+0x12c/0x380
[   13.207940]  kunit_try_run_case+0x1a5/0x480
[   13.208087]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.208310]  kthread+0x337/0x6f0
[   13.208728]  ret_from_fork+0x116/0x1d0
[   13.209014]  ret_from_fork_asm+0x1a/0x30
[   13.209310] 
[   13.209420] The buggy address belongs to the object at ffff888101c73580
[   13.209420]  which belongs to the cache kmalloc-16 of size 16
[   13.210207] The buggy address is located 8 bytes inside of
[   13.210207]  freed 16-byte region [ffff888101c73580, ffff888101c73590)
[   13.210606] 
[   13.210682] The buggy address belongs to the physical page:
[   13.211017] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101c73
[   13.211557] flags: 0x200000000000000(node=0|zone=2)
[   13.211813] page_type: f5(slab)
[   13.212026] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   13.212289] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   13.212601] page dumped because: kasan: bad access detected
[   13.213243] 
[   13.213357] Memory state around the buggy address:
[   13.213651]  ffff888101c73480: fa fb fc fc fa fb fc fc fa fb fc fc 00 05 fc fc
[   13.214183]  ffff888101c73500: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   13.214550] >ffff888101c73580: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.214892]                       ^
[   13.215102]  ffff888101c73600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.215327]  ffff888101c73680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.215658] ==================================================================