Hay
Date
June 25, 2025, 8:08 a.m.

Environment
qemu-arm64
qemu-x86_64

[   26.855838] ==================================================================
[   26.855911] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x168/0x308
[   26.855982] Read of size 1 at addr fff00000c3f9db40 by task kunit_try_catch/204
[   26.856609] 
[   26.856735] CPU: 1 UID: 0 PID: 204 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc3-next-20250625 #1 PREEMPT 
[   26.856930] Tainted: [B]=BAD_PAGE, [N]=TEST
[   26.857183] Hardware name: linux,dummy-virt (DT)
[   26.857319] Call trace:
[   26.857735]  show_stack+0x20/0x38 (C)
[   26.857877]  dump_stack_lvl+0x8c/0xd0
[   26.858082]  print_report+0x118/0x608
[   26.858523]  kasan_report+0xdc/0x128
[   26.858689]  __kasan_check_byte+0x54/0x70
[   26.859075]  kfree_sensitive+0x30/0xb0
[   26.859212]  kmalloc_double_kzfree+0x168/0x308
[   26.859611]  kunit_try_run_case+0x170/0x3f0
[   26.859737]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   26.859841]  kthread+0x328/0x630
[   26.859889]  ret_from_fork+0x10/0x20
[   26.860299] 
[   26.860337] Allocated by task 204:
[   26.860540]  kasan_save_stack+0x3c/0x68
[   26.860639]  kasan_save_track+0x20/0x40
[   26.860768]  kasan_save_alloc_info+0x40/0x58
[   26.860810]  __kasan_kmalloc+0xd4/0xd8
[   26.860849]  __kmalloc_cache_noprof+0x16c/0x3c0
[   26.860888]  kmalloc_double_kzfree+0xb8/0x308
[   26.860926]  kunit_try_run_case+0x170/0x3f0
[   26.860993]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   26.861038]  kthread+0x328/0x630
[   26.861069]  ret_from_fork+0x10/0x20
[   26.861107] 
[   26.861126] Freed by task 204:
[   26.861152]  kasan_save_stack+0x3c/0x68
[   26.861191]  kasan_save_track+0x20/0x40
[   26.861228]  kasan_save_free_info+0x4c/0x78
[   26.861272]  __kasan_slab_free+0x6c/0x98
[   26.861320]  kfree+0x214/0x3c8
[   26.861352]  kfree_sensitive+0x80/0xb0
[   26.861389]  kmalloc_double_kzfree+0x11c/0x308
[   26.861441]  kunit_try_run_case+0x170/0x3f0
[   26.861479]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   26.861526]  kthread+0x328/0x630
[   26.861558]  ret_from_fork+0x10/0x20
[   26.861594] 
[   26.861614] The buggy address belongs to the object at fff00000c3f9db40
[   26.861614]  which belongs to the cache kmalloc-16 of size 16
[   26.861685] The buggy address is located 0 bytes inside of
[   26.861685]  freed 16-byte region [fff00000c3f9db40, fff00000c3f9db50)
[   26.861745] 
[   26.861779] The buggy address belongs to the physical page:
[   26.861813] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103f9d
[   26.861874] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   26.861934] page_type: f5(slab)
[   26.861975] raw: 0bfffe0000000000 fff00000c0001640 dead000000000100 dead000000000122
[   26.862034] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   26.862082] page dumped because: kasan: bad access detected
[   26.862118] 
[   26.862136] Memory state around the buggy address:
[   26.862178]  fff00000c3f9da00: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   26.862220]  fff00000c3f9da80: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   26.862271] >fff00000c3f9db00: fa fb fc fc fa fb fc fc fa fb fc fc fc fc fc fc
[   26.862318]                                            ^
[   26.862379]  fff00000c3f9db80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.863338]  fff00000c3f9dc00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.863442] ==================================================================

