Hay
Date
June 5, 2025, 7:08 a.m.

Environment
qemu-arm64
qemu-x86_64

[   25.442221] ==================================================================
[   25.442357] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x3f4/0x468
[   25.442465] Read of size 1 at addr fff00000c776e3a8 by task kunit_try_catch/188
[   25.442588] 
[   25.442667] CPU: 0 UID: 0 PID: 188 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250605 #1 PREEMPT 
[   25.442897] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.442974] Hardware name: linux,dummy-virt (DT)
[   25.443066] Call trace:
[   25.443125]  show_stack+0x20/0x38 (C)
[   25.443702]  dump_stack_lvl+0x8c/0xd0
[   25.443905]  print_report+0x118/0x608
[   25.444052]  kasan_report+0xdc/0x128
[   25.444179]  __asan_report_load1_noabort+0x20/0x30
[   25.444322]  kmalloc_uaf2+0x3f4/0x468
[   25.444669]  kunit_try_run_case+0x170/0x3f0
[   25.446374]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   25.446458]  kthread+0x328/0x630
[   25.446519]  ret_from_fork+0x10/0x20
[   25.446624] 
[   25.446650] Allocated by task 188:
[   25.446688]  kasan_save_stack+0x3c/0x68
[   25.446738]  kasan_save_track+0x20/0x40
[   25.446785]  kasan_save_alloc_info+0x40/0x58
[   25.446835]  __kasan_kmalloc+0xd4/0xd8
[   25.446882]  __kmalloc_cache_noprof+0x16c/0x3c0
[   25.446933]  kmalloc_uaf2+0xc4/0x468
[   25.446975]  kunit_try_run_case+0x170/0x3f0
[   25.447024]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   25.447079]  kthread+0x328/0x630
[   25.447118]  ret_from_fork+0x10/0x20
[   25.447162] 
[   25.447185] Freed by task 188:
[   25.447217]  kasan_save_stack+0x3c/0x68
[   25.447265]  kasan_save_track+0x20/0x40
[   25.447310]  kasan_save_free_info+0x4c/0x78
[   25.447764]  __kasan_slab_free+0x6c/0x98
[   25.447876]  kfree+0x214/0x3c8
[   25.447971]  kmalloc_uaf2+0x134/0x468
[   25.448070]  kunit_try_run_case+0x170/0x3f0
[   25.448173]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   25.448305]  kthread+0x328/0x630
[   25.448426]  ret_from_fork+0x10/0x20
[   25.448874] 
[   25.449033] The buggy address belongs to the object at fff00000c776e380
[   25.449033]  which belongs to the cache kmalloc-64 of size 64
[   25.449207] The buggy address is located 40 bytes inside of
[   25.449207]  freed 64-byte region [fff00000c776e380, fff00000c776e3c0)
[   25.449381] 
[   25.449464] The buggy address belongs to the physical page:
[   25.449576] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10776e
[   25.449909] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   25.450092] page_type: f5(slab)
[   25.450189] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   25.450313] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   25.450440] page dumped because: kasan: bad access detected
[   25.450530] 
[   25.450583] Memory state around the buggy address:
[   25.451182]  fff00000c776e280: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   25.451491]  fff00000c776e300: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   25.451614] >fff00000c776e380: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   25.451717]                                   ^
[   25.451819]  fff00000c776e400: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc
[   25.452128]  fff00000c776e480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.452412] ==================================================================


