Hay
Date
July 8, 2025, 4:38 p.m.

Environment
qemu-arm64
qemu-x86_64

[   18.019078] ==================================================================
[   18.019135] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x168/0x308
[   18.019194] Read of size 1 at addr fff00000c5cff700 by task kunit_try_catch/194
[   18.019252] 
[   18.019284] CPU: 1 UID: 0 PID: 194 Comm: kunit_try_catch Tainted: G    B            N  6.15.6-rc1 #1 PREEMPT 
[   18.019498] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.019639] Hardware name: linux,dummy-virt (DT)
[   18.019677] Call trace:
[   18.019973]  show_stack+0x20/0x38 (C)
[   18.020039]  dump_stack_lvl+0x8c/0xd0
[   18.020117]  print_report+0x118/0x608
[   18.020182]  kasan_report+0xdc/0x128
[   18.020252]  __kasan_check_byte+0x54/0x70
[   18.020360]  kfree_sensitive+0x30/0xb0
[   18.020411]  kmalloc_double_kzfree+0x168/0x308
[   18.020463]  kunit_try_run_case+0x170/0x3f0
[   18.020514]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.020568]  kthread+0x328/0x630
[   18.020612]  ret_from_fork+0x10/0x20
[   18.020754] 
[   18.020775] Allocated by task 194:
[   18.020874]  kasan_save_stack+0x3c/0x68
[   18.020950]  kasan_save_track+0x20/0x40
[   18.021025]  kasan_save_alloc_info+0x40/0x58
[   18.021096]  __kasan_kmalloc+0xd4/0xd8
[   18.021153]  __kmalloc_cache_noprof+0x16c/0x3c0
[   18.021228]  kmalloc_double_kzfree+0xb8/0x308
[   18.021313]  kunit_try_run_case+0x170/0x3f0
[   18.021364]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.021545]  kthread+0x328/0x630
[   18.021729]  ret_from_fork+0x10/0x20
[   18.021792] 
[   18.021870] Freed by task 194:
[   18.021919]  kasan_save_stack+0x3c/0x68
[   18.021995]  kasan_save_track+0x20/0x40
[   18.022114]  kasan_save_free_info+0x4c/0x78
[   18.022181]  __kasan_slab_free+0x6c/0x98
[   18.022220]  kfree+0x214/0x3c8
[   18.022390]  kfree_sensitive+0x80/0xb0
[   18.022439]  kmalloc_double_kzfree+0x11c/0x308
[   18.022481]  kunit_try_run_case+0x170/0x3f0
[   18.022537]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.022585]  kthread+0x328/0x630
[   18.022622]  ret_from_fork+0x10/0x20
[   18.022657] 
[   18.022678] The buggy address belongs to the object at fff00000c5cff700
[   18.022678]  which belongs to the cache kmalloc-16 of size 16
[   18.022735] The buggy address is located 0 bytes inside of
[   18.022735]  freed 16-byte region [fff00000c5cff700, fff00000c5cff710)
[   18.022797] 
[   18.022832] The buggy address belongs to the physical page:
[   18.022871] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105cff
[   18.022934] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.022983] page_type: f5(slab)
[   18.023024] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   18.023084] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   18.023123] page dumped because: kasan: bad access detected
[   18.023155] 
[   18.023174] Memory state around the buggy address:
[   18.023214]  fff00000c5cff600: 00 00 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   18.023268]  fff00000c5cff680: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   18.023310] >fff00000c5cff700: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.023364]                    ^
[   18.023406]  fff00000c5cff780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.023456]  fff00000c5cff800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.023494] ==================================================================

