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

Environment
qemu-arm64
qemu-x86_64

[   19.497241] ==================================================================
[   19.497402] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x170/0x310
[   19.497539] Write of size 33 at addr fff00000c640be00 by task kunit_try_catch/195
[   19.497668] 
[   19.497755] CPU: 0 UID: 0 PID: 195 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250616 #1 PREEMPT 
[   19.497979] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.498055] Hardware name: linux,dummy-virt (DT)
[   19.498140] Call trace:
[   19.498202]  show_stack+0x20/0x38 (C)
[   19.498325]  dump_stack_lvl+0x8c/0xd0
[   19.498446]  print_report+0x118/0x608
[   19.498560]  kasan_report+0xdc/0x128
[   19.498682]  kasan_check_range+0x100/0x1a8
[   19.498883]  __asan_memset+0x34/0x78
[   19.498993]  kmalloc_uaf_memset+0x170/0x310
[   19.499096]  kunit_try_run_case+0x170/0x3f0
[   19.499209]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.499327]  kthread+0x328/0x630
[   19.499434]  ret_from_fork+0x10/0x20
[   19.499548] 
[   19.499612] Allocated by task 195:
[   19.499704]  kasan_save_stack+0x3c/0x68
[   19.499798]  kasan_save_track+0x20/0x40
[   19.499940]  kasan_save_alloc_info+0x40/0x58
[   19.500065]  __kasan_kmalloc+0xd4/0xd8
[   19.500194]  __kmalloc_cache_noprof+0x16c/0x3c0
[   19.500295]  kmalloc_uaf_memset+0xb8/0x310
[   19.500415]  kunit_try_run_case+0x170/0x3f0
[   19.500530]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.500660]  kthread+0x328/0x630
[   19.500759]  ret_from_fork+0x10/0x20
[   19.500896] 
[   19.500939] Freed by task 195:
[   19.500997]  kasan_save_stack+0x3c/0x68
[   19.501074]  kasan_save_track+0x20/0x40
[   19.501155]  kasan_save_free_info+0x4c/0x78
[   19.501236]  __kasan_slab_free+0x6c/0x98
[   19.501356]  kfree+0x214/0x3c8
[   19.501451]  kmalloc_uaf_memset+0x11c/0x310
[   19.501552]  kunit_try_run_case+0x170/0x3f0
[   19.501658]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.501759]  kthread+0x328/0x630
[   19.501870]  ret_from_fork+0x10/0x20
[   19.501961] 
[   19.502010] The buggy address belongs to the object at fff00000c640be00
[   19.502010]  which belongs to the cache kmalloc-64 of size 64
[   19.502156] The buggy address is located 0 bytes inside of
[   19.502156]  freed 64-byte region [fff00000c640be00, fff00000c640be40)
[   19.502288] 
[   19.502370] The buggy address belongs to the physical page:
[   19.502425] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10640b
[   19.502501] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.502570] page_type: f5(slab)
[   19.502628] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   19.502692] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   19.502747] page dumped because: kasan: bad access detected
[   19.502785] 
[   19.502811] Memory state around the buggy address:
[   19.502887]  fff00000c640bd00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   19.503001]  fff00000c640bd80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   19.503161] >fff00000c640be00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   19.503347]                    ^
[   19.503426]  fff00000c640be80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.503544]  fff00000c640bf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.503650] ==================================================================

