Hay
Date
July 22, 2025, 2:40 p.m.

Environment
qemu-arm64
qemu-x86_64

[   17.333046] ==================================================================
[   17.333549] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x300/0x338
[   17.333705] Read of size 1 at addr fff00000c16d06c8 by task kunit_try_catch/186
[   17.333758] 
[   17.333815] CPU: 0 UID: 0 PID: 186 Comm: kunit_try_catch Tainted: G    B            N  6.15.8-rc1 #1 PREEMPT 
[   17.333929] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.333956] Hardware name: linux,dummy-virt (DT)
[   17.334329] Call trace:
[   17.334364]  show_stack+0x20/0x38 (C)
[   17.334419]  dump_stack_lvl+0x8c/0xd0
[   17.334561]  print_report+0x118/0x5d0
[   17.334647]  kasan_report+0xdc/0x128
[   17.334691]  __asan_report_load1_noabort+0x20/0x30
[   17.334855]  kmalloc_uaf+0x300/0x338
[   17.334900]  kunit_try_run_case+0x170/0x3f0
[   17.335141]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.335335]  kthread+0x328/0x630
[   17.335547]  ret_from_fork+0x10/0x20
[   17.335704] 
[   17.335741] Allocated by task 186:
[   17.335783]  kasan_save_stack+0x3c/0x68
[   17.335822]  kasan_save_track+0x20/0x40
[   17.335860]  kasan_save_alloc_info+0x40/0x58
[   17.335945]  __kasan_kmalloc+0xd4/0xd8
[   17.335996]  __kmalloc_cache_noprof+0x16c/0x3c0
[   17.336037]  kmalloc_uaf+0xb8/0x338
[   17.336081]  kunit_try_run_case+0x170/0x3f0
[   17.336129]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.336170]  kthread+0x328/0x630
[   17.336203]  ret_from_fork+0x10/0x20
[   17.336240] 
[   17.336260] Freed by task 186:
[   17.336298]  kasan_save_stack+0x3c/0x68
[   17.336351]  kasan_save_track+0x20/0x40
[   17.336392]  kasan_save_free_info+0x4c/0x78
[   17.336445]  __kasan_slab_free+0x6c/0x98
[   17.336483]  kfree+0x214/0x3c8
[   17.336520]  kmalloc_uaf+0x11c/0x338
[   17.336557]  kunit_try_run_case+0x170/0x3f0
[   17.336595]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.336645]  kthread+0x328/0x630
[   17.336679]  ret_from_fork+0x10/0x20
[   17.336716] 
[   17.336743] The buggy address belongs to the object at fff00000c16d06c0
[   17.336743]  which belongs to the cache kmalloc-16 of size 16
[   17.336808] The buggy address is located 8 bytes inside of
[   17.336808]  freed 16-byte region [fff00000c16d06c0, fff00000c16d06d0)
[   17.336867] 
[   17.336887] The buggy address belongs to the physical page:
[   17.336919] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1016d0
[   17.336990] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   17.337052] page_type: f5(slab)
[   17.337106] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   17.337162] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   17.337204] page dumped because: kasan: bad access detected
[   17.337235] 
[   17.337254] Memory state around the buggy address:
[   17.337605]  fff00000c16d0580: 00 05 fc fc 00 05 fc fc fa fb fc fc fa fb fc fc
[   17.337888]  fff00000c16d0600: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   17.338161] >fff00000c16d0680: fa fb fc fc fa fb fc fc fa fb fc fc fc fc fc fc
[   17.338228]                                               ^
[   17.338289]  fff00000c16d0700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.338508]  fff00000c16d0780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.338665] ==================================================================