[   11.635386] ==================================================================
[   11.636852] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x19c/0x350
[   11.637751] Read of size 1 at addr ffff88810242c940 by task kunit_try_catch/212
[   11.638250] 
[   11.638344] CPU: 0 UID: 0 PID: 212 Comm: kunit_try_catch Tainted: G    B            N  6.15.6-rc1 #1 PREEMPT(voluntary) 
[   11.638390] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.638402] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.638424] Call Trace:
[   11.638437]  <TASK>
[   11.638452]  dump_stack_lvl+0x73/0xb0
[   11.638479]  print_report+0xd1/0x650
[   11.638503]  ? __virt_addr_valid+0x1db/0x2d0
[   11.638851]  ? kmalloc_double_kzfree+0x19c/0x350
[   11.638890]  ? kasan_complete_mode_report_info+0x64/0x200
[   11.638914]  ? kmalloc_double_kzfree+0x19c/0x350
[   11.638935]  kasan_report+0x141/0x180
[   11.638958]  ? kmalloc_double_kzfree+0x19c/0x350
[   11.638982]  ? kmalloc_double_kzfree+0x19c/0x350
[   11.639001]  __kasan_check_byte+0x3d/0x50
[   11.639024]  kfree_sensitive+0x22/0x90
[   11.639048]  kmalloc_double_kzfree+0x19c/0x350
[   11.639068]  ? __pfx_kmalloc_double_kzfree+0x10/0x10
[   11.639089]  ? __schedule+0x10cc/0x2b60
[   11.639112]  ? __pfx_read_tsc+0x10/0x10
[   11.639133]  ? ktime_get_ts64+0x86/0x230
[   11.639159]  kunit_try_run_case+0x1a5/0x480
[   11.639181]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.639200]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.639224]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.639248]  ? __kthread_parkme+0x82/0x180
[   11.639271]  ? preempt_count_sub+0x50/0x80
[   11.639297]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.639317]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.639341]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.639364]  kthread+0x337/0x6f0
[   11.639381]  ? trace_preempt_on+0x20/0xc0
[   11.639405]  ? __pfx_kthread+0x10/0x10
[   11.639423]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.639447]  ? calculate_sigpending+0x7b/0xa0
[   11.639469]  ? __pfx_kthread+0x10/0x10
[   11.639488]  ret_from_fork+0x41/0x80
[   11.639519]  ? __pfx_kthread+0x10/0x10
[   11.639537]  ret_from_fork_asm+0x1a/0x30
[   11.639568]  </TASK>
[   11.639586] 
[   11.654137] Allocated by task 212:
[   11.654475]  kasan_save_stack+0x45/0x70
[   11.654757]  kasan_save_track+0x18/0x40
[   11.654978]  kasan_save_alloc_info+0x3b/0x50
[   11.655413]  __kasan_kmalloc+0xb7/0xc0
[   11.655776]  __kmalloc_cache_noprof+0x189/0x420
[   11.656183]  kmalloc_double_kzfree+0xa9/0x350
[   11.656338]  kunit_try_run_case+0x1a5/0x480
[   11.656484]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.656964]  kthread+0x337/0x6f0
[   11.657334]  ret_from_fork+0x41/0x80
[   11.657810]  ret_from_fork_asm+0x1a/0x30
[   11.658359] 
[   11.658541] Freed by task 212:
[   11.658822]  kasan_save_stack+0x45/0x70
[   11.659193]  kasan_save_track+0x18/0x40
[   11.659338]  kasan_save_free_info+0x3f/0x60
[   11.659482]  __kasan_slab_free+0x56/0x70
[   11.659846]  kfree+0x222/0x3f0
[   11.660197]  kfree_sensitive+0x67/0x90
[   11.660559]  kmalloc_double_kzfree+0x12b/0x350
[   11.661047]  kunit_try_run_case+0x1a5/0x480
[   11.661433]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.661757]  kthread+0x337/0x6f0
[   11.661942]  ret_from_fork+0x41/0x80
[   11.662280]  ret_from_fork_asm+0x1a/0x30
[   11.662703] 
[   11.662867] The buggy address belongs to the object at ffff88810242c940
[   11.662867]  which belongs to the cache kmalloc-16 of size 16
[   11.663656] The buggy address is located 0 bytes inside of
[   11.663656]  freed 16-byte region [ffff88810242c940, ffff88810242c950)
[   11.664153] 
[   11.664317] The buggy address belongs to the physical page:
[   11.664806] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10242c
[   11.665629] flags: 0x200000000000000(node=0|zone=2)
[   11.666215] page_type: f5(slab)
[   11.666525] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   11.667087] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   11.667649] page dumped because: kasan: bad access detected
[   11.667824] 
[   11.668157] Memory state around the buggy address:
[   11.668605]  ffff88810242c800: 00 04 fc fc 00 00 fc fc 00 04 fc fc 00 04 fc fc
[   11.669332]  ffff88810242c880: 00 00 fc fc 00 04 fc fc fa fb fc fc fa fb fc fc
[   11.669832] >ffff88810242c900: 00 05 fc fc fa fb fc fc fa fb fc fc fc fc fc fc
[   11.670361]                                            ^
[   11.670547]  ffff88810242c980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.671240]  ffff88810242ca00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.671935] ==================================================================