Hay
Date
July 16, 2025, 12:11 p.m.

Environment
qemu-arm64
qemu-x86_64

[   30.746117] ==================================================================
[   30.746540] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x170/0x310
[   30.746613] Write of size 33 at addr fff00000c637ad80 by task kunit_try_catch/217
[   30.746668] 
[   30.746803] CPU: 0 UID: 0 PID: 217 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6-next-20250716 #1 PREEMPT 
[   30.746897] Tainted: [B]=BAD_PAGE, [N]=TEST
[   30.746930] Hardware name: linux,dummy-virt (DT)
[   30.746996] Call trace:
[   30.747029]  show_stack+0x20/0x38 (C)
[   30.747081]  dump_stack_lvl+0x8c/0xd0
[   30.747127]  print_report+0x118/0x5d0
[   30.747171]  kasan_report+0xdc/0x128
[   30.747213]  kasan_check_range+0x100/0x1a8
[   30.747260]  __asan_memset+0x34/0x78
[   30.747304]  kmalloc_uaf_memset+0x170/0x310
[   30.747351]  kunit_try_run_case+0x170/0x3f0
[   30.747399]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.747453]  kthread+0x328/0x630
[   30.747495]  ret_from_fork+0x10/0x20
[   30.747554] 
[   30.747574] Allocated by task 217:
[   30.747601]  kasan_save_stack+0x3c/0x68
[   30.747650]  kasan_save_track+0x20/0x40
[   30.747686]  kasan_save_alloc_info+0x40/0x58
[   30.747725]  __kasan_kmalloc+0xd4/0xd8
[   30.747764]  __kmalloc_cache_noprof+0x16c/0x3c0
[   30.748146]  kmalloc_uaf_memset+0xb8/0x310
[   30.748480]  kunit_try_run_case+0x170/0x3f0
[   30.748659]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.748727]  kthread+0x328/0x630
[   30.748863]  ret_from_fork+0x10/0x20
[   30.749063] 
[   30.749153] Freed by task 217:
[   30.749321]  kasan_save_stack+0x3c/0x68
[   30.749475]  kasan_save_track+0x20/0x40
[   30.749614]  kasan_save_free_info+0x4c/0x78
[   30.749768]  __kasan_slab_free+0x6c/0x98
[   30.749864]  kfree+0x214/0x3c8
[   30.750186]  kmalloc_uaf_memset+0x11c/0x310
[   30.750239]  kunit_try_run_case+0x170/0x3f0
[   30.750417]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.750530]  kthread+0x328/0x630
[   30.750689]  ret_from_fork+0x10/0x20
[   30.750771] 
[   30.750793] The buggy address belongs to the object at fff00000c637ad80
[   30.750793]  which belongs to the cache kmalloc-64 of size 64
[   30.751051] The buggy address is located 0 bytes inside of
[   30.751051]  freed 64-byte region [fff00000c637ad80, fff00000c637adc0)
[   30.751278] 
[   30.751329] The buggy address belongs to the physical page:
[   30.751361] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10637a
[   30.751587] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   30.751782] page_type: f5(slab)
[   30.751933] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   30.752007] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   30.752187] page dumped because: kasan: bad access detected
[   30.752363] 
[   30.752424] Memory state around the buggy address:
[   30.752563]  fff00000c637ac80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   30.752629]  fff00000c637ad00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   30.752838] >fff00000c637ad80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   30.753004]                    ^
[   30.753064]  fff00000c637ae00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.753186]  fff00000c637ae80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.753256] ==================================================================

