Hay
Date
July 16, 2025, 12:11 p.m.

Environment
qemu-arm64
qemu-x86_64

[   31.175738] ==================================================================
[   31.176052] BUG: KASAN: double-free in kmem_cache_double_free+0x190/0x3c8
[   31.176203] Free of addr fff00000c9a5a000 by task kunit_try_catch/240
[   31.176282] 
[   31.176400] CPU: 0 UID: 0 PID: 240 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6-next-20250716 #1 PREEMPT 
[   31.176521] Tainted: [B]=BAD_PAGE, [N]=TEST
[   31.176705] Hardware name: linux,dummy-virt (DT)
[   31.176751] Call trace:
[   31.176775]  show_stack+0x20/0x38 (C)
[   31.176848]  dump_stack_lvl+0x8c/0xd0
[   31.176902]  print_report+0x118/0x5d0
[   31.176946]  kasan_report_invalid_free+0xc0/0xe8
[   31.176995]  check_slab_allocation+0xd4/0x108
[   31.177102]  __kasan_slab_pre_free+0x2c/0x48
[   31.177321]  kmem_cache_free+0xf0/0x468
[   31.177433]  kmem_cache_double_free+0x190/0x3c8
[   31.177577]  kunit_try_run_case+0x170/0x3f0
[   31.177698]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.177844]  kthread+0x328/0x630
[   31.177921]  ret_from_fork+0x10/0x20
[   31.177990] 
[   31.178014] Allocated by task 240:
[   31.178043]  kasan_save_stack+0x3c/0x68
[   31.178083]  kasan_save_track+0x20/0x40
[   31.178129]  kasan_save_alloc_info+0x40/0x58
[   31.178178]  __kasan_slab_alloc+0xa8/0xb0
[   31.178227]  kmem_cache_alloc_noprof+0x10c/0x398
[   31.178271]  kmem_cache_double_free+0x12c/0x3c8
[   31.178312]  kunit_try_run_case+0x170/0x3f0
[   31.178363]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.178424]  kthread+0x328/0x630
[   31.178463]  ret_from_fork+0x10/0x20
[   31.178500] 
[   31.178538] Freed by task 240:
[   31.178565]  kasan_save_stack+0x3c/0x68
[   31.178610]  kasan_save_track+0x20/0x40
[   31.178644]  kasan_save_free_info+0x4c/0x78
[   31.178691]  __kasan_slab_free+0x6c/0x98
[   31.178735]  kmem_cache_free+0x260/0x468
[   31.178783]  kmem_cache_double_free+0x140/0x3c8
[   31.178831]  kunit_try_run_case+0x170/0x3f0
[   31.178868]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.178920]  kthread+0x328/0x630
[   31.178953]  ret_from_fork+0x10/0x20
[   31.178997] 
[   31.179016] The buggy address belongs to the object at fff00000c9a5a000
[   31.179016]  which belongs to the cache test_cache of size 200
[   31.179075] The buggy address is located 0 bytes inside of
[   31.179075]  200-byte region [fff00000c9a5a000, fff00000c9a5a0c8)
[   31.179135] 
[   31.179157] The buggy address belongs to the physical page:
[   31.179190] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109a5a
[   31.179248] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   31.179303] page_type: f5(slab)
[   31.179356] raw: 0bfffe0000000000 fff00000c56a18c0 dead000000000122 0000000000000000
[   31.179408] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   31.179459] page dumped because: kasan: bad access detected
[   31.179491] 
[   31.179519] Memory state around the buggy address:
[   31.179554]  fff00000c9a59f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   31.179599]  fff00000c9a59f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   31.179845] >fff00000c9a5a000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   31.180172]                    ^
[   31.180207]  fff00000c9a5a080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   31.180254]  fff00000c9a5a100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.180556] ==================================================================

