Hay
Date
July 15, 2025, 11:09 a.m.

Environment
qemu-arm64
qemu-x86_64

[   15.770137] ==================================================================
[   15.770214] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x168/0x308
[   15.770274] Read of size 1 at addr fff00000c591d600 by task kunit_try_catch/193
[   15.770325] 
[   15.770359] CPU: 1 UID: 0 PID: 193 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   15.770636] Tainted: [B]=BAD_PAGE, [N]=TEST
[   15.770904] Hardware name: linux,dummy-virt (DT)
[   15.771192] Call trace:
[   15.771265]  show_stack+0x20/0x38 (C)
[   15.772024]  dump_stack_lvl+0x8c/0xd0
[   15.772167]  print_report+0x118/0x5d0
[   15.772344]  kasan_report+0xdc/0x128
[   15.772693]  __kasan_check_byte+0x54/0x70
[   15.773300]  kfree_sensitive+0x30/0xb0
[   15.773378]  kmalloc_double_kzfree+0x168/0x308
[   15.773428]  kunit_try_run_case+0x170/0x3f0
[   15.773565]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.773793]  kthread+0x328/0x630
[   15.773972]  ret_from_fork+0x10/0x20
[   15.774522] 
[   15.774542] Allocated by task 193:
[   15.774998]  kasan_save_stack+0x3c/0x68
[   15.775313]  kasan_save_track+0x20/0x40
[   15.775354]  kasan_save_alloc_info+0x40/0x58
[   15.775397]  __kasan_kmalloc+0xd4/0xd8
[   15.775435]  __kmalloc_cache_noprof+0x16c/0x3c0
[   15.775961]  kmalloc_double_kzfree+0xb8/0x308
[   15.776263]  kunit_try_run_case+0x170/0x3f0
[   15.776539]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.776653]  kthread+0x328/0x630
[   15.776848]  ret_from_fork+0x10/0x20
[   15.776991] 
[   15.777065] Freed by task 193:
[   15.777092]  kasan_save_stack+0x3c/0x68
[   15.777225]  kasan_save_track+0x20/0x40
[   15.777262]  kasan_save_free_info+0x4c/0x78
[   15.777305]  __kasan_slab_free+0x6c/0x98
[   15.777341]  kfree+0x214/0x3c8
[   15.777898]  kfree_sensitive+0x80/0xb0
[   15.777982]  kmalloc_double_kzfree+0x11c/0x308
[   15.778251]  kunit_try_run_case+0x170/0x3f0
[   15.778521]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.778680]  kthread+0x328/0x630
[   15.778836]  ret_from_fork+0x10/0x20
[   15.778872] 
[   15.778893] The buggy address belongs to the object at fff00000c591d600
[   15.778893]  which belongs to the cache kmalloc-16 of size 16
[   15.778953] The buggy address is located 0 bytes inside of
[   15.778953]  freed 16-byte region [fff00000c591d600, fff00000c591d610)
[   15.779014] 
[   15.779524] The buggy address belongs to the physical page:
[   15.780053] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10591d
[   15.780400] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   15.780592] page_type: f5(slab)
[   15.780751] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   15.780956] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   15.780999] page dumped because: kasan: bad access detected
[   15.781032] 
[   15.781283] Memory state around the buggy address:
[   15.781395]  fff00000c591d500: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   15.781504]  fff00000c591d580: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   15.781816] >fff00000c591d600: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.781965]                    ^
[   15.781997]  fff00000c591d680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.782515]  fff00000c591d700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.782562] ==================================================================

