Hay
Date
May 26, 2025, 9:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   17.776694] ==================================================================
[   17.777052] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x168/0x308
[   17.777218] Read of size 1 at addr fff00000c3eeb5c0 by task kunit_try_catch/192
[   17.777336] 
[   17.777791] CPU: 0 UID: 0 PID: 192 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc7-next-20250526 #1 PREEMPT 
[   17.778596] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.778675] Hardware name: linux,dummy-virt (DT)
[   17.778749] Call trace:
[   17.778849]  show_stack+0x20/0x38 (C)
[   17.778977]  dump_stack_lvl+0x8c/0xd0
[   17.779403]  print_report+0x118/0x608
[   17.779536]  kasan_report+0xdc/0x128
[   17.779643]  __kasan_check_byte+0x54/0x70
[   17.779751]  kfree_sensitive+0x30/0xb0
[   17.779976]  kmalloc_double_kzfree+0x168/0x308
[   17.780245]  kunit_try_run_case+0x170/0x3f0
[   17.780415]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.780582]  kthread+0x328/0x630
[   17.780758]  ret_from_fork+0x10/0x20
[   17.780892] 
[   17.780956] Allocated by task 192:
[   17.781018]  kasan_save_stack+0x3c/0x68
[   17.781136]  kasan_save_track+0x20/0x40
[   17.781239]  kasan_save_alloc_info+0x40/0x58
[   17.781345]  __kasan_kmalloc+0xd4/0xd8
[   17.781419]  __kmalloc_cache_noprof+0x15c/0x3c0
[   17.781505]  kmalloc_double_kzfree+0xb8/0x308
[   17.781738]  kunit_try_run_case+0x170/0x3f0
[   17.782018]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.782141]  kthread+0x328/0x630
[   17.782240]  ret_from_fork+0x10/0x20
[   17.782348] 
[   17.782395] Freed by task 192:
[   17.782492]  kasan_save_stack+0x3c/0x68
[   17.782568]  kasan_save_track+0x20/0x40
[   17.782646]  kasan_save_free_info+0x4c/0x78
[   17.782727]  __kasan_slab_free+0x6c/0x98
[   17.783135]  kfree+0x214/0x3c8
[   17.783247]  kfree_sensitive+0x80/0xb0
[   17.783355]  kmalloc_double_kzfree+0x11c/0x308
[   17.783480]  kunit_try_run_case+0x170/0x3f0
[   17.783570]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.783648]  kthread+0x328/0x630
[   17.783727]  ret_from_fork+0x10/0x20
[   17.783802] 
[   17.783848] The buggy address belongs to the object at fff00000c3eeb5c0
[   17.783848]  which belongs to the cache kmalloc-16 of size 16
[   17.783969] The buggy address is located 0 bytes inside of
[   17.783969]  freed 16-byte region [fff00000c3eeb5c0, fff00000c3eeb5d0)
[   17.784093] 
[   17.784299] The buggy address belongs to the physical page:
[   17.784558] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103eeb
[   17.784720] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   17.784854] page_type: f5(slab)
[   17.784955] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   17.785073] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   17.785170] page dumped because: kasan: bad access detected
[   17.785238] 
[   17.785277] Memory state around the buggy address:
[   17.785386]  fff00000c3eeb480: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   17.785528]  fff00000c3eeb500: 00 04 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   17.785670] >fff00000c3eeb580: fa fb fc fc fa fb fc fc fa fb fc fc fc fc fc fc
[   17.785790]                                            ^
[   17.785899]  fff00000c3eeb600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.786034]  fff00000c3eeb680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.786123] ==================================================================


