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

Environment
qemu-arm64
qemu-x86_64

[   19.045299] ==================================================================
[   19.046037] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x170/0x310
[   19.046931] Write of size 33 at addr fff00000c65a7e80 by task kunit_try_catch/176
[   19.047385] 
[   19.047616] CPU: 1 UID: 0 PID: 176 Comm: kunit_try_catch Tainted: G    B            N 6.14.10-rc1 #1
[   19.047776] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.047810] Hardware name: linux,dummy-virt (DT)
[   19.047851] Call trace:
[   19.047878]  show_stack+0x20/0x38 (C)
[   19.047947]  dump_stack_lvl+0x8c/0xd0
[   19.048004]  print_report+0x118/0x608
[   19.048057]  kasan_report+0xdc/0x128
[   19.048109]  kasan_check_range+0x100/0x1a8
[   19.048184]  __asan_memset+0x34/0x78
[   19.048316]  kmalloc_uaf_memset+0x170/0x310
[   19.048411]  kunit_try_run_case+0x170/0x3f0
[   19.048528]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.048637]  kthread+0x318/0x620
[   19.048769]  ret_from_fork+0x10/0x20
[   19.048888] 
[   19.052975] Allocated by task 176:
[   19.054445]  kasan_save_stack+0x3c/0x68
[   19.055191]  kasan_save_track+0x20/0x40
[   19.055710]  kasan_save_alloc_info+0x40/0x58
[   19.055973]  __kasan_kmalloc+0xd4/0xd8
[   19.056220]  __kmalloc_cache_noprof+0x16c/0x3c0
[   19.056691]  kmalloc_uaf_memset+0xb8/0x310
[   19.057124]  kunit_try_run_case+0x170/0x3f0
[   19.057638]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.058226]  kthread+0x318/0x620
[   19.058677]  ret_from_fork+0x10/0x20
[   19.059082] 
[   19.059516] Freed by task 176:
[   19.060046]  kasan_save_stack+0x3c/0x68
[   19.060612]  kasan_save_track+0x20/0x40
[   19.060852]  kasan_save_free_info+0x4c/0x78
[   19.061094]  __kasan_slab_free+0x6c/0x98
[   19.061346]  kfree+0x214/0x3c8
[   19.061722]  kmalloc_uaf_memset+0x11c/0x310
[   19.062282]  kunit_try_run_case+0x170/0x3f0
[   19.062967]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.063576]  kthread+0x318/0x620
[   19.063843]  ret_from_fork+0x10/0x20
[   19.064068] 
[   19.064216] The buggy address belongs to the object at fff00000c65a7e80
[   19.064216]  which belongs to the cache kmalloc-64 of size 64
[   19.064711] The buggy address is located 0 bytes inside of
[   19.064711]  freed 64-byte region [fff00000c65a7e80, fff00000c65a7ec0)
[   19.066005] 
[   19.066660] The buggy address belongs to the physical page:
[   19.067035] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1065a7
[   19.067809] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.069052] page_type: f5(slab)
[   19.069674] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   19.070890] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   19.071523] page dumped because: kasan: bad access detected
[   19.071963] 
[   19.072200] Memory state around the buggy address:
[   19.072617]  fff00000c65a7d80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   19.073695]  fff00000c65a7e00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   19.074388] >fff00000c65a7e80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   19.074773]                    ^
[   19.074994]  fff00000c65a7f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.075341]  fff00000c65a7f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.075669] ==================================================================