[   11.713880] ==================================================================
[   11.714430] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x4a8/0x520
[   11.714745] Read of size 1 at addr ffff888102b3b3a8 by task kunit_try_catch/205
[   11.715038] 
[   11.715283] CPU: 0 UID: 0 PID: 205 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250605 #1 PREEMPT(voluntary) 
[   11.715331] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.715342] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.715363] Call Trace:
[   11.715374]  <TASK>
[   11.715389]  dump_stack_lvl+0x73/0xb0
[   11.715416]  print_report+0xd1/0x650
[   11.715437]  ? __virt_addr_valid+0x1db/0x2d0
[   11.715460]  ? kmalloc_uaf2+0x4a8/0x520
[   11.715480]  ? kasan_complete_mode_report_info+0x64/0x200
[   11.715502]  ? kmalloc_uaf2+0x4a8/0x520
[   11.715522]  kasan_report+0x141/0x180
[   11.715543]  ? kmalloc_uaf2+0x4a8/0x520
[   11.715567]  __asan_report_load1_noabort+0x18/0x20
[   11.715591]  kmalloc_uaf2+0x4a8/0x520
[   11.715611]  ? __pfx_kmalloc_uaf2+0x10/0x10
[   11.715632]  ? __kasan_check_write+0x18/0x20
[   11.715651]  ? queued_spin_lock_slowpath+0x116/0xb40
[   11.715691]  ? __pfx_queued_spin_lock_slowpath+0x10/0x10
[   11.715716]  ? __pfx_read_tsc+0x10/0x10
[   11.715738]  ? ktime_get_ts64+0x86/0x230
[   11.715762]  kunit_try_run_case+0x1a5/0x480
[   11.715784]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.715803]  ? _raw_spin_lock_irqsave+0xf9/0x100
[   11.715826]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.715850]  ? __kthread_parkme+0x82/0x180
[   11.715870]  ? preempt_count_sub+0x50/0x80
[   11.715905]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.715925]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.716001]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.716028]  kthread+0x337/0x6f0
[   11.716047]  ? trace_preempt_on+0x20/0xc0
[   11.716071]  ? __pfx_kthread+0x10/0x10
[   11.716091]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.716112]  ? calculate_sigpending+0x7b/0xa0
[   11.716137]  ? __pfx_kthread+0x10/0x10
[   11.716158]  ret_from_fork+0x116/0x1d0
[   11.716176]  ? __pfx_kthread+0x10/0x10
[   11.716195]  ret_from_fork_asm+0x1a/0x30
[   11.716225]  </TASK>
[   11.716236] 
[   11.724068] Allocated by task 205:
[   11.724229]  kasan_save_stack+0x45/0x70
[   11.724372]  kasan_save_track+0x18/0x40
[   11.724508]  kasan_save_alloc_info+0x3b/0x50
[   11.724657]  __kasan_kmalloc+0xb7/0xc0
[   11.724900]  __kmalloc_cache_noprof+0x189/0x420
[   11.725313]  kmalloc_uaf2+0xc6/0x520
[   11.725499]  kunit_try_run_case+0x1a5/0x480
[   11.725780]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.726089]  kthread+0x337/0x6f0
[   11.726231]  ret_from_fork+0x116/0x1d0
[   11.726421]  ret_from_fork_asm+0x1a/0x30
[   11.726599] 
[   11.726668] Freed by task 205:
[   11.726778]  kasan_save_stack+0x45/0x70
[   11.726925]  kasan_save_track+0x18/0x40
[   11.727060]  kasan_save_free_info+0x3f/0x60
[   11.727263]  __kasan_slab_free+0x56/0x70
[   11.727578]  kfree+0x222/0x3f0
[   11.727741]  kmalloc_uaf2+0x14c/0x520
[   11.727933]  kunit_try_run_case+0x1a5/0x480
[   11.728133]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.728447]  kthread+0x337/0x6f0
[   11.728660]  ret_from_fork+0x116/0x1d0
[   11.728807]  ret_from_fork_asm+0x1a/0x30
[   11.729010] 
[   11.729123] The buggy address belongs to the object at ffff888102b3b380
[   11.729123]  which belongs to the cache kmalloc-64 of size 64
[   11.729738] The buggy address is located 40 bytes inside of
[   11.729738]  freed 64-byte region [ffff888102b3b380, ffff888102b3b3c0)
[   11.730530] 
[   11.730649] The buggy address belongs to the physical page:
[   11.730831] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102b3b
[   11.731087] flags: 0x200000000000000(node=0|zone=2)
[   11.731250] page_type: f5(slab)
[   11.731418] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   11.733023] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   11.733367] page dumped because: kasan: bad access detected
[   11.733601] 
[   11.733847] Memory state around the buggy address:
[   11.734792]  ffff888102b3b280: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.735340]  ffff888102b3b300: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.735842] >ffff888102b3b380: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.736203]                                   ^
[   11.736399]  ffff888102b3b400: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc
[   11.736934]  ffff888102b3b480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.737637] ==================================================================