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

Environment
qemu-arm64
qemu-x86_64

[   16.946770] ==================================================================
[   16.946924] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x170/0x310
[   16.946981] Write of size 33 at addr fff00000c78c3700 by task kunit_try_catch/186
[   16.947043] 
[   16.947397] CPU: 0 UID: 0 PID: 186 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   16.947540] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.947571] Hardware name: linux,dummy-virt (DT)
[   16.947606] Call trace:
[   16.947666]  show_stack+0x20/0x38 (C)
[   16.947865]  dump_stack_lvl+0x8c/0xd0
[   16.947930]  print_report+0x118/0x608
[   16.947976]  kasan_report+0xdc/0x128
[   16.948039]  kasan_check_range+0x100/0x1a8
[   16.948087]  __asan_memset+0x34/0x78
[   16.948129]  kmalloc_uaf_memset+0x170/0x310
[   16.948548]  kunit_try_run_case+0x170/0x3f0
[   16.948637]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.949125]  kthread+0x328/0x630
[   16.949260]  ret_from_fork+0x10/0x20
[   16.949369] 
[   16.949432] Allocated by task 186:
[   16.949474]  kasan_save_stack+0x3c/0x68
[   16.949670]  kasan_save_track+0x20/0x40
[   16.949906]  kasan_save_alloc_info+0x40/0x58
[   16.949962]  __kasan_kmalloc+0xd4/0xd8
[   16.950062]  __kmalloc_cache_noprof+0x16c/0x3c0
[   16.950122]  kmalloc_uaf_memset+0xb8/0x310
[   16.950171]  kunit_try_run_case+0x170/0x3f0
[   16.950208]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.950250]  kthread+0x328/0x630
[   16.950282]  ret_from_fork+0x10/0x20
[   16.950319] 
[   16.950337] Freed by task 186:
[   16.950379]  kasan_save_stack+0x3c/0x68
[   16.950423]  kasan_save_track+0x20/0x40
[   16.950466]  kasan_save_free_info+0x4c/0x78
[   16.950503]  __kasan_slab_free+0x6c/0x98
[   16.950540]  kfree+0x214/0x3c8
[   16.950570]  kmalloc_uaf_memset+0x11c/0x310
[   16.950608]  kunit_try_run_case+0x170/0x3f0
[   16.950645]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.950686]  kthread+0x328/0x630
[   16.950740]  ret_from_fork+0x10/0x20
[   16.950784] 
[   16.950802] The buggy address belongs to the object at fff00000c78c3700
[   16.950802]  which belongs to the cache kmalloc-64 of size 64
[   16.950868] The buggy address is located 0 bytes inside of
[   16.950868]  freed 64-byte region [fff00000c78c3700, fff00000c78c3740)
[   16.950928] 
[   16.950969] The buggy address belongs to the physical page:
[   16.950999] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1078c3
[   16.951370] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   16.951754] page_type: f5(slab)
[   16.951839] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   16.951907] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   16.951973] page dumped because: kasan: bad access detected
[   16.952078] 
[   16.952275] Memory state around the buggy address:
[   16.952545]  fff00000c78c3600: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   16.952722]  fff00000c78c3680: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   16.952790] >fff00000c78c3700: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   16.952828]                    ^
[   16.953180]  fff00000c78c3780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.953253]  fff00000c78c3800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.953798] ==================================================================