[   12.891001] ==================================================================
[   12.892145] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x19c/0x350
[   12.892606] Read of size 1 at addr ffff888102514900 by task kunit_try_catch/209
[   12.893297] 
[   12.893599] CPU: 1 UID: 0 PID: 209 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   12.893649] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.893661] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.893683] Call Trace:
[   12.893695]  <TASK>
[   12.893712]  dump_stack_lvl+0x73/0xb0
[   12.893745]  print_report+0xd1/0x610
[   12.893795]  ? __virt_addr_valid+0x1db/0x2d0
[   12.893819]  ? kmalloc_double_kzfree+0x19c/0x350
[   12.893843]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.893867]  ? kmalloc_double_kzfree+0x19c/0x350
[   12.893891]  kasan_report+0x141/0x180
[   12.893913]  ? kmalloc_double_kzfree+0x19c/0x350
[   12.893939]  ? kmalloc_double_kzfree+0x19c/0x350
[   12.893963]  __kasan_check_byte+0x3d/0x50
[   12.893985]  kfree_sensitive+0x22/0x90
[   12.894008]  kmalloc_double_kzfree+0x19c/0x350
[   12.894031]  ? __pfx_kmalloc_double_kzfree+0x10/0x10
[   12.894056]  ? __schedule+0x10cc/0x2b60
[   12.894079]  ? __pfx_read_tsc+0x10/0x10
[   12.894101]  ? ktime_get_ts64+0x86/0x230
[   12.894126]  kunit_try_run_case+0x1a5/0x480
[   12.894155]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.894178]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.894202]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.894228]  ? __kthread_parkme+0x82/0x180
[   12.894249]  ? preempt_count_sub+0x50/0x80
[   12.894274]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.894298]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.894323]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.894409]  kthread+0x337/0x6f0
[   12.894429]  ? trace_preempt_on+0x20/0xc0
[   12.894453]  ? __pfx_kthread+0x10/0x10
[   12.894473]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.894495]  ? calculate_sigpending+0x7b/0xa0
[   12.894520]  ? __pfx_kthread+0x10/0x10
[   12.894541]  ret_from_fork+0x116/0x1d0
[   12.894561]  ? __pfx_kthread+0x10/0x10
[   12.894581]  ret_from_fork_asm+0x1a/0x30
[   12.894612]  </TASK>
[   12.894623] 
[   12.902821] Allocated by task 209:
[   12.902987]  kasan_save_stack+0x45/0x70
[   12.903166]  kasan_save_track+0x18/0x40
[   12.903340]  kasan_save_alloc_info+0x3b/0x50
[   12.903550]  __kasan_kmalloc+0xb7/0xc0
[   12.903736]  __kmalloc_cache_noprof+0x189/0x420
[   12.903906]  kmalloc_double_kzfree+0xa9/0x350
[   12.904081]  kunit_try_run_case+0x1a5/0x480
[   12.904289]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.904548]  kthread+0x337/0x6f0
[   12.904789]  ret_from_fork+0x116/0x1d0
[   12.904951]  ret_from_fork_asm+0x1a/0x30
[   12.905124] 
[   12.905194] Freed by task 209:
[   12.905342]  kasan_save_stack+0x45/0x70
[   12.905538]  kasan_save_track+0x18/0x40
[   12.905682]  kasan_save_free_info+0x3f/0x60
[   12.905841]  __kasan_slab_free+0x56/0x70
[   12.906059]  kfree+0x222/0x3f0
[   12.906224]  kfree_sensitive+0x67/0x90
[   12.906412]  kmalloc_double_kzfree+0x12b/0x350
[   12.906663]  kunit_try_run_case+0x1a5/0x480
[   12.906819]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.906995]  kthread+0x337/0x6f0
[   12.907113]  ret_from_fork+0x116/0x1d0
[   12.907244]  ret_from_fork_asm+0x1a/0x30
[   12.907425] 
[   12.907518] The buggy address belongs to the object at ffff888102514900
[   12.907518]  which belongs to the cache kmalloc-16 of size 16
[   12.908083] The buggy address is located 0 bytes inside of
[   12.908083]  freed 16-byte region [ffff888102514900, ffff888102514910)
[   12.908598] 
[   12.908698] The buggy address belongs to the physical page:
[   12.908882] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102514
[   12.909123] flags: 0x200000000000000(node=0|zone=2)
[   12.909286] page_type: f5(slab)
[   12.909707] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   12.910070] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   12.910418] page dumped because: kasan: bad access detected
[   12.910679] 
[   12.910854] Memory state around the buggy address:
[   12.911077]  ffff888102514800: 00 02 fc fc 00 02 fc fc 00 02 fc fc 00 05 fc fc
[   12.911498]  ffff888102514880: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   12.911730] >ffff888102514900: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.912003]                    ^
[   12.912164]  ffff888102514980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.912478]  ffff888102514a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.912871] ==================================================================