[   11.345114] ==================================================================
[   11.346416] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x320/0x380
[   11.347511] Read of size 1 at addr ffff8881014ec8c8 by task kunit_try_catch/204
[   11.348059] 
[   11.348171] CPU: 0 UID: 0 PID: 204 Comm: kunit_try_catch Tainted: G    B            N  6.15.8-rc1 #1 PREEMPT(voluntary) 
[   11.348423] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.348435] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.348456] Call Trace:
[   11.348469]  <TASK>
[   11.348486]  dump_stack_lvl+0x73/0xb0
[   11.348514]  print_report+0xd1/0x610
[   11.348537]  ? __virt_addr_valid+0x1db/0x2d0
[   11.348560]  ? kmalloc_uaf+0x320/0x380
[   11.348580]  ? kasan_complete_mode_report_info+0x64/0x200
[   11.348602]  ? kmalloc_uaf+0x320/0x380
[   11.348622]  kasan_report+0x141/0x180
[   11.348644]  ? kmalloc_uaf+0x320/0x380
[   11.348669]  __asan_report_load1_noabort+0x18/0x20
[   11.348691]  kmalloc_uaf+0x320/0x380
[   11.348710]  ? __pfx_kmalloc_uaf+0x10/0x10
[   11.348731]  ? __schedule+0x10c6/0x2b60
[   11.348754]  ? __pfx_read_tsc+0x10/0x10
[   11.348774]  ? ktime_get_ts64+0x86/0x230
[   11.348800]  kunit_try_run_case+0x1a5/0x480
[   11.348821]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.348839]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.348860]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.348883]  ? __kthread_parkme+0x82/0x180
[   11.348904]  ? preempt_count_sub+0x50/0x80
[   11.348935]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.348954]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.348976]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.348999]  kthread+0x337/0x6f0
[   11.349015]  ? trace_preempt_on+0x20/0xc0
[   11.349038]  ? __pfx_kthread+0x10/0x10
[   11.349056]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.349077]  ? calculate_sigpending+0x7b/0xa0
[   11.349098]  ? __pfx_kthread+0x10/0x10
[   11.349116]  ret_from_fork+0x41/0x80
[   11.349136]  ? __pfx_kthread+0x10/0x10
[   11.349154]  ret_from_fork_asm+0x1a/0x30
[   11.349185]  </TASK>
[   11.349196] 
[   11.358562] Allocated by task 204:
[   11.358811]  kasan_save_stack+0x45/0x70
[   11.359008]  kasan_save_track+0x18/0x40
[   11.359177]  kasan_save_alloc_info+0x3b/0x50
[   11.359884]  __kasan_kmalloc+0xb7/0xc0
[   11.360069]  __kmalloc_cache_noprof+0x189/0x420
[   11.360245]  kmalloc_uaf+0xaa/0x380
[   11.360451]  kunit_try_run_case+0x1a5/0x480
[   11.360944]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.361176]  kthread+0x337/0x6f0
[   11.361492]  ret_from_fork+0x41/0x80
[   11.361652]  ret_from_fork_asm+0x1a/0x30
[   11.362023] 
[   11.362124] Freed by task 204:
[   11.362256]  kasan_save_stack+0x45/0x70
[   11.362588]  kasan_save_track+0x18/0x40
[   11.362948]  kasan_save_free_info+0x3f/0x60
[   11.363121]  __kasan_slab_free+0x56/0x70
[   11.363459]  kfree+0x222/0x3f0
[   11.363627]  kmalloc_uaf+0x12c/0x380
[   11.363778]  kunit_try_run_case+0x1a5/0x480
[   11.364145]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.364435]  kthread+0x337/0x6f0
[   11.364574]  ret_from_fork+0x41/0x80
[   11.364744]  ret_from_fork_asm+0x1a/0x30
[   11.364948] 
[   11.365019] The buggy address belongs to the object at ffff8881014ec8c0
[   11.365019]  which belongs to the cache kmalloc-16 of size 16
[   11.365971] The buggy address is located 8 bytes inside of
[   11.365971]  freed 16-byte region [ffff8881014ec8c0, ffff8881014ec8d0)
[   11.366519] 
[   11.366660] The buggy address belongs to the physical page:
[   11.367114] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1014ec
[   11.367654] flags: 0x200000000000000(node=0|zone=2)
[   11.368076] page_type: f5(slab)
[   11.368270] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   11.368708] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   11.369156] page dumped because: kasan: bad access detected
[   11.369348] 
[   11.369450] Memory state around the buggy address:
[   11.369946]  ffff8881014ec780: fa fb fc fc 00 02 fc fc 00 05 fc fc 00 02 fc fc
[   11.370272]  ffff8881014ec800: 00 02 fc fc 00 02 fc fc 00 02 fc fc fa fb fc fc
[   11.370786] >ffff8881014ec880: fa fb fc fc fa fb fc fc fa fb fc fc fc fc fc fc
[   11.371087]                                               ^
[   11.371466]  ffff8881014ec900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.371871]  ffff8881014ec980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.372275] ==================================================================