[   11.746423] ==================================================================
[   11.747010] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x1a3/0x360
[   11.748313] Write of size 33 at addr ffff888103338600 by task kunit_try_catch/204
[   11.749380] 
[   11.749597] CPU: 1 UID: 0 PID: 204 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   11.749646] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.749657] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.749685] Call Trace:
[   11.749698]  <TASK>
[   11.749714]  dump_stack_lvl+0x73/0xb0
[   11.749743]  print_report+0xd1/0x650
[   11.749766]  ? __virt_addr_valid+0x1db/0x2d0
[   11.749788]  ? kmalloc_uaf_memset+0x1a3/0x360
[   11.749807]  ? kasan_complete_mode_report_info+0x64/0x200
[   11.749828]  ? kmalloc_uaf_memset+0x1a3/0x360
[   11.749848]  kasan_report+0x141/0x180
[   11.749869]  ? kmalloc_uaf_memset+0x1a3/0x360
[   11.749893]  kasan_check_range+0x10c/0x1c0
[   11.749915]  __asan_memset+0x27/0x50
[   11.749934]  kmalloc_uaf_memset+0x1a3/0x360
[   11.749954]  ? __pfx_kmalloc_uaf_memset+0x10/0x10
[   11.749976]  ? __pfx_kmalloc_uaf_memset+0x10/0x10
[   11.750000]  kunit_try_run_case+0x1a5/0x480
[   11.750024]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.750044]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.750067]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.750088]  ? __kthread_parkme+0x82/0x180
[   11.750120]  ? preempt_count_sub+0x50/0x80
[   11.750142]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.750189]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.750212]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.750234]  kthread+0x337/0x6f0
[   11.750285]  ? trace_preempt_on+0x20/0xc0
[   11.750311]  ? __pfx_kthread+0x10/0x10
[   11.750346]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.750366]  ? calculate_sigpending+0x7b/0xa0
[   11.750388]  ? __pfx_kthread+0x10/0x10
[   11.750409]  ret_from_fork+0x116/0x1d0
[   11.750426]  ? __pfx_kthread+0x10/0x10
[   11.750445]  ret_from_fork_asm+0x1a/0x30
[   11.750485]  </TASK>
[   11.750497] 
[   11.760139] Allocated by task 204:
[   11.760470]  kasan_save_stack+0x45/0x70
[   11.760675]  kasan_save_track+0x18/0x40
[   11.760856]  kasan_save_alloc_info+0x3b/0x50
[   11.761077]  __kasan_kmalloc+0xb7/0xc0
[   11.761396]  __kmalloc_cache_noprof+0x189/0x420
[   11.761597]  kmalloc_uaf_memset+0xa9/0x360
[   11.761764]  kunit_try_run_case+0x1a5/0x480
[   11.761977]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.762261]  kthread+0x337/0x6f0
[   11.762570]  ret_from_fork+0x116/0x1d0
[   11.762932]  ret_from_fork_asm+0x1a/0x30
[   11.763077] 
[   11.763158] Freed by task 204:
[   11.763275]  kasan_save_stack+0x45/0x70
[   11.763471]  kasan_save_track+0x18/0x40
[   11.763755]  kasan_save_free_info+0x3f/0x60
[   11.763985]  __kasan_slab_free+0x56/0x70
[   11.764272]  kfree+0x222/0x3f0
[   11.764711]  kmalloc_uaf_memset+0x12b/0x360
[   11.764893]  kunit_try_run_case+0x1a5/0x480
[   11.765041]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.765284]  kthread+0x337/0x6f0
[   11.765450]  ret_from_fork+0x116/0x1d0
[   11.765634]  ret_from_fork_asm+0x1a/0x30
[   11.766010] 
[   11.766085] The buggy address belongs to the object at ffff888103338600
[   11.766085]  which belongs to the cache kmalloc-64 of size 64
[   11.766835] The buggy address is located 0 bytes inside of
[   11.766835]  freed 64-byte region [ffff888103338600, ffff888103338640)
[   11.767483] 
[   11.767599] The buggy address belongs to the physical page:
[   11.767839] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103338
[   11.768189] flags: 0x200000000000000(node=0|zone=2)
[   11.768765] page_type: f5(slab)
[   11.768918] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   11.769333] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   11.769692] page dumped because: kasan: bad access detected
[   11.769923] 
[   11.770127] Memory state around the buggy address:
[   11.770409]  ffff888103338500: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc
[   11.770747]  ffff888103338580: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.771073] >ffff888103338600: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.771459]                    ^
[   11.771576]  ffff888103338680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.771791]  ffff888103338700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.772373] ==================================================================