[   12.959533] ==================================================================
[   12.960582] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x1a4/0x360
[   12.961062] Write of size 33 at addr ffff888102a29500 by task kunit_try_catch/194
[   12.961290] 
[   12.961376] CPU: 0 UID: 0 PID: 194 Comm: kunit_try_catch Tainted: G    B            N 6.14.10-rc1 #1
[   12.961418] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.961429] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.961451] Call Trace:
[   12.961463]  <TASK>
[   12.961480]  dump_stack_lvl+0x73/0xb0
[   12.961510]  print_report+0xd1/0x650
[   12.961533]  ? __virt_addr_valid+0x1db/0x2d0
[   12.961791]  ? kmalloc_uaf_memset+0x1a4/0x360
[   12.961816]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.961844]  ? kmalloc_uaf_memset+0x1a4/0x360
[   12.961867]  kasan_report+0x140/0x180
[   12.962068]  ? kmalloc_uaf_memset+0x1a4/0x360
[   12.962106]  kasan_check_range+0x10c/0x1c0
[   12.962133]  __asan_memset+0x27/0x50
[   12.962159]  kmalloc_uaf_memset+0x1a4/0x360
[   12.962182]  ? __pfx_kmalloc_uaf_memset+0x10/0x10
[   12.962206]  ? __schedule+0xce8/0x2840
[   12.962232]  ? __pfx_read_tsc+0x10/0x10
[   12.962256]  ? ktime_get_ts64+0x86/0x230
[   12.962285]  kunit_try_run_case+0x1a6/0x480
[   12.962311]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.962334]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   12.962360]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.962385]  ? __kthread_parkme+0x82/0x160
[   12.962410]  ? preempt_count_sub+0x50/0x80
[   12.962437]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.962462]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.962490]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.962518]  kthread+0x324/0x6e0
[   12.962541]  ? trace_preempt_on+0x20/0xc0
[   12.962592]  ? __pfx_kthread+0x10/0x10
[   12.962617]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.962641]  ? calculate_sigpending+0x7b/0xa0
[   12.962665]  ? __pfx_kthread+0x10/0x10
[   12.962690]  ret_from_fork+0x41/0x80
[   12.962711]  ? __pfx_kthread+0x10/0x10
[   12.962735]  ret_from_fork_asm+0x1a/0x30
[   12.962770]  </TASK>
[   12.962781] 
[   12.979264] Allocated by task 194:
[   12.979405]  kasan_save_stack+0x45/0x70
[   12.979565]  kasan_save_track+0x18/0x40
[   12.979705]  kasan_save_alloc_info+0x3b/0x50
[   12.979854]  __kasan_kmalloc+0xb7/0xc0
[   12.979987]  __kmalloc_cache_noprof+0x18a/0x420
[   12.980156]  kmalloc_uaf_memset+0xaa/0x360
[   12.980301]  kunit_try_run_case+0x1a6/0x480
[   12.980447]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.980624]  kthread+0x324/0x6e0
[   12.980748]  ret_from_fork+0x41/0x80
[   12.980877]  ret_from_fork_asm+0x1a/0x30
[   12.981062] 
[   12.981221] Freed by task 194:
[   12.981494]  kasan_save_stack+0x45/0x70
[   12.981873]  kasan_save_track+0x18/0x40
[   12.982229]  kasan_save_free_info+0x3f/0x60
[   12.982635]  __kasan_slab_free+0x56/0x70
[   12.983012]  kfree+0x224/0x3f0
[   12.983336]  kmalloc_uaf_memset+0x12c/0x360
[   12.983776]  kunit_try_run_case+0x1a6/0x480
[   12.984336]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.984898]  kthread+0x324/0x6e0
[   12.985280]  ret_from_fork+0x41/0x80
[   12.985631]  ret_from_fork_asm+0x1a/0x30
[   12.986116] 
[   12.986279] The buggy address belongs to the object at ffff888102a29500
[   12.986279]  which belongs to the cache kmalloc-64 of size 64
[   12.987493] The buggy address is located 0 bytes inside of
[   12.987493]  freed 64-byte region [ffff888102a29500, ffff888102a29540)
[   12.988652] 
[   12.988817] The buggy address belongs to the physical page:
[   12.989307] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102a29
[   12.990068] flags: 0x200000000000000(node=0|zone=2)
[   12.990666] page_type: f5(slab)
[   12.990985] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   12.991738] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   12.992388] page dumped because: kasan: bad access detected
[   12.992920] 
[   12.993111] Memory state around the buggy address:
[   12.993608]  ffff888102a29400: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   12.994353]  ffff888102a29480: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   12.995060] >ffff888102a29500: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   12.995603]                    ^
[   12.995718]  ffff888102a29580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.995934]  ffff888102a29600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.996493] ==================================================================