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

Environment
qemu-arm64
qemu-x86_64

[   19.524850] ==================================================================
[   19.525067] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x3f4/0x468
[   19.525285] Read of size 1 at addr fff00000c640bfa8 by task kunit_try_catch/197
[   19.525461] 
[   19.525553] CPU: 0 UID: 0 PID: 197 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250616 #1 PREEMPT 
[   19.525755] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.525825] Hardware name: linux,dummy-virt (DT)
[   19.525925] Call trace:
[   19.526359]  show_stack+0x20/0x38 (C)
[   19.526698]  dump_stack_lvl+0x8c/0xd0
[   19.526855]  print_report+0x118/0x608
[   19.527050]  kasan_report+0xdc/0x128
[   19.527279]  __asan_report_load1_noabort+0x20/0x30
[   19.527508]  kmalloc_uaf2+0x3f4/0x468
[   19.527724]  kunit_try_run_case+0x170/0x3f0
[   19.528165]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.528437]  kthread+0x328/0x630
[   19.528586]  ret_from_fork+0x10/0x20
[   19.528716] 
[   19.528769] Allocated by task 197:
[   19.528853]  kasan_save_stack+0x3c/0x68
[   19.528962]  kasan_save_track+0x20/0x40
[   19.529063]  kasan_save_alloc_info+0x40/0x58
[   19.529169]  __kasan_kmalloc+0xd4/0xd8
[   19.529260]  __kmalloc_cache_noprof+0x16c/0x3c0
[   19.529362]  kmalloc_uaf2+0xc4/0x468
[   19.529448]  kunit_try_run_case+0x170/0x3f0
[   19.529862]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.530076]  kthread+0x328/0x630
[   19.530175]  ret_from_fork+0x10/0x20
[   19.530266] 
[   19.530368] Freed by task 197:
[   19.530471]  kasan_save_stack+0x3c/0x68
[   19.530669]  kasan_save_track+0x20/0x40
[   19.531006]  kasan_save_free_info+0x4c/0x78
[   19.531190]  __kasan_slab_free+0x6c/0x98
[   19.531309]  kfree+0x214/0x3c8
[   19.531397]  kmalloc_uaf2+0x134/0x468
[   19.531493]  kunit_try_run_case+0x170/0x3f0
[   19.531591]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.532192]  kthread+0x328/0x630
[   19.532415]  ret_from_fork+0x10/0x20
[   19.532748] 
[   19.532805] The buggy address belongs to the object at fff00000c640bf80
[   19.532805]  which belongs to the cache kmalloc-64 of size 64
[   19.533106] The buggy address is located 40 bytes inside of
[   19.533106]  freed 64-byte region [fff00000c640bf80, fff00000c640bfc0)
[   19.533384] 
[   19.533438] The buggy address belongs to the physical page:
[   19.533515] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10640b
[   19.533642] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.534160] page_type: f5(slab)
[   19.534382] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   19.534842] raw: 0000000000000000 0000000000200020 00000000f5000000 0000000000000000
[   19.535058] page dumped because: kasan: bad access detected
[   19.535199] 
[   19.535320] Memory state around the buggy address:
[   19.535413]  fff00000c640be80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   19.535547]  fff00000c640bf00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   19.535665] >fff00000c640bf80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   19.535773]                                   ^
[   19.535865]  fff00000c640c000: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   19.535973]  fff00000c640c080: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   19.536075] ==================================================================

