Hay
Date
July 10, 2025, 9:07 a.m.

Environment
qemu-arm64
qemu-x86_64

[   29.460815] ==================================================================
[   29.460873] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x3bc/0x438
[   29.460944] Read of size 16 at addr fff00000c8686ae0 by task kunit_try_catch/199
[   29.461173] 
[   29.461208] CPU: 0 UID: 0 PID: 199 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5-next-20250710 #1 PREEMPT 
[   29.461295] Tainted: [B]=BAD_PAGE, [N]=TEST
[   29.461320] Hardware name: linux,dummy-virt (DT)
[   29.461350] Call trace:
[   29.461371]  show_stack+0x20/0x38 (C)
[   29.461420]  dump_stack_lvl+0x8c/0xd0
[   29.461464]  print_report+0x118/0x5d0
[   29.461507]  kasan_report+0xdc/0x128
[   29.461551]  __asan_report_load16_noabort+0x20/0x30
[   29.461600]  kmalloc_uaf_16+0x3bc/0x438
[   29.461644]  kunit_try_run_case+0x170/0x3f0
[   29.461692]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.461745]  kthread+0x328/0x630
[   29.461786]  ret_from_fork+0x10/0x20
[   29.461832] 
[   29.461849] Allocated by task 199:
[   29.461875]  kasan_save_stack+0x3c/0x68
[   29.461914]  kasan_save_track+0x20/0x40
[   29.461951]  kasan_save_alloc_info+0x40/0x58
[   29.461987]  __kasan_kmalloc+0xd4/0xd8
[   29.462023]  __kmalloc_cache_noprof+0x16c/0x3c0
[   29.462061]  kmalloc_uaf_16+0x140/0x438
[   29.462096]  kunit_try_run_case+0x170/0x3f0
[   29.462145]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.462205]  kthread+0x328/0x630
[   29.462238]  ret_from_fork+0x10/0x20
[   29.462272] 
[   29.462290] Freed by task 199:
[   29.462314]  kasan_save_stack+0x3c/0x68
[   29.462351]  kasan_save_track+0x20/0x40
[   29.462394]  kasan_save_free_info+0x4c/0x78
[   29.462443]  __kasan_slab_free+0x6c/0x98
[   29.462537]  kfree+0x214/0x3c8
[   29.462575]  kmalloc_uaf_16+0x190/0x438
[   29.462617]  kunit_try_run_case+0x170/0x3f0
[   29.462724]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.462767]  kthread+0x328/0x630
[   29.462798]  ret_from_fork+0x10/0x20
[   29.462832] 
[   29.462860] The buggy address belongs to the object at fff00000c8686ae0
[   29.462860]  which belongs to the cache kmalloc-16 of size 16
[   29.462928] The buggy address is located 0 bytes inside of
[   29.462928]  freed 16-byte region [fff00000c8686ae0, fff00000c8686af0)
[   29.462995] 
[   29.463015] The buggy address belongs to the physical page:
[   29.463116] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xfff00000c8686a40 pfn:0x108686
[   29.463183] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   29.463232] page_type: f5(slab)
[   29.463269] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   29.463360] raw: fff00000c8686a40 000000008080007f 00000000f5000000 0000000000000000
[   29.463419] page dumped because: kasan: bad access detected
[   29.463449] 
[   29.463466] Memory state around the buggy address:
[   29.463495]  fff00000c8686980: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   29.463544]  fff00000c8686a00: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   29.463586] >fff00000c8686a80: fa fb fc fc fa fb fc fc 00 00 fc fc fa fb fc fc
[   29.463624]                                                        ^
[   29.463671]  fff00000c8686b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.463727]  fff00000c8686b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.463781] ==================================================================

[   25.045035] ==================================================================
[   25.046170] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x47b/0x4c0
[   25.046853] Read of size 16 at addr ffff888103cd6760 by task kunit_try_catch/216
[   25.047166] 
[   25.047281] CPU: 1 UID: 0 PID: 216 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5-next-20250710 #1 PREEMPT(voluntary) 
[   25.047333] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.047345] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   25.047366] Call Trace:
[   25.047380]  <TASK>
[   25.047399]  dump_stack_lvl+0x73/0xb0
[   25.047429]  print_report+0xd1/0x610
[   25.047453]  ? __virt_addr_valid+0x1db/0x2d0
[   25.047478]  ? kmalloc_uaf_16+0x47b/0x4c0
[   25.047774]  ? kasan_complete_mode_report_info+0x64/0x200
[   25.047819]  ? kmalloc_uaf_16+0x47b/0x4c0
[   25.047841]  kasan_report+0x141/0x180
[   25.047869]  ? kmalloc_uaf_16+0x47b/0x4c0
[   25.047927]  __asan_report_load16_noabort+0x18/0x20
[   25.047953]  kmalloc_uaf_16+0x47b/0x4c0
[   25.047974]  ? __pfx_kmalloc_uaf_16+0x10/0x10
[   25.047995]  ? __schedule+0x10cc/0x2b60
[   25.048020]  ? __pfx_read_tsc+0x10/0x10
[   25.048042]  ? ktime_get_ts64+0x86/0x230
[   25.048067]  kunit_try_run_case+0x1a5/0x480
[   25.048089]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.048109]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   25.048132]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   25.048155]  ? __kthread_parkme+0x82/0x180
[   25.048175]  ? preempt_count_sub+0x50/0x80
[   25.048200]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.048221]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.048246]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   25.048270]  kthread+0x337/0x6f0
[   25.048290]  ? trace_preempt_on+0x20/0xc0
[   25.048314]  ? __pfx_kthread+0x10/0x10
[   25.048334]  ? _raw_spin_unlock_irq+0x47/0x80
[   25.048355]  ? calculate_sigpending+0x7b/0xa0
[   25.048379]  ? __pfx_kthread+0x10/0x10
[   25.048400]  ret_from_fork+0x116/0x1d0
[   25.048419]  ? __pfx_kthread+0x10/0x10
[   25.048439]  ret_from_fork_asm+0x1a/0x30
[   25.048469]  </TASK>
[   25.048482] 
[   25.059519] Allocated by task 216:
[   25.059889]  kasan_save_stack+0x45/0x70
[   25.060179]  kasan_save_track+0x18/0x40
[   25.060355]  kasan_save_alloc_info+0x3b/0x50
[   25.060761]  __kasan_kmalloc+0xb7/0xc0
[   25.061138]  __kmalloc_cache_noprof+0x189/0x420
[   25.061359]  kmalloc_uaf_16+0x15b/0x4c0
[   25.061869]  kunit_try_run_case+0x1a5/0x480
[   25.062064]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.062303]  kthread+0x337/0x6f0
[   25.062462]  ret_from_fork+0x116/0x1d0
[   25.062991]  ret_from_fork_asm+0x1a/0x30
[   25.063261] 
[   25.063356] Freed by task 216:
[   25.063683]  kasan_save_stack+0x45/0x70
[   25.063964]  kasan_save_track+0x18/0x40
[   25.064144]  kasan_save_free_info+0x3f/0x60
[   25.064324]  __kasan_slab_free+0x56/0x70
[   25.064746]  kfree+0x222/0x3f0
[   25.065067]  kmalloc_uaf_16+0x1d6/0x4c0
[   25.065437]  kunit_try_run_case+0x1a5/0x480
[   25.065849]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.066100]  kthread+0x337/0x6f0
[   25.066258]  ret_from_fork+0x116/0x1d0
[   25.066430]  ret_from_fork_asm+0x1a/0x30
[   25.066997] 
[   25.067093] The buggy address belongs to the object at ffff888103cd6760
[   25.067093]  which belongs to the cache kmalloc-16 of size 16
[   25.068031] The buggy address is located 0 bytes inside of
[   25.068031]  freed 16-byte region [ffff888103cd6760, ffff888103cd6770)
[   25.068775] 
[   25.069028] The buggy address belongs to the physical page:
[   25.069381] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103cd6
[   25.070211] flags: 0x200000000000000(node=0|zone=2)
[   25.070436] page_type: f5(slab)
[   25.070755] raw: 0200000000000000 ffff888100041640 dead000000000100 dead000000000122
[   25.071415] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   25.072070] page dumped because: kasan: bad access detected
[   25.072432] 
[   25.072540] Memory state around the buggy address:
[   25.072952]  ffff888103cd6600: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   25.073416]  ffff888103cd6680: fa fb fc fc 00 06 fc fc 00 06 fc fc 00 06 fc fc
[   25.074048] >ffff888103cd6700: fa fb fc fc fa fb fc fc 00 00 fc fc fa fb fc fc
[   25.074714]                                                        ^
[   25.075205]  ffff888103cd6780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.075668]  ffff888103cd6800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.076105] ==================================================================