[   11.725310] ==================================================================
[   11.725732] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x1a3/0x360
[   11.726022] Write of size 33 at addr ffff888102a1ee00 by task kunit_try_catch/211
[   11.726277] 
[   11.726365] CPU: 0 UID: 0 PID: 211 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250616 #1 PREEMPT(voluntary) 
[   11.726422] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.726434] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.726456] Call Trace:
[   11.726469]  <TASK>
[   11.726488]  dump_stack_lvl+0x73/0xb0
[   11.726516]  print_report+0xd1/0x650
[   11.726537]  ? __virt_addr_valid+0x1db/0x2d0
[   11.726560]  ? kmalloc_uaf_memset+0x1a3/0x360
[   11.726579]  ? kasan_complete_mode_report_info+0x64/0x200
[   11.726600]  ? kmalloc_uaf_memset+0x1a3/0x360
[   11.726620]  kasan_report+0x141/0x180
[   11.726640]  ? kmalloc_uaf_memset+0x1a3/0x360
[   11.726664]  kasan_check_range+0x10c/0x1c0
[   11.726687]  __asan_memset+0x27/0x50
[   11.726706]  kmalloc_uaf_memset+0x1a3/0x360
[   11.726727]  ? __pfx_kmalloc_uaf_memset+0x10/0x10
[   11.726781]  ? __schedule+0x10cc/0x2b60
[   11.726904]  ? __pfx_read_tsc+0x10/0x10
[   11.726925]  ? ktime_get_ts64+0x86/0x230
[   11.726962]  kunit_try_run_case+0x1a5/0x480
[   11.726986]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.727007]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.727027]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.727049]  ? __kthread_parkme+0x82/0x180
[   11.727069]  ? preempt_count_sub+0x50/0x80
[   11.727092]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.727114]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.727135]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.727156]  kthread+0x337/0x6f0
[   11.727175]  ? trace_preempt_on+0x20/0xc0
[   11.727199]  ? __pfx_kthread+0x10/0x10
[   11.727219]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.727238]  ? calculate_sigpending+0x7b/0xa0
[   11.727261]  ? __pfx_kthread+0x10/0x10
[   11.727282]  ret_from_fork+0x116/0x1d0
[   11.727299]  ? __pfx_kthread+0x10/0x10
[   11.727318]  ret_from_fork_asm+0x1a/0x30
[   11.727347]  </TASK>
[   11.727360] 
[   11.737593] Allocated by task 211:
[   11.737793]  kasan_save_stack+0x45/0x70
[   11.738003]  kasan_save_track+0x18/0x40
[   11.738166]  kasan_save_alloc_info+0x3b/0x50
[   11.738368]  __kasan_kmalloc+0xb7/0xc0
[   11.738630]  __kmalloc_cache_noprof+0x189/0x420
[   11.738852]  kmalloc_uaf_memset+0xa9/0x360
[   11.739069]  kunit_try_run_case+0x1a5/0x480
[   11.739214]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.739377]  kthread+0x337/0x6f0
[   11.739567]  ret_from_fork+0x116/0x1d0
[   11.739779]  ret_from_fork_asm+0x1a/0x30
[   11.740113] 
[   11.740240] Freed by task 211:
[   11.740574]  kasan_save_stack+0x45/0x70
[   11.740850]  kasan_save_track+0x18/0x40
[   11.741053]  kasan_save_free_info+0x3f/0x60
[   11.741248]  __kasan_slab_free+0x56/0x70
[   11.741549]  kfree+0x222/0x3f0
[   11.741736]  kmalloc_uaf_memset+0x12b/0x360
[   11.741966]  kunit_try_run_case+0x1a5/0x480
[   11.742166]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.742486]  kthread+0x337/0x6f0
[   11.742660]  ret_from_fork+0x116/0x1d0
[   11.742783]  ret_from_fork_asm+0x1a/0x30
[   11.742909] 
[   11.742985] The buggy address belongs to the object at ffff888102a1ee00
[   11.742985]  which belongs to the cache kmalloc-64 of size 64
[   11.743718] The buggy address is located 0 bytes inside of
[   11.743718]  freed 64-byte region [ffff888102a1ee00, ffff888102a1ee40)
[   11.744078] 
[   11.744144] The buggy address belongs to the physical page:
[   11.744303] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102a1e
[   11.744597] flags: 0x200000000000000(node=0|zone=2)
[   11.744850] page_type: f5(slab)
[   11.745125] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   11.745462] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   11.746145] page dumped because: kasan: bad access detected
[   11.747060] 
[   11.747314] Memory state around the buggy address:
[   11.747567]  ffff888102a1ed00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.747983]  ffff888102a1ed80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.748397] >ffff888102a1ee00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.748959]                    ^
[   11.749132]  ffff888102a1ee80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.749430]  ffff888102a1ef00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.750158] ==================================================================