Hay
Date
July 3, 2025, 3:13 p.m.

Environment
qemu-arm64
qemu-x86_64

[   15.720187] ==================================================================
[   15.720246] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x170/0x310
[   15.720305] Write of size 33 at addr fff00000c63d0280 by task kunit_try_catch/189
[   15.720357] 
[   15.720389] CPU: 1 UID: 0 PID: 189 Comm: kunit_try_catch Tainted: G    B            N  6.15.5-rc1 #1 PREEMPT 
[   15.720468] Tainted: [B]=BAD_PAGE, [N]=TEST
[   15.720493] Hardware name: linux,dummy-virt (DT)
[   15.720524] Call trace:
[   15.720546]  show_stack+0x20/0x38 (C)
[   15.720645]  dump_stack_lvl+0x8c/0xd0
[   15.720716]  print_report+0x118/0x608
[   15.720762]  kasan_report+0xdc/0x128
[   15.720804]  kasan_check_range+0x100/0x1a8
[   15.720850]  __asan_memset+0x34/0x78
[   15.720894]  kmalloc_uaf_memset+0x170/0x310
[   15.720940]  kunit_try_run_case+0x170/0x3f0
[   15.721909]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.721995]  kthread+0x328/0x630
[   15.722314]  ret_from_fork+0x10/0x20
[   15.722542] 
[   15.722687] Allocated by task 189:
[   15.722835]  kasan_save_stack+0x3c/0x68
[   15.722879]  kasan_save_track+0x20/0x40
[   15.723218]  kasan_save_alloc_info+0x40/0x58
[   15.723293]  __kasan_kmalloc+0xd4/0xd8
[   15.723511]  __kmalloc_cache_noprof+0x16c/0x3c0
[   15.723754]  kmalloc_uaf_memset+0xb8/0x310
[   15.723820]  kunit_try_run_case+0x170/0x3f0
[   15.723860]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.724133]  kthread+0x328/0x630
[   15.724426]  ret_from_fork+0x10/0x20
[   15.724522] 
[   15.724709] Freed by task 189:
[   15.724738]  kasan_save_stack+0x3c/0x68
[   15.724881]  kasan_save_track+0x20/0x40
[   15.725001]  kasan_save_free_info+0x4c/0x78
[   15.725189]  __kasan_slab_free+0x6c/0x98
[   15.725350]  kfree+0x214/0x3c8
[   15.725565]  kmalloc_uaf_memset+0x11c/0x310
[   15.725611]  kunit_try_run_case+0x170/0x3f0
[   15.726045]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.726177]  kthread+0x328/0x630
[   15.726290]  ret_from_fork+0x10/0x20
[   15.726510] 
[   15.726681] The buggy address belongs to the object at fff00000c63d0280
[   15.726681]  which belongs to the cache kmalloc-64 of size 64
[   15.726914] The buggy address is located 0 bytes inside of
[   15.726914]  freed 64-byte region [fff00000c63d0280, fff00000c63d02c0)
[   15.727122] 
[   15.727201] The buggy address belongs to the physical page:
[   15.727336] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1063d0
[   15.727726] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   15.727969] page_type: f5(slab)
[   15.728106] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   15.728247] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   15.728358] page dumped because: kasan: bad access detected
[   15.728395] 
[   15.728551] Memory state around the buggy address:
[   15.728696]  fff00000c63d0180: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   15.728918]  fff00000c63d0200: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   15.729053] >fff00000c63d0280: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   15.729250]                    ^
[   15.729279]  fff00000c63d0300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.729349]  fff00000c63d0380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.729587] ==================================================================

