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

Environment
qemu-arm64
qemu-x86_64

[   18.822782] ==================================================================
[   18.822858] BUG: KASAN: double-free in kmem_cache_double_free+0x190/0x3c8
[   18.822929] Free of addr fff00000c56f3000 by task kunit_try_catch/209
[   18.823281] 
[   18.823381] CPU: 1 UID: 0 PID: 209 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   18.823467] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.823559] Hardware name: linux,dummy-virt (DT)
[   18.823658] Call trace:
[   18.823779]  show_stack+0x20/0x38 (C)
[   18.823835]  dump_stack_lvl+0x8c/0xd0
[   18.823885]  print_report+0x118/0x608
[   18.824350]  kasan_report_invalid_free+0xc0/0xe8
[   18.824413]  check_slab_allocation+0xd4/0x108
[   18.824621]  __kasan_slab_pre_free+0x2c/0x48
[   18.824720]  kmem_cache_free+0xf0/0x468
[   18.824812]  kmem_cache_double_free+0x190/0x3c8
[   18.824862]  kunit_try_run_case+0x170/0x3f0
[   18.824911]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.824967]  kthread+0x328/0x630
[   18.825018]  ret_from_fork+0x10/0x20
[   18.825069] 
[   18.825354] Allocated by task 209:
[   18.825416]  kasan_save_stack+0x3c/0x68
[   18.825500]  kasan_save_track+0x20/0x40
[   18.825584]  kasan_save_alloc_info+0x40/0x58
[   18.825624]  __kasan_slab_alloc+0xa8/0xb0
[   18.825877]  kmem_cache_alloc_noprof+0x10c/0x398
[   18.825928]  kmem_cache_double_free+0x12c/0x3c8
[   18.825966]  kunit_try_run_case+0x170/0x3f0
[   18.826004]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.826069]  kthread+0x328/0x630
[   18.826105]  ret_from_fork+0x10/0x20
[   18.826141] 
[   18.826161] Freed by task 209:
[   18.826189]  kasan_save_stack+0x3c/0x68
[   18.826587]  kasan_save_track+0x20/0x40
[   18.826675]  kasan_save_free_info+0x4c/0x78
[   18.826722]  __kasan_slab_free+0x6c/0x98
[   18.826757]  kmem_cache_free+0x260/0x468
[   18.827067]  kmem_cache_double_free+0x140/0x3c8
[   18.827216]  kunit_try_run_case+0x170/0x3f0
[   18.827315]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.827362]  kthread+0x328/0x630
[   18.827395]  ret_from_fork+0x10/0x20
[   18.827430] 
[   18.827449] The buggy address belongs to the object at fff00000c56f3000
[   18.827449]  which belongs to the cache test_cache of size 200
[   18.827533] The buggy address is located 0 bytes inside of
[   18.827533]  200-byte region [fff00000c56f3000, fff00000c56f30c8)
[   18.827592] 
[   18.827614] The buggy address belongs to the physical page:
[   18.827647] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1056f3
[   18.827917] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.828003] page_type: f5(slab)
[   18.828464] raw: 0bfffe0000000000 fff00000c1b58780 dead000000000122 0000000000000000
[   18.828586] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   18.828653] page dumped because: kasan: bad access detected
[   18.828685] 
[   18.828919] Memory state around the buggy address:
[   18.828995]  fff00000c56f2f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.829042]  fff00000c56f2f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.829085] >fff00000c56f3000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   18.829123]                    ^
[   18.829311]  fff00000c56f3080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   18.829442]  fff00000c56f3100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.829567] ==================================================================