[   23.531676] ==================================================================
[   23.532142] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x1a3/0x360
[   23.532550] Write of size 33 at addr ffff8881053a9480 by task kunit_try_catch/235
[   23.533207] 
[   23.533312] CPU: 0 UID: 0 PID: 235 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6-next-20250716 #1 PREEMPT(voluntary) 
[   23.533363] Tainted: [B]=BAD_PAGE, [N]=TEST
[   23.533375] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   23.533395] Call Trace:
[   23.533407]  <TASK>
[   23.533424]  dump_stack_lvl+0x73/0xb0
[   23.533454]  print_report+0xd1/0x610
[   23.533476]  ? __virt_addr_valid+0x1db/0x2d0
[   23.533499]  ? kmalloc_uaf_memset+0x1a3/0x360
[   23.533520]  ? kasan_complete_mode_report_info+0x64/0x200
[   23.533545]  ? kmalloc_uaf_memset+0x1a3/0x360
[   23.533582]  kasan_report+0x141/0x180
[   23.533603]  ? kmalloc_uaf_memset+0x1a3/0x360
[   23.533628]  kasan_check_range+0x10c/0x1c0
[   23.533650]  __asan_memset+0x27/0x50
[   23.533673]  kmalloc_uaf_memset+0x1a3/0x360
[   23.533693]  ? __pfx_kmalloc_uaf_memset+0x10/0x10
[   23.533714]  ? __schedule+0x10c6/0x2b60
[   23.533735]  ? __pfx_read_tsc+0x10/0x10
[   23.533756]  ? ktime_get_ts64+0x86/0x230
[   23.533780]  kunit_try_run_case+0x1a5/0x480
[   23.533804]  ? __pfx_kunit_try_run_case+0x10/0x10
[   23.533825]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   23.533847]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   23.533868]  ? __kthread_parkme+0x82/0x180
[   23.533888]  ? preempt_count_sub+0x50/0x80
[   23.533911]  ? __pfx_kunit_try_run_case+0x10/0x10
[   23.533983]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   23.534026]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   23.534052]  kthread+0x337/0x6f0
[   23.534072]  ? trace_preempt_on+0x20/0xc0
[   23.534095]  ? __pfx_kthread+0x10/0x10
[   23.534115]  ? _raw_spin_unlock_irq+0x47/0x80
[   23.534135]  ? calculate_sigpending+0x7b/0xa0
[   23.534158]  ? __pfx_kthread+0x10/0x10
[   23.534179]  ret_from_fork+0x116/0x1d0
[   23.534197]  ? __pfx_kthread+0x10/0x10
[   23.534217]  ret_from_fork_asm+0x1a/0x30
[   23.534247]  </TASK>
[   23.534257] 
[   23.547220] Allocated by task 235:
[   23.547593]  kasan_save_stack+0x45/0x70
[   23.547967]  kasan_save_track+0x18/0x40
[   23.548223]  kasan_save_alloc_info+0x3b/0x50
[   23.548673]  __kasan_kmalloc+0xb7/0xc0
[   23.548805]  __kmalloc_cache_noprof+0x189/0x420
[   23.549198]  kmalloc_uaf_memset+0xa9/0x360
[   23.549612]  kunit_try_run_case+0x1a5/0x480
[   23.550034]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   23.550331]  kthread+0x337/0x6f0
[   23.550448]  ret_from_fork+0x116/0x1d0
[   23.550628]  ret_from_fork_asm+0x1a/0x30
[   23.550987] 
[   23.551178] Freed by task 235:
[   23.551503]  kasan_save_stack+0x45/0x70
[   23.551882]  kasan_save_track+0x18/0x40
[   23.552403]  kasan_save_free_info+0x3f/0x60
[   23.552730]  __kasan_slab_free+0x56/0x70
[   23.552865]  kfree+0x222/0x3f0
[   23.553049]  kmalloc_uaf_memset+0x12b/0x360
[   23.553495]  kunit_try_run_case+0x1a5/0x480
[   23.553920]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   23.554467]  kthread+0x337/0x6f0
[   23.554722]  ret_from_fork+0x116/0x1d0
[   23.554855]  ret_from_fork_asm+0x1a/0x30
[   23.555281] 
[   23.555434] The buggy address belongs to the object at ffff8881053a9480
[   23.555434]  which belongs to the cache kmalloc-64 of size 64
[   23.556234] The buggy address is located 0 bytes inside of
[   23.556234]  freed 64-byte region [ffff8881053a9480, ffff8881053a94c0)
[   23.556652] 
[   23.556824] The buggy address belongs to the physical page:
[   23.557361] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1053a9
[   23.558358] flags: 0x200000000000000(node=0|zone=2)
[   23.558920] page_type: f5(slab)
[   23.559266] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   23.559912] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   23.560434] page dumped because: kasan: bad access detected
[   23.560618] 
[   23.560708] Memory state around the buggy address:
[   23.561224]  ffff8881053a9380: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc
[   23.561660]  ffff8881053a9400: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   23.561873] >ffff8881053a9480: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   23.562075]                    ^
[   23.562183]  ffff8881053a9500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.562401]  ffff8881053a9580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.562923] ==================================================================