Hay
Date
July 8, 2025, 4:38 p.m.

Environment
qemu-arm64
qemu-x86_64

[   17.977304] ==================================================================
[   17.977569] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x170/0x310
[   17.977664] Write of size 33 at addr fff00000c638a580 by task kunit_try_catch/188
[   17.978010] 
[   17.978106] CPU: 1 UID: 0 PID: 188 Comm: kunit_try_catch Tainted: G    B            N  6.15.6-rc1 #1 PREEMPT 
[   17.978363] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.978576] Hardware name: linux,dummy-virt (DT)
[   17.978692] Call trace:
[   17.978953]  show_stack+0x20/0x38 (C)
[   17.979120]  dump_stack_lvl+0x8c/0xd0
[   17.979401]  print_report+0x118/0x608
[   17.979573]  kasan_report+0xdc/0x128
[   17.979630]  kasan_check_range+0x100/0x1a8
[   17.979879]  __asan_memset+0x34/0x78
[   17.980112]  kmalloc_uaf_memset+0x170/0x310
[   17.980169]  kunit_try_run_case+0x170/0x3f0
[   17.980581]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.980643]  kthread+0x328/0x630
[   17.980694]  ret_from_fork+0x10/0x20
[   17.980741] 
[   17.980760] Allocated by task 188:
[   17.980821]  kasan_save_stack+0x3c/0x68
[   17.980861]  kasan_save_track+0x20/0x40
[   17.981040]  kasan_save_alloc_info+0x40/0x58
[   17.981348]  __kasan_kmalloc+0xd4/0xd8
[   17.981407]  __kmalloc_cache_noprof+0x16c/0x3c0
[   17.981449]  kmalloc_uaf_memset+0xb8/0x310
[   17.981636]  kunit_try_run_case+0x170/0x3f0
[   17.981864]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.981946]  kthread+0x328/0x630
[   17.981983]  ret_from_fork+0x10/0x20
[   17.982020] 
[   17.982039] Freed by task 188:
[   17.982068]  kasan_save_stack+0x3c/0x68
[   17.982114]  kasan_save_track+0x20/0x40
[   17.982150]  kasan_save_free_info+0x4c/0x78
[   17.982358]  __kasan_slab_free+0x6c/0x98
[   17.982574]  kfree+0x214/0x3c8
[   17.982638]  kmalloc_uaf_memset+0x11c/0x310
[   17.982940]  kunit_try_run_case+0x170/0x3f0
[   17.983115]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.983163]  kthread+0x328/0x630
[   17.983351]  ret_from_fork+0x10/0x20
[   17.983621] 
[   17.983702] The buggy address belongs to the object at fff00000c638a580
[   17.983702]  which belongs to the cache kmalloc-64 of size 64
[   17.983779] The buggy address is located 0 bytes inside of
[   17.983779]  freed 64-byte region [fff00000c638a580, fff00000c638a5c0)
[   17.983841] 
[   17.983861] The buggy address belongs to the physical page:
[   17.983897] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10638a
[   17.984034] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   17.984198] page_type: f5(slab)
[   17.984287] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   17.984346] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   17.984388] page dumped because: kasan: bad access detected
[   17.984732] 
[   17.984756] Memory state around the buggy address:
[   17.984789]  fff00000c638a480: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   17.985029]  fff00000c638a500: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   17.985085] >fff00000c638a580: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   17.985312]                    ^
[   17.985517]  fff00000c638a600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.985597]  fff00000c638a680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.986456] ==================================================================