[   11.464717] ==================================================================
[   11.465135] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x1a3/0x360
[   11.465519] Write of size 33 at addr ffff888102dcca80 by task kunit_try_catch/205
[   11.465841] 
[   11.465935] CPU: 1 UID: 0 PID: 205 Comm: kunit_try_catch Tainted: G    B            N  6.15.5-rc1 #1 PREEMPT(voluntary) 
[   11.465982] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.465994] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.466014] Call Trace:
[   11.466025]  <TASK>
[   11.466042]  dump_stack_lvl+0x73/0xb0
[   11.466067]  print_report+0xd1/0x650
[   11.466089]  ? __virt_addr_valid+0x1db/0x2d0
[   11.466111]  ? kmalloc_uaf_memset+0x1a3/0x360
[   11.466132]  ? kasan_complete_mode_report_info+0x64/0x200
[   11.466154]  ? kmalloc_uaf_memset+0x1a3/0x360
[   11.466176]  kasan_report+0x141/0x180
[   11.466198]  ? kmalloc_uaf_memset+0x1a3/0x360
[   11.466224]  kasan_check_range+0x10c/0x1c0
[   11.466256]  __asan_memset+0x27/0x50
[   11.466276]  kmalloc_uaf_memset+0x1a3/0x360
[   11.466298]  ? __pfx_kmalloc_uaf_memset+0x10/0x10
[   11.466320]  ? __schedule+0x10cc/0x2b60
[   11.466355]  ? __pfx_read_tsc+0x10/0x10
[   11.466375]  ? ktime_get_ts64+0x86/0x230
[   11.466400]  kunit_try_run_case+0x1a5/0x480
[   11.466424]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.466445]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.466469]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.466492]  ? __kthread_parkme+0x82/0x180
[   11.466513]  ? preempt_count_sub+0x50/0x80
[   11.466537]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.466560]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.466582]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.466605]  kthread+0x337/0x6f0
[   11.466622]  ? trace_preempt_on+0x20/0xc0
[   11.466645]  ? __pfx_kthread+0x10/0x10
[   11.466663]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.466684]  ? calculate_sigpending+0x7b/0xa0
[   11.466705]  ? __pfx_kthread+0x10/0x10
[   11.466723]  ret_from_fork+0x41/0x80
[   11.466743]  ? __pfx_kthread+0x10/0x10
[   11.466761]  ret_from_fork_asm+0x1a/0x30
[   11.466791]  </TASK>
[   11.466802] 
[   11.474144] Allocated by task 205:
[   11.474407]  kasan_save_stack+0x45/0x70
[   11.474555]  kasan_save_track+0x18/0x40
[   11.474782]  kasan_save_alloc_info+0x3b/0x50
[   11.475020]  __kasan_kmalloc+0xb7/0xc0
[   11.475193]  __kmalloc_cache_noprof+0x189/0x420
[   11.475566]  kmalloc_uaf_memset+0xa9/0x360
[   11.475824]  kunit_try_run_case+0x1a5/0x480
[   11.476028]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.476261]  kthread+0x337/0x6f0
[   11.476457]  ret_from_fork+0x41/0x80
[   11.476627]  ret_from_fork_asm+0x1a/0x30
[   11.476763] 
[   11.476834] Freed by task 205:
[   11.476994]  kasan_save_stack+0x45/0x70
[   11.477190]  kasan_save_track+0x18/0x40
[   11.477377]  kasan_save_free_info+0x3f/0x60
[   11.477519]  __kasan_slab_free+0x56/0x70
[   11.477698]  kfree+0x222/0x3f0
[   11.477859]  kmalloc_uaf_memset+0x12b/0x360
[   11.478064]  kunit_try_run_case+0x1a5/0x480
[   11.478278]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.478532]  kthread+0x337/0x6f0
[   11.478650]  ret_from_fork+0x41/0x80
[   11.478880]  ret_from_fork_asm+0x1a/0x30
[   11.479059] 
[   11.479156] The buggy address belongs to the object at ffff888102dcca80
[   11.479156]  which belongs to the cache kmalloc-64 of size 64
[   11.479796] The buggy address is located 0 bytes inside of
[   11.479796]  freed 64-byte region [ffff888102dcca80, ffff888102dccac0)
[   11.480146] 
[   11.480218] The buggy address belongs to the physical page:
[   11.480466] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102dcc
[   11.481178] flags: 0x200000000000000(node=0|zone=2)
[   11.481371] page_type: f5(slab)
[   11.481617] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   11.481902] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   11.482129] page dumped because: kasan: bad access detected
[   11.482381] 
[   11.482477] Memory state around the buggy address:
[   11.482702]  ffff888102dcc980: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.483149]  ffff888102dcca00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.483488] >ffff888102dcca80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.483905]                    ^
[   11.484190]  ffff888102dccb00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.484494]  ffff888102dccb80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.484711] ==================================================================