Hay
Date
June 19, 2025, 12:07 p.m.

Environment
qemu-arm64
qemu-x86_64

[   30.771201] ==================================================================
[   30.771392] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x3f4/0x468
[   30.771542] Read of size 1 at addr fff00000c7738528 by task kunit_try_catch/199
[   30.771668] 
[   30.771760] CPU: 1 UID: 0 PID: 199 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250619 #1 PREEMPT 
[   30.771992] Tainted: [B]=BAD_PAGE, [N]=TEST
[   30.772059] Hardware name: linux,dummy-virt (DT)
[   30.772143] Call trace:
[   30.772199]  show_stack+0x20/0x38 (C)
[   30.772327]  dump_stack_lvl+0x8c/0xd0
[   30.772452]  print_report+0x118/0x608
[   30.772567]  kasan_report+0xdc/0x128
[   30.772680]  __asan_report_load1_noabort+0x20/0x30
[   30.772810]  kmalloc_uaf2+0x3f4/0x468
[   30.772940]  kunit_try_run_case+0x170/0x3f0
[   30.773056]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.773241]  kthread+0x328/0x630
[   30.773333]  ret_from_fork+0x10/0x20
[   30.773464] 
[   30.773504] Allocated by task 199:
[   30.773569]  kasan_save_stack+0x3c/0x68
[   30.773667]  kasan_save_track+0x20/0x40
[   30.773763]  kasan_save_alloc_info+0x40/0x58
[   30.773865]  __kasan_kmalloc+0xd4/0xd8
[   30.773960]  __kmalloc_cache_noprof+0x16c/0x3c0
[   30.774106]  kmalloc_uaf2+0xc4/0x468
[   30.774196]  kunit_try_run_case+0x170/0x3f0
[   30.774292]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.774395]  kthread+0x328/0x630
[   30.774477]  ret_from_fork+0x10/0x20
[   30.774566] 
[   30.774612] Freed by task 199:
[   30.774681]  kasan_save_stack+0x3c/0x68
[   30.774775]  kasan_save_track+0x20/0x40
[   30.774849]  kasan_save_free_info+0x4c/0x78
[   30.774958]  __kasan_slab_free+0x6c/0x98
[   30.775051]  kfree+0x214/0x3c8
[   30.775133]  kmalloc_uaf2+0x134/0x468
[   30.775207]  kunit_try_run_case+0x170/0x3f0
[   30.775326]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.775428]  kthread+0x328/0x630
[   30.775502]  ret_from_fork+0x10/0x20
[   30.775588] 
[   30.775632] The buggy address belongs to the object at fff00000c7738500
[   30.775632]  which belongs to the cache kmalloc-64 of size 64
[   30.775793] The buggy address is located 40 bytes inside of
[   30.775793]  freed 64-byte region [fff00000c7738500, fff00000c7738540)
[   30.775942] 
[   30.775990] The buggy address belongs to the physical page:
[   30.776075] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107738
[   30.776233] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   30.776394] page_type: f5(slab)
[   30.776499] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   30.776621] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   30.776713] page dumped because: kasan: bad access detected
[   30.776791] 
[   30.776835] Memory state around the buggy address:
[   30.776930]  fff00000c7738400: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   30.777040]  fff00000c7738480: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   30.777146] >fff00000c7738500: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   30.777237]                                   ^
[   30.777315]  fff00000c7738580: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc
[   30.777423]  fff00000c7738600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.777522] ==================================================================