[   11.753564] ==================================================================
[   11.753965] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x4a8/0x520
[   11.754184] Read of size 1 at addr ffff8881028c9728 by task kunit_try_catch/213
[   11.754400] 
[   11.754592] CPU: 1 UID: 0 PID: 213 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250616 #1 PREEMPT(voluntary) 
[   11.754637] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.754648] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.754668] Call Trace:
[   11.754679]  <TASK>
[   11.754696]  dump_stack_lvl+0x73/0xb0
[   11.754725]  print_report+0xd1/0x650
[   11.754748]  ? __virt_addr_valid+0x1db/0x2d0
[   11.754771]  ? kmalloc_uaf2+0x4a8/0x520
[   11.754790]  ? kasan_complete_mode_report_info+0x64/0x200
[   11.754811]  ? kmalloc_uaf2+0x4a8/0x520
[   11.754830]  kasan_report+0x141/0x180
[   11.754851]  ? kmalloc_uaf2+0x4a8/0x520
[   11.754875]  __asan_report_load1_noabort+0x18/0x20
[   11.754898]  kmalloc_uaf2+0x4a8/0x520
[   11.754917]  ? __pfx_kmalloc_uaf2+0x10/0x10
[   11.754946]  ? finish_task_switch.isra.0+0x153/0x700
[   11.754968]  ? __switch_to+0x47/0xf50
[   11.754994]  ? __schedule+0x10cc/0x2b60
[   11.755016]  ? __pfx_read_tsc+0x10/0x10
[   11.755037]  ? ktime_get_ts64+0x86/0x230
[   11.755062]  kunit_try_run_case+0x1a5/0x480
[   11.755087]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.755107]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.755128]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.755150]  ? __kthread_parkme+0x82/0x180
[   11.755170]  ? preempt_count_sub+0x50/0x80
[   11.755192]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.755214]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.755236]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.755257]  kthread+0x337/0x6f0
[   11.755276]  ? trace_preempt_on+0x20/0xc0
[   11.755299]  ? __pfx_kthread+0x10/0x10
[   11.755319]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.755338]  ? calculate_sigpending+0x7b/0xa0
[   11.755362]  ? __pfx_kthread+0x10/0x10
[   11.755383]  ret_from_fork+0x116/0x1d0
[   11.755400]  ? __pfx_kthread+0x10/0x10
[   11.755420]  ret_from_fork_asm+0x1a/0x30
[   11.755450]  </TASK>
[   11.755460] 
[   11.770525] Allocated by task 213:
[   11.770953]  kasan_save_stack+0x45/0x70
[   11.771321]  kasan_save_track+0x18/0x40
[   11.771717]  kasan_save_alloc_info+0x3b/0x50
[   11.772085]  __kasan_kmalloc+0xb7/0xc0
[   11.772214]  __kmalloc_cache_noprof+0x189/0x420
[   11.772364]  kmalloc_uaf2+0xc6/0x520
[   11.773026]  kunit_try_run_case+0x1a5/0x480
[   11.773426]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.773998]  kthread+0x337/0x6f0
[   11.774320]  ret_from_fork+0x116/0x1d0
[   11.774647]  ret_from_fork_asm+0x1a/0x30
[   11.774787] 
[   11.774852] Freed by task 213:
[   11.774974]  kasan_save_stack+0x45/0x70
[   11.775108]  kasan_save_track+0x18/0x40
[   11.775236]  kasan_save_free_info+0x3f/0x60
[   11.775372]  __kasan_slab_free+0x56/0x70
[   11.776089]  kfree+0x222/0x3f0
[   11.776397]  kmalloc_uaf2+0x14c/0x520
[   11.776735]  kunit_try_run_case+0x1a5/0x480
[   11.777281]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.777885]  kthread+0x337/0x6f0
[   11.778198]  ret_from_fork+0x116/0x1d0
[   11.778615]  ret_from_fork_asm+0x1a/0x30
[   11.778992] 
[   11.779154] The buggy address belongs to the object at ffff8881028c9700
[   11.779154]  which belongs to the cache kmalloc-64 of size 64
[   11.780265] The buggy address is located 40 bytes inside of
[   11.780265]  freed 64-byte region [ffff8881028c9700, ffff8881028c9740)
[   11.780949] 
[   11.781028] The buggy address belongs to the physical page:
[   11.781196] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1028c9
[   11.781551] flags: 0x200000000000000(node=0|zone=2)
[   11.782001] page_type: f5(slab)
[   11.782283] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   11.783133] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   11.783995] page dumped because: kasan: bad access detected
[   11.784754] 
[   11.784918] Memory state around the buggy address:
[   11.785270]  ffff8881028c9600: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.785743]  ffff8881028c9680: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.786288] >ffff8881028c9700: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.786595]                                   ^
[   11.787013]  ffff8881028c9780: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc
[   11.787720]  ffff8881028c9800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.788264] ==================================================================