[   11.557127] ==================================================================
[   11.557482] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x1a3/0x360
[   11.558261] Write of size 33 at addr ffff8881029d6180 by task kunit_try_catch/206
[   11.559030] 
[   11.559264] CPU: 1 UID: 0 PID: 206 Comm: kunit_try_catch Tainted: G    B            N  6.15.6-rc1 #1 PREEMPT(voluntary) 
[   11.559313] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.559326] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.559348] Call Trace:
[   11.559360]  <TASK>
[   11.559375]  dump_stack_lvl+0x73/0xb0
[   11.559402]  print_report+0xd1/0x650
[   11.559425]  ? __virt_addr_valid+0x1db/0x2d0
[   11.559446]  ? kmalloc_uaf_memset+0x1a3/0x360
[   11.559468]  ? kasan_complete_mode_report_info+0x64/0x200
[   11.559491]  ? kmalloc_uaf_memset+0x1a3/0x360
[   11.559513]  kasan_report+0x141/0x180
[   11.559536]  ? kmalloc_uaf_memset+0x1a3/0x360
[   11.559563]  kasan_check_range+0x10c/0x1c0
[   11.559589]  __asan_memset+0x27/0x50
[   11.559609]  kmalloc_uaf_memset+0x1a3/0x360
[   11.559631]  ? __pfx_kmalloc_uaf_memset+0x10/0x10
[   11.559653]  ? __schedule+0x10cc/0x2b60
[   11.559676]  ? irqentry_exit+0x2a/0x60
[   11.559694]  ? __pfx_read_tsc+0x10/0x10
[   11.559714]  ? ktime_get_ts64+0x86/0x230
[   11.559740]  kunit_try_run_case+0x1a5/0x480
[   11.559759]  ? sysvec_apic_timer_interrupt+0x50/0x90
[   11.559780]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.559800]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.559825]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.559845]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.559868]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.560111]  kthread+0x337/0x6f0
[   11.560133]  ? trace_preempt_on+0x20/0xc0
[   11.560200]  ? __pfx_kthread+0x10/0x10
[   11.560219]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.560243]  ? calculate_sigpending+0x7b/0xa0
[   11.560264]  ? __pfx_kthread+0x10/0x10
[   11.560282]  ret_from_fork+0x41/0x80
[   11.560303]  ? __pfx_kthread+0x10/0x10
[   11.560321]  ret_from_fork_asm+0x1a/0x30
[   11.560352]  </TASK>
[   11.560364] 
[   11.577819] Allocated by task 206:
[   11.578233]  kasan_save_stack+0x45/0x70
[   11.578387]  kasan_save_track+0x18/0x40
[   11.578531]  kasan_save_alloc_info+0x3b/0x50
[   11.578961]  __kasan_kmalloc+0xb7/0xc0
[   11.579371]  __kmalloc_cache_noprof+0x189/0x420
[   11.579882]  kmalloc_uaf_memset+0xa9/0x360
[   11.580505]  kunit_try_run_case+0x1a5/0x480
[   11.580694]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.581018]  kthread+0x337/0x6f0
[   11.581322]  ret_from_fork+0x41/0x80
[   11.581716]  ret_from_fork_asm+0x1a/0x30
[   11.582207] 
[   11.582393] Freed by task 206:
[   11.582548]  kasan_save_stack+0x45/0x70
[   11.583002]  kasan_save_track+0x18/0x40
[   11.583304]  kasan_save_free_info+0x3f/0x60
[   11.583449]  __kasan_slab_free+0x56/0x70
[   11.583620]  kfree+0x222/0x3f0
[   11.583946]  kmalloc_uaf_memset+0x12b/0x360
[   11.584499]  kunit_try_run_case+0x1a5/0x480
[   11.585044]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.585569]  kthread+0x337/0x6f0
[   11.585862]  ret_from_fork+0x41/0x80
[   11.586120]  ret_from_fork_asm+0x1a/0x30
[   11.586504] 
[   11.586700] The buggy address belongs to the object at ffff8881029d6180
[   11.586700]  which belongs to the cache kmalloc-64 of size 64
[   11.587537] The buggy address is located 0 bytes inside of
[   11.587537]  freed 64-byte region [ffff8881029d6180, ffff8881029d61c0)
[   11.588252] 
[   11.588335] The buggy address belongs to the physical page:
[   11.588520] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1029d6
[   11.589486] flags: 0x200000000000000(node=0|zone=2)
[   11.590049] page_type: f5(slab)
[   11.590461] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   11.591268] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   11.591692] page dumped because: kasan: bad access detected
[   11.592393] 
[   11.592585] Memory state around the buggy address:
[   11.592792]  ffff8881029d6080: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.593168]  ffff8881029d6100: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.593792] >ffff8881029d6180: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.594473]                    ^
[   11.594754]  ffff8881029d6200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.595076]  ffff8881029d6280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.595699] ==================================================================