[   11.317430] ==================================================================
[   11.318172] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x19c/0x350
[   11.318623] Read of size 1 at addr ffff888101e62300 by task kunit_try_catch/210
[   11.318934] 
[   11.319093] CPU: 1 UID: 0 PID: 210 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc7-next-20250526 #1 PREEMPT(voluntary) 
[   11.319141] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.319153] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.319173] Call Trace:
[   11.319185]  <TASK>
[   11.319200]  dump_stack_lvl+0x73/0xb0
[   11.319227]  print_report+0xd1/0x650
[   11.319249]  ? __virt_addr_valid+0x1db/0x2d0
[   11.319272]  ? kmalloc_double_kzfree+0x19c/0x350
[   11.319294]  ? kasan_complete_mode_report_info+0x64/0x200
[   11.319316]  ? kmalloc_double_kzfree+0x19c/0x350
[   11.319339]  kasan_report+0x141/0x180
[   11.319362]  ? kmalloc_double_kzfree+0x19c/0x350
[   11.319402]  ? kmalloc_double_kzfree+0x19c/0x350
[   11.319425]  __kasan_check_byte+0x3d/0x50
[   11.319447]  kfree_sensitive+0x22/0x90
[   11.319471]  kmalloc_double_kzfree+0x19c/0x350
[   11.319494]  ? __pfx_kmalloc_double_kzfree+0x10/0x10
[   11.319519]  ? __schedule+0x10cc/0x2b60
[   11.319543]  ? __pfx_read_tsc+0x10/0x10
[   11.319564]  ? ktime_get_ts64+0x86/0x230
[   11.319588]  kunit_try_run_case+0x1a5/0x480
[   11.319609]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.319628]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.319652]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.319676]  ? __kthread_parkme+0x82/0x180
[   11.319696]  ? preempt_count_sub+0x50/0x80
[   11.319730]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.319750]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.319774]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.319797]  kthread+0x337/0x6f0
[   11.319816]  ? trace_preempt_on+0x20/0xc0
[   11.319839]  ? __pfx_kthread+0x10/0x10
[   11.319859]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.319882]  ? calculate_sigpending+0x7b/0xa0
[   11.319905]  ? __pfx_kthread+0x10/0x10
[   11.319927]  ret_from_fork+0x116/0x1d0
[   11.319945]  ? __pfx_kthread+0x10/0x10
[   11.319965]  ret_from_fork_asm+0x1a/0x30
[   11.319995]  </TASK>
[   11.320045] 
[   11.327774] Allocated by task 210:
[   11.327912]  kasan_save_stack+0x45/0x70
[   11.328056]  kasan_save_track+0x18/0x40
[   11.328191]  kasan_save_alloc_info+0x3b/0x50
[   11.328465]  __kasan_kmalloc+0xb7/0xc0
[   11.328654]  __kmalloc_cache_noprof+0x189/0x420
[   11.328872]  kmalloc_double_kzfree+0xa9/0x350
[   11.329060]  kunit_try_run_case+0x1a5/0x480
[   11.329210]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.329485]  kthread+0x337/0x6f0
[   11.329657]  ret_from_fork+0x116/0x1d0
[   11.329962]  ret_from_fork_asm+0x1a/0x30
[   11.330267] 
[   11.330364] Freed by task 210:
[   11.330495]  kasan_save_stack+0x45/0x70
[   11.330646]  kasan_save_track+0x18/0x40
[   11.330940]  kasan_save_free_info+0x3f/0x60
[   11.331285]  __kasan_slab_free+0x56/0x70
[   11.331463]  kfree+0x222/0x3f0
[   11.331581]  kfree_sensitive+0x67/0x90
[   11.331811]  kmalloc_double_kzfree+0x12b/0x350
[   11.332042]  kunit_try_run_case+0x1a5/0x480
[   11.332224]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.332441]  kthread+0x337/0x6f0
[   11.332611]  ret_from_fork+0x116/0x1d0
[   11.332810]  ret_from_fork_asm+0x1a/0x30
[   11.333004] 
[   11.333082] The buggy address belongs to the object at ffff888101e62300
[   11.333082]  which belongs to the cache kmalloc-16 of size 16
[   11.333482] The buggy address is located 0 bytes inside of
[   11.333482]  freed 16-byte region [ffff888101e62300, ffff888101e62310)
[   11.333823] 
[   11.333895] The buggy address belongs to the physical page:
[   11.334170] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101e62
[   11.334587] flags: 0x200000000000000(node=0|zone=2)
[   11.334929] page_type: f5(slab)
[   11.335305] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   11.335588] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   11.336155] page dumped because: kasan: bad access detected
[   11.336426] 
[   11.336530] Memory state around the buggy address:
[   11.336725]  ffff888101e62200: 00 06 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   11.337087]  ffff888101e62280: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   11.337393] >ffff888101e62300: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.337615]                    ^
[   11.337730]  ffff888101e62380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.337973]  ffff888101e62400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.338411] ==================================================================