[   27.294117] ==================================================================
[   27.294700] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x4a8/0x520
[   27.295535] Read of size 1 at addr ffff888103257a28 by task kunit_try_catch/217
[   27.296292] 
[   27.296799] CPU: 0 UID: 0 PID: 217 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250619 #1 PREEMPT(voluntary) 
[   27.296887] Tainted: [B]=BAD_PAGE, [N]=TEST
[   27.296903] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   27.296931] Call Trace:
[   27.296951]  <TASK>
[   27.296975]  dump_stack_lvl+0x73/0xb0
[   27.297023]  print_report+0xd1/0x650
[   27.297050]  ? __virt_addr_valid+0x1db/0x2d0
[   27.297076]  ? kmalloc_uaf2+0x4a8/0x520
[   27.297097]  ? kasan_complete_mode_report_info+0x64/0x200
[   27.297279]  ? kmalloc_uaf2+0x4a8/0x520
[   27.297303]  kasan_report+0x141/0x180
[   27.297328]  ? kmalloc_uaf2+0x4a8/0x520
[   27.297354]  __asan_report_load1_noabort+0x18/0x20
[   27.297381]  kmalloc_uaf2+0x4a8/0x520
[   27.297403]  ? __pfx_kmalloc_uaf2+0x10/0x10
[   27.297425]  ? finish_task_switch.isra.0+0x153/0x700
[   27.297451]  ? __switch_to+0x47/0xf50
[   27.297480]  ? __schedule+0x10cc/0x2b60
[   27.297505]  ? __pfx_read_tsc+0x10/0x10
[   27.297529]  ? ktime_get_ts64+0x86/0x230
[   27.297557]  kunit_try_run_case+0x1a5/0x480
[   27.297586]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.297610]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   27.297636]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   27.297661]  ? __kthread_parkme+0x82/0x180
[   27.297684]  ? preempt_count_sub+0x50/0x80
[   27.297708]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.297734]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.297759]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   27.297783]  kthread+0x337/0x6f0
[   27.297804]  ? trace_preempt_on+0x20/0xc0
[   27.297830]  ? __pfx_kthread+0x10/0x10
[   27.297852]  ? _raw_spin_unlock_irq+0x47/0x80
[   27.297875]  ? calculate_sigpending+0x7b/0xa0
[   27.297902]  ? __pfx_kthread+0x10/0x10
[   27.297925]  ret_from_fork+0x116/0x1d0
[   27.297946]  ? __pfx_kthread+0x10/0x10
[   27.298147]  ret_from_fork_asm+0x1a/0x30
[   27.298182]  </TASK>
[   27.298196] 
[   27.310625] Allocated by task 217:
[   27.311182]  kasan_save_stack+0x45/0x70
[   27.311559]  kasan_save_track+0x18/0x40
[   27.311827]  kasan_save_alloc_info+0x3b/0x50
[   27.312616]  __kasan_kmalloc+0xb7/0xc0
[   27.312804]  __kmalloc_cache_noprof+0x189/0x420
[   27.313207]  kmalloc_uaf2+0xc6/0x520
[   27.313374]  kunit_try_run_case+0x1a5/0x480
[   27.314249]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.314678]  kthread+0x337/0x6f0
[   27.314916]  ret_from_fork+0x116/0x1d0
[   27.315278]  ret_from_fork_asm+0x1a/0x30
[   27.315491] 
[   27.315594] Freed by task 217:
[   27.315730]  kasan_save_stack+0x45/0x70
[   27.315921]  kasan_save_track+0x18/0x40
[   27.316261]  kasan_save_free_info+0x3f/0x60
[   27.316611]  __kasan_slab_free+0x56/0x70
[   27.316852]  kfree+0x222/0x3f0
[   27.317010]  kmalloc_uaf2+0x14c/0x520
[   27.317526]  kunit_try_run_case+0x1a5/0x480
[   27.317936]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.318530]  kthread+0x337/0x6f0
[   27.318845]  ret_from_fork+0x116/0x1d0
[   27.319354]  ret_from_fork_asm+0x1a/0x30
[   27.319692] 
[   27.319796] The buggy address belongs to the object at ffff888103257a00
[   27.319796]  which belongs to the cache kmalloc-64 of size 64
[   27.320950] The buggy address is located 40 bytes inside of
[   27.320950]  freed 64-byte region [ffff888103257a00, ffff888103257a40)
[   27.321867] 
[   27.321997] The buggy address belongs to the physical page:
[   27.322421] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103257
[   27.322854] flags: 0x200000000000000(node=0|zone=2)
[   27.323139] page_type: f5(slab)
[   27.323314] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   27.323848] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   27.324257] page dumped because: kasan: bad access detected
[   27.324656] 
[   27.324792] Memory state around the buggy address:
[   27.325483]  ffff888103257900: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   27.325800]  ffff888103257980: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   27.326335] >ffff888103257a00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   27.326631]                                   ^
[   27.327120]  ffff888103257a80: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc
[   27.327419]  ffff888103257b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.327944] ==================================================================