Hay
Date
July 15, 2025, 2:09 p.m.

Environment
qemu-arm64
qemu-x86_64

[   18.034739] ==================================================================
[   18.034803] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x170/0x310
[   18.034858] Write of size 33 at addr fff00000c59d5e80 by task kunit_try_catch/188
[   18.035170] 
[   18.035233] CPU: 0 UID: 0 PID: 188 Comm: kunit_try_catch Tainted: G    B            N  6.15.7-rc1 #1 PREEMPT 
[   18.035318] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.035346] Hardware name: linux,dummy-virt (DT)
[   18.035387] Call trace:
[   18.035410]  show_stack+0x20/0x38 (C)
[   18.035473]  dump_stack_lvl+0x8c/0xd0
[   18.035523]  print_report+0x118/0x5d0
[   18.035568]  kasan_report+0xdc/0x128
[   18.035611]  kasan_check_range+0x100/0x1a8
[   18.035667]  __asan_memset+0x34/0x78
[   18.035724]  kmalloc_uaf_memset+0x170/0x310
[   18.035774]  kunit_try_run_case+0x170/0x3f0
[   18.035832]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.035899]  kthread+0x328/0x630
[   18.035944]  ret_from_fork+0x10/0x20
[   18.035993] 
[   18.036011] Allocated by task 188:
[   18.036039]  kasan_save_stack+0x3c/0x68
[   18.036085]  kasan_save_track+0x20/0x40
[   18.036123]  kasan_save_alloc_info+0x40/0x58
[   18.036161]  __kasan_kmalloc+0xd4/0xd8
[   18.036196]  __kmalloc_cache_noprof+0x16c/0x3c0
[   18.037239]  kmalloc_uaf_memset+0xb8/0x310
[   18.037286]  kunit_try_run_case+0x170/0x3f0
[   18.037339]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.037756]  kthread+0x328/0x630
[   18.037824]  ret_from_fork+0x10/0x20
[   18.038020] 
[   18.038146] Freed by task 188:
[   18.038185]  kasan_save_stack+0x3c/0x68
[   18.038234]  kasan_save_track+0x20/0x40
[   18.038289]  kasan_save_free_info+0x4c/0x78
[   18.038327]  __kasan_slab_free+0x6c/0x98
[   18.038636]  kfree+0x214/0x3c8
[   18.038946]  kmalloc_uaf_memset+0x11c/0x310
[   18.039062]  kunit_try_run_case+0x170/0x3f0
[   18.039234]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.039331]  kthread+0x328/0x630
[   18.039415]  ret_from_fork+0x10/0x20
[   18.039577] 
[   18.039917] The buggy address belongs to the object at fff00000c59d5e80
[   18.039917]  which belongs to the cache kmalloc-64 of size 64
[   18.040036] The buggy address is located 0 bytes inside of
[   18.040036]  freed 64-byte region [fff00000c59d5e80, fff00000c59d5ec0)
[   18.040239] 
[   18.040373] The buggy address belongs to the physical page:
[   18.040453] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1059d5
[   18.040611] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.040664] page_type: f5(slab)
[   18.040703] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   18.040822] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   18.041247] page dumped because: kasan: bad access detected
[   18.041356] 
[   18.041453] Memory state around the buggy address:
[   18.041562]  fff00000c59d5d80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   18.041998]  fff00000c59d5e00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   18.042126] >fff00000c59d5e80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   18.042266]                    ^
[   18.042371]  fff00000c59d5f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.042448]  fff00000c59d5f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.042607] ==================================================================