[   12.312743] ==================================================================
[   12.314561] BUG: KASAN: double-free in kmem_cache_double_free+0x1e5/0x480
[   12.315496] Free of addr ffff888103a0a000 by task kunit_try_catch/226
[   12.315989] 
[   12.316397] CPU: 0 UID: 0 PID: 226 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   12.316450] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.316612] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.316638] Call Trace:
[   12.316652]  <TASK>
[   12.316670]  dump_stack_lvl+0x73/0xb0
[   12.316703]  print_report+0xd1/0x650
[   12.316726]  ? __virt_addr_valid+0x1db/0x2d0
[   12.316751]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.316773]  ? kmem_cache_double_free+0x1e5/0x480
[   12.316798]  kasan_report_invalid_free+0x10a/0x130
[   12.316822]  ? kmem_cache_double_free+0x1e5/0x480
[   12.316847]  ? kmem_cache_double_free+0x1e5/0x480
[   12.316870]  check_slab_allocation+0x101/0x130
[   12.316892]  __kasan_slab_pre_free+0x28/0x40
[   12.316912]  kmem_cache_free+0xed/0x420
[   12.316946]  ? kmem_cache_alloc_noprof+0x123/0x3f0
[   12.316966]  ? kmem_cache_double_free+0x1e5/0x480
[   12.316993]  kmem_cache_double_free+0x1e5/0x480
[   12.317016]  ? __pfx_kmem_cache_double_free+0x10/0x10
[   12.317039]  ? finish_task_switch.isra.0+0x153/0x700
[   12.317070]  ? __switch_to+0x47/0xf50
[   12.317099]  ? __pfx_read_tsc+0x10/0x10
[   12.317120]  ? ktime_get_ts64+0x86/0x230
[   12.317145]  kunit_try_run_case+0x1a5/0x480
[   12.317169]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.317191]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.317215]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.317237]  ? __kthread_parkme+0x82/0x180
[   12.317258]  ? preempt_count_sub+0x50/0x80
[   12.317281]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.317303]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.317325]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.317347]  kthread+0x337/0x6f0
[   12.317366]  ? trace_preempt_on+0x20/0xc0
[   12.317389]  ? __pfx_kthread+0x10/0x10
[   12.317410]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.317430]  ? calculate_sigpending+0x7b/0xa0
[   12.317453]  ? __pfx_kthread+0x10/0x10
[   12.317495]  ret_from_fork+0x116/0x1d0
[   12.317513]  ? __pfx_kthread+0x10/0x10
[   12.317533]  ret_from_fork_asm+0x1a/0x30
[   12.317564]  </TASK>
[   12.317575] 
[   12.328668] Allocated by task 226:
[   12.328865]  kasan_save_stack+0x45/0x70
[   12.329071]  kasan_save_track+0x18/0x40
[   12.329656]  kasan_save_alloc_info+0x3b/0x50
[   12.329836]  __kasan_slab_alloc+0x91/0xa0
[   12.330238]  kmem_cache_alloc_noprof+0x123/0x3f0
[   12.330639]  kmem_cache_double_free+0x14f/0x480
[   12.330828]  kunit_try_run_case+0x1a5/0x480
[   12.331204]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.331606]  kthread+0x337/0x6f0
[   12.331738]  ret_from_fork+0x116/0x1d0
[   12.332079]  ret_from_fork_asm+0x1a/0x30
[   12.332347] 
[   12.332444] Freed by task 226:
[   12.332581]  kasan_save_stack+0x45/0x70
[   12.333040]  kasan_save_track+0x18/0x40
[   12.333254]  kasan_save_free_info+0x3f/0x60
[   12.333441]  __kasan_slab_free+0x56/0x70
[   12.333850]  kmem_cache_free+0x249/0x420
[   12.334299]  kmem_cache_double_free+0x16a/0x480
[   12.334463]  kunit_try_run_case+0x1a5/0x480
[   12.334797]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.335027]  kthread+0x337/0x6f0
[   12.335196]  ret_from_fork+0x116/0x1d0
[   12.335515]  ret_from_fork_asm+0x1a/0x30
[   12.335683] 
[   12.335784] The buggy address belongs to the object at ffff888103a0a000
[   12.335784]  which belongs to the cache test_cache of size 200
[   12.336292] The buggy address is located 0 bytes inside of
[   12.336292]  200-byte region [ffff888103a0a000, ffff888103a0a0c8)
[   12.336682] 
[   12.336786] The buggy address belongs to the physical page:
[   12.336993] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103a0a
[   12.337720] flags: 0x200000000000000(node=0|zone=2)
[   12.337948] page_type: f5(slab)
[   12.338145] raw: 0200000000000000 ffff888101dc23c0 dead000000000122 0000000000000000
[   12.338435] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   12.338805] page dumped because: kasan: bad access detected
[   12.339024] 
[   12.339114] Memory state around the buggy address:
[   12.339347]  ffff888103a09f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.339619]  ffff888103a09f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.340019] >ffff888103a0a000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   12.340282]                    ^
[   12.340452]  ffff888103a0a080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   12.340807]  ffff888103a0a100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.341128] ==================================================================