Hay
Date
June 2, 2025, 2:13 p.m.

Environment
qemu-arm64
qemu-x86_64

[   19.087011] ==================================================================
[   19.087784] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x3f4/0x468
[   19.088621] Read of size 1 at addr fff00000c65b1fa8 by task kunit_try_catch/178
[   19.089215] 
[   19.089819] CPU: 0 UID: 0 PID: 178 Comm: kunit_try_catch Tainted: G    B            N 6.14.10-rc1 #1
[   19.090008] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.090243] Hardware name: linux,dummy-virt (DT)
[   19.090329] Call trace:
[   19.090376]  show_stack+0x20/0x38 (C)
[   19.090499]  dump_stack_lvl+0x8c/0xd0
[   19.090599]  print_report+0x118/0x608
[   19.090709]  kasan_report+0xdc/0x128
[   19.090808]  __asan_report_load1_noabort+0x20/0x30
[   19.090900]  kmalloc_uaf2+0x3f4/0x468
[   19.090950]  kunit_try_run_case+0x170/0x3f0
[   19.091005]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.091063]  kthread+0x318/0x620
[   19.091116]  ret_from_fork+0x10/0x20
[   19.091202] 
[   19.095138] Allocated by task 178:
[   19.095569]  kasan_save_stack+0x3c/0x68
[   19.096003]  kasan_save_track+0x20/0x40
[   19.096580]  kasan_save_alloc_info+0x40/0x58
[   19.097046]  __kasan_kmalloc+0xd4/0xd8
[   19.097705]  __kmalloc_cache_noprof+0x16c/0x3c0
[   19.098406]  kmalloc_uaf2+0xc4/0x468
[   19.098750]  kunit_try_run_case+0x170/0x3f0
[   19.099068]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.099461]  kthread+0x318/0x620
[   19.099898]  ret_from_fork+0x10/0x20
[   19.101034] 
[   19.101342] Freed by task 178:
[   19.101620]  kasan_save_stack+0x3c/0x68
[   19.101965]  kasan_save_track+0x20/0x40
[   19.103491]  kasan_save_free_info+0x4c/0x78
[   19.103909]  __kasan_slab_free+0x6c/0x98
[   19.104266]  kfree+0x214/0x3c8
[   19.104565]  kmalloc_uaf2+0x134/0x468
[   19.104896]  kunit_try_run_case+0x170/0x3f0
[   19.105654]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.105998]  kthread+0x318/0x620
[   19.106855]  ret_from_fork+0x10/0x20
[   19.107218] 
[   19.107458] The buggy address belongs to the object at fff00000c65b1f80
[   19.107458]  which belongs to the cache kmalloc-64 of size 64
[   19.108597] The buggy address is located 40 bytes inside of
[   19.108597]  freed 64-byte region [fff00000c65b1f80, fff00000c65b1fc0)
[   19.109320] 
[   19.109786] The buggy address belongs to the physical page:
[   19.110138] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1065b1
[   19.111180] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.111598] page_type: f5(slab)
[   19.111869] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   19.112365] raw: 0000000000000000 0000000000200020 00000000f5000000 0000000000000000
[   19.113115] page dumped because: kasan: bad access detected
[   19.113978] 
[   19.114329] Memory state around the buggy address:
[   19.114657]  fff00000c65b1e80: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   19.115602]  fff00000c65b1f00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   19.116382] >fff00000c65b1f80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   19.116894]                                   ^
[   19.117524]  fff00000c65b2000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   19.118263]  fff00000c65b2080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   19.119006] ==================================================================