[   11.273510] ==================================================================
[   11.274193] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x1a3/0x360
[   11.274528] Write of size 33 at addr ffff888102f39280 by task kunit_try_catch/205
[   11.274890] 
[   11.274994] CPU: 1 UID: 0 PID: 205 Comm: kunit_try_catch Tainted: G    B            N  6.15.7-rc1 #1 PREEMPT(voluntary) 
[   11.275038] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.275050] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.275070] Call Trace:
[   11.275083]  <TASK>
[   11.275100]  dump_stack_lvl+0x73/0xb0
[   11.275126]  print_report+0xd1/0x610
[   11.275148]  ? __virt_addr_valid+0x1db/0x2d0
[   11.275169]  ? kmalloc_uaf_memset+0x1a3/0x360
[   11.275189]  ? kasan_complete_mode_report_info+0x64/0x200
[   11.275211]  ? kmalloc_uaf_memset+0x1a3/0x360
[   11.275232]  kasan_report+0x141/0x180
[   11.275253]  ? kmalloc_uaf_memset+0x1a3/0x360
[   11.275279]  kasan_check_range+0x10c/0x1c0
[   11.275298]  __asan_memset+0x27/0x50
[   11.275317]  kmalloc_uaf_memset+0x1a3/0x360
[   11.275337]  ? __pfx_kmalloc_uaf_memset+0x10/0x10
[   11.275359]  ? __schedule+0x10cc/0x2b60
[   11.275381]  ? __pfx_read_tsc+0x10/0x10
[   11.275401]  ? ktime_get_ts64+0x86/0x230
[   11.275427]  kunit_try_run_case+0x1a5/0x480
[   11.275447]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.275465]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.275487]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.275510]  ? __kthread_parkme+0x82/0x180
[   11.275531]  ? preempt_count_sub+0x50/0x80
[   11.275555]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.275575]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.275596]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.275618]  kthread+0x337/0x6f0
[   11.275634]  ? trace_preempt_on+0x20/0xc0
[   11.275656]  ? __pfx_kthread+0x10/0x10
[   11.275673]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.275694]  ? calculate_sigpending+0x7b/0xa0
[   11.275714]  ? __pfx_kthread+0x10/0x10
[   11.275732]  ret_from_fork+0x41/0x80
[   11.275751]  ? __pfx_kthread+0x10/0x10
[   11.275768]  ret_from_fork_asm+0x1a/0x30
[   11.275798]  </TASK>
[   11.275808] 
[   11.283396] Allocated by task 205:
[   11.283528]  kasan_save_stack+0x45/0x70
[   11.283693]  kasan_save_track+0x18/0x40
[   11.283971]  kasan_save_alloc_info+0x3b/0x50
[   11.284333]  __kasan_kmalloc+0xb7/0xc0
[   11.284489]  __kmalloc_cache_noprof+0x189/0x420
[   11.284643]  kmalloc_uaf_memset+0xa9/0x360
[   11.284784]  kunit_try_run_case+0x1a5/0x480
[   11.285178]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.285437]  kthread+0x337/0x6f0
[   11.285608]  ret_from_fork+0x41/0x80
[   11.285788]  ret_from_fork_asm+0x1a/0x30
[   11.285994] 
[   11.286265] Freed by task 205:
[   11.286430]  kasan_save_stack+0x45/0x70
[   11.286620]  kasan_save_track+0x18/0x40
[   11.286943]  kasan_save_free_info+0x3f/0x60
[   11.287088]  __kasan_slab_free+0x56/0x70
[   11.287224]  kfree+0x222/0x3f0
[   11.287364]  kmalloc_uaf_memset+0x12b/0x360
[   11.287567]  kunit_try_run_case+0x1a5/0x480
[   11.287771]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.288207]  kthread+0x337/0x6f0
[   11.288327]  ret_from_fork+0x41/0x80
[   11.288454]  ret_from_fork_asm+0x1a/0x30
[   11.288589] 
[   11.288657] The buggy address belongs to the object at ffff888102f39280
[   11.288657]  which belongs to the cache kmalloc-64 of size 64
[   11.289336] The buggy address is located 0 bytes inside of
[   11.289336]  freed 64-byte region [ffff888102f39280, ffff888102f392c0)
[   11.290174] 
[   11.290279] The buggy address belongs to the physical page:
[   11.290494] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102f39
[   11.290791] flags: 0x200000000000000(node=0|zone=2)
[   11.291122] page_type: f5(slab)
[   11.291405] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   11.291710] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   11.292085] page dumped because: kasan: bad access detected
[   11.292256] 
[   11.292322] Memory state around the buggy address:
[   11.292534]  ffff888102f39180: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.292900]  ffff888102f39200: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.293275] >ffff888102f39280: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.293531]                    ^
[   11.293687]  ffff888102f39300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.294011]  ffff888102f39380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.294279] ==================================================================