[   23.990690] ==================================================================
[   23.991173] BUG: KASAN: double-free in kmem_cache_double_free+0x1e5/0x480
[   23.991526] Free of addr ffff8881053b2000 by task kunit_try_catch/258
[   23.992083] 
[   23.992191] CPU: 0 UID: 0 PID: 258 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6-next-20250716 #1 PREEMPT(voluntary) 
[   23.992244] Tainted: [B]=BAD_PAGE, [N]=TEST
[   23.992256] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   23.992289] Call Trace:
[   23.992303]  <TASK>
[   23.992323]  dump_stack_lvl+0x73/0xb0
[   23.992384]  print_report+0xd1/0x610
[   23.992408]  ? __virt_addr_valid+0x1db/0x2d0
[   23.992435]  ? kasan_complete_mode_report_info+0x64/0x200
[   23.992480]  ? kmem_cache_double_free+0x1e5/0x480
[   23.992505]  kasan_report_invalid_free+0x10a/0x130
[   23.992528]  ? kmem_cache_double_free+0x1e5/0x480
[   23.992553]  ? kmem_cache_double_free+0x1e5/0x480
[   23.992592]  check_slab_allocation+0x101/0x130
[   23.992613]  __kasan_slab_pre_free+0x28/0x40
[   23.992647]  kmem_cache_free+0xed/0x420
[   23.992681]  ? kmem_cache_alloc_noprof+0x123/0x3f0
[   23.992705]  ? kmem_cache_double_free+0x1e5/0x480
[   23.992731]  kmem_cache_double_free+0x1e5/0x480
[   23.992755]  ? __pfx_kmem_cache_double_free+0x10/0x10
[   23.992778]  ? finish_task_switch.isra.0+0x153/0x700
[   23.992800]  ? __switch_to+0x47/0xf80
[   23.992830]  ? __pfx_read_tsc+0x10/0x10
[   23.992852]  ? ktime_get_ts64+0x86/0x230
[   23.992878]  kunit_try_run_case+0x1a5/0x480
[   23.992903]  ? __pfx_kunit_try_run_case+0x10/0x10
[   23.992995]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   23.993019]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   23.993042]  ? __kthread_parkme+0x82/0x180
[   23.993063]  ? preempt_count_sub+0x50/0x80
[   23.993084]  ? __pfx_kunit_try_run_case+0x10/0x10
[   23.993107]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   23.993133]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   23.993159]  kthread+0x337/0x6f0
[   23.993178]  ? trace_preempt_on+0x20/0xc0
[   23.993202]  ? __pfx_kthread+0x10/0x10
[   23.993221]  ? _raw_spin_unlock_irq+0x47/0x80
[   23.993241]  ? calculate_sigpending+0x7b/0xa0
[   23.993265]  ? __pfx_kthread+0x10/0x10
[   23.993297]  ret_from_fork+0x116/0x1d0
[   23.993316]  ? __pfx_kthread+0x10/0x10
[   23.993336]  ret_from_fork_asm+0x1a/0x30
[   23.993367]  </TASK>
[   23.993378] 
[   24.005637] Allocated by task 258:
[   24.005910]  kasan_save_stack+0x45/0x70
[   24.006171]  kasan_save_track+0x18/0x40
[   24.006361]  kasan_save_alloc_info+0x3b/0x50
[   24.006562]  __kasan_slab_alloc+0x91/0xa0
[   24.006779]  kmem_cache_alloc_noprof+0x123/0x3f0
[   24.007116]  kmem_cache_double_free+0x14f/0x480
[   24.007321]  kunit_try_run_case+0x1a5/0x480
[   24.007530]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.008080]  kthread+0x337/0x6f0
[   24.008241]  ret_from_fork+0x116/0x1d0
[   24.008673]  ret_from_fork_asm+0x1a/0x30
[   24.008979] 
[   24.009054] Freed by task 258:
[   24.009184]  kasan_save_stack+0x45/0x70
[   24.009394]  kasan_save_track+0x18/0x40
[   24.009554]  kasan_save_free_info+0x3f/0x60
[   24.009736]  __kasan_slab_free+0x56/0x70
[   24.010407]  kmem_cache_free+0x249/0x420
[   24.010558]  kmem_cache_double_free+0x16a/0x480
[   24.010788]  kunit_try_run_case+0x1a5/0x480
[   24.011056]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.011302]  kthread+0x337/0x6f0
[   24.011451]  ret_from_fork+0x116/0x1d0
[   24.011606]  ret_from_fork_asm+0x1a/0x30
[   24.012163] 
[   24.012237] The buggy address belongs to the object at ffff8881053b2000
[   24.012237]  which belongs to the cache test_cache of size 200
[   24.012893] The buggy address is located 0 bytes inside of
[   24.012893]  200-byte region [ffff8881053b2000, ffff8881053b20c8)
[   24.013428] 
[   24.013530] The buggy address belongs to the physical page:
[   24.014295] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1053b2
[   24.014745] flags: 0x200000000000000(node=0|zone=2)
[   24.015000] page_type: f5(slab)
[   24.015353] raw: 0200000000000000 ffff888101a65a00 dead000000000122 0000000000000000
[   24.015775] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   24.016123] page dumped because: kasan: bad access detected
[   24.016448] 
[   24.016541] Memory state around the buggy address:
[   24.017056]  ffff8881053b1f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.017360]  ffff8881053b1f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.017781] >ffff8881053b2000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   24.019567]                    ^
[   24.019800]  ffff8881053b2080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   24.020076]  ffff8881053b2100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.020380] ==================================================================