[   13.000145] ==================================================================
[   13.001005] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x4aa/0x520
[   13.001393] Read of size 1 at addr ffff888102a295a8 by task kunit_try_catch/196
[   13.001783] 
[   13.001971] CPU: 0 UID: 0 PID: 196 Comm: kunit_try_catch Tainted: G    B            N 6.14.10-rc1 #1
[   13.002010] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.002031] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.002051] Call Trace:
[   13.002063]  <TASK>
[   13.002080]  dump_stack_lvl+0x73/0xb0
[   13.002108]  print_report+0xd1/0x650
[   13.002132]  ? __virt_addr_valid+0x1db/0x2d0
[   13.002157]  ? kmalloc_uaf2+0x4aa/0x520
[   13.002179]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.002206]  ? kmalloc_uaf2+0x4aa/0x520
[   13.002228]  kasan_report+0x140/0x180
[   13.002252]  ? kmalloc_uaf2+0x4aa/0x520
[   13.002279]  __asan_report_load1_noabort+0x18/0x20
[   13.002305]  kmalloc_uaf2+0x4aa/0x520
[   13.002327]  ? __pfx_kmalloc_uaf2+0x10/0x10
[   13.002348]  ? finish_task_switch.isra.0+0x153/0x700
[   13.002375]  ? __switch_to+0x5d9/0xf60
[   13.002403]  ? __schedule+0xce8/0x2840
[   13.002429]  ? __pfx_read_tsc+0x10/0x10
[   13.002453]  ? ktime_get_ts64+0x86/0x230
[   13.002481]  kunit_try_run_case+0x1a6/0x480
[   13.002506]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.002530]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   13.002576]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.002602]  ? __kthread_parkme+0x82/0x160
[   13.002627]  ? preempt_count_sub+0x50/0x80
[   13.002653]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.002680]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.002708]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.002736]  kthread+0x324/0x6e0
[   13.002759]  ? trace_preempt_on+0x20/0xc0
[   13.002785]  ? __pfx_kthread+0x10/0x10
[   13.002809]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.002834]  ? calculate_sigpending+0x7b/0xa0
[   13.002858]  ? __pfx_kthread+0x10/0x10
[   13.002883]  ret_from_fork+0x41/0x80
[   13.002903]  ? __pfx_kthread+0x10/0x10
[   13.002928]  ret_from_fork_asm+0x1a/0x30
[   13.002961]  </TASK>
[   13.002971] 
[   13.014174] Allocated by task 196:
[   13.014493]  kasan_save_stack+0x45/0x70
[   13.014889]  kasan_save_track+0x18/0x40
[   13.015251]  kasan_save_alloc_info+0x3b/0x50
[   13.015670]  __kasan_kmalloc+0xb7/0xc0
[   13.016033]  __kmalloc_cache_noprof+0x18a/0x420
[   13.016456]  kmalloc_uaf2+0xc7/0x520
[   13.016811]  kunit_try_run_case+0x1a6/0x480
[   13.017135]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.017392]  kthread+0x324/0x6e0
[   13.017600]  ret_from_fork+0x41/0x80
[   13.017922]  ret_from_fork_asm+0x1a/0x30
[   13.018287] 
[   13.018446] Freed by task 196:
[   13.018761]  kasan_save_stack+0x45/0x70
[   13.019142]  kasan_save_track+0x18/0x40
[   13.019492]  kasan_save_free_info+0x3f/0x60
[   13.019893]  __kasan_slab_free+0x56/0x70
[   13.020041]  kfree+0x224/0x3f0
[   13.020158]  kmalloc_uaf2+0x14d/0x520
[   13.020289]  kunit_try_run_case+0x1a6/0x480
[   13.020433]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.020749]  kthread+0x324/0x6e0
[   13.021059]  ret_from_fork+0x41/0x80
[   13.021383]  ret_from_fork_asm+0x1a/0x30
[   13.021759] 
[   13.021916] The buggy address belongs to the object at ffff888102a29580
[   13.021916]  which belongs to the cache kmalloc-64 of size 64
[   13.022986] The buggy address is located 40 bytes inside of
[   13.022986]  freed 64-byte region [ffff888102a29580, ffff888102a295c0)
[   13.024008] 
[   13.024174] The buggy address belongs to the physical page:
[   13.024664] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102a29
[   13.025311] flags: 0x200000000000000(node=0|zone=2)
[   13.025477] page_type: f5(slab)
[   13.025708] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   13.026374] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   13.027044] page dumped because: kasan: bad access detected
[   13.027423] 
[   13.027492] Memory state around the buggy address:
[   13.027857]  ffff888102a29480: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   13.028476]  ffff888102a29500: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   13.028915] >ffff888102a29580: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   13.029138]                                   ^
[   13.029285]  ffff888102a29600: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc
[   13.029497]  ffff888102a29680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.030083] ==================================================================