[   22.216459] ==================================================================
[   22.218146] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x19c/0x350
[   22.219342] Read of size 1 at addr ffff8881016c54a0 by task kunit_try_catch/221
[   22.220389] 
[   22.220491] CPU: 0 UID: 0 PID: 221 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc3-next-20250625 #1 PREEMPT(voluntary) 
[   22.220543] Tainted: [B]=BAD_PAGE, [N]=TEST
[   22.220556] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   22.220577] Call Trace:
[   22.220595]  <TASK>
[   22.220616]  dump_stack_lvl+0x73/0xb0
[   22.220650]  print_report+0xd1/0x650
[   22.220675]  ? __virt_addr_valid+0x1db/0x2d0
[   22.220701]  ? kmalloc_double_kzfree+0x19c/0x350
[   22.220725]  ? kasan_complete_mode_report_info+0x64/0x200
[   22.220751]  ? kmalloc_double_kzfree+0x19c/0x350
[   22.220775]  kasan_report+0x141/0x180
[   22.220797]  ? kmalloc_double_kzfree+0x19c/0x350
[   22.221031]  ? kmalloc_double_kzfree+0x19c/0x350
[   22.221059]  __kasan_check_byte+0x3d/0x50
[   22.221085]  kfree_sensitive+0x22/0x90
[   22.221114]  kmalloc_double_kzfree+0x19c/0x350
[   22.221180]  ? __pfx_kmalloc_double_kzfree+0x10/0x10
[   22.221205]  ? __schedule+0x10cc/0x2b60
[   22.221234]  ? __pfx_read_tsc+0x10/0x10
[   22.221258]  ? ktime_get_ts64+0x86/0x230
[   22.221284]  kunit_try_run_case+0x1a5/0x480
[   22.221314]  ? __pfx_kunit_try_run_case+0x10/0x10
[   22.221339]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   22.221361]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   22.221386]  ? __kthread_parkme+0x82/0x180
[   22.221408]  ? preempt_count_sub+0x50/0x80
[   22.221432]  ? __pfx_kunit_try_run_case+0x10/0x10
[   22.221457]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.221480]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   22.221504]  kthread+0x337/0x6f0
[   22.221525]  ? trace_preempt_on+0x20/0xc0
[   22.221549]  ? __pfx_kthread+0x10/0x10
[   22.221570]  ? _raw_spin_unlock_irq+0x47/0x80
[   22.221593]  ? calculate_sigpending+0x7b/0xa0
[   22.221618]  ? __pfx_kthread+0x10/0x10
[   22.221640]  ret_from_fork+0x116/0x1d0
[   22.221659]  ? __pfx_kthread+0x10/0x10
[   22.221680]  ret_from_fork_asm+0x1a/0x30
[   22.221712]  </TASK>
[   22.221725] 
[   22.236346] Allocated by task 221:
[   22.236483]  kasan_save_stack+0x45/0x70
[   22.236839]  kasan_save_track+0x18/0x40
[   22.237184]  kasan_save_alloc_info+0x3b/0x50
[   22.238631]  __kasan_kmalloc+0xb7/0xc0
[   22.238925]  __kmalloc_cache_noprof+0x189/0x420
[   22.239376]  kmalloc_double_kzfree+0xa9/0x350
[   22.239522]  kunit_try_run_case+0x1a5/0x480
[   22.239663]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.239826]  kthread+0x337/0x6f0
[   22.239935]  ret_from_fork+0x116/0x1d0
[   22.240066]  ret_from_fork_asm+0x1a/0x30
[   22.240301] 
[   22.240388] Freed by task 221:
[   22.240494]  kasan_save_stack+0x45/0x70
[   22.240623]  kasan_save_track+0x18/0x40
[   22.240747]  kasan_save_free_info+0x3f/0x60
[   22.240883]  __kasan_slab_free+0x56/0x70
[   22.241023]  kfree+0x222/0x3f0
[   22.241131]  kfree_sensitive+0x67/0x90
[   22.241258]  kmalloc_double_kzfree+0x12b/0x350
[   22.241400]  kunit_try_run_case+0x1a5/0x480
[   22.241537]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.241701]  kthread+0x337/0x6f0
[   22.241812]  ret_from_fork+0x116/0x1d0
[   22.242291]  ret_from_fork_asm+0x1a/0x30
[   22.242688] 
[   22.242841] The buggy address belongs to the object at ffff8881016c54a0
[   22.242841]  which belongs to the cache kmalloc-16 of size 16
[   22.244157] The buggy address is located 0 bytes inside of
[   22.244157]  freed 16-byte region [ffff8881016c54a0, ffff8881016c54b0)
[   22.245391] 
[   22.245571] The buggy address belongs to the physical page:
[   22.246070] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1016c5
[   22.246994] flags: 0x200000000000000(node=0|zone=2)
[   22.247567] page_type: f5(slab)
[   22.248116] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   22.248822] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   22.249571] page dumped because: kasan: bad access detected
[   22.250126] 
[   22.250316] Memory state around the buggy address:
[   22.250807]  ffff8881016c5380: fa fb fc fc fa fb fc fc fa fb fc fc 00 05 fc fc
[   22.251476]  ffff8881016c5400: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   22.252081] >ffff8881016c5480: fa fb fc fc fa fb fc fc fc fc fc fc fc fc fc fc
[   22.252715]                                ^
[   22.253001]  ffff8881016c5500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.253748]  ffff8881016c5580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.254210] ==================================================================