Hay
Date
July 23, 2025, 2:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   16.092266] ==================================================================
[   16.092334] BUG: KASAN: double-free in kmem_cache_double_free+0x190/0x3c8
[   16.092404] Free of addr fff00000c3f85000 by task kunit_try_catch/209
[   16.092450] 
[   16.093217] CPU: 1 UID: 0 PID: 209 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7 #1 PREEMPT 
[   16.093624] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.093711] Hardware name: linux,dummy-virt (DT)
[   16.093817] Call trace:
[   16.093841]  show_stack+0x20/0x38 (C)
[   16.093911]  dump_stack_lvl+0x8c/0xd0
[   16.093962]  print_report+0x118/0x5d0
[   16.094421]  kasan_report_invalid_free+0xc0/0xe8
[   16.094497]  check_slab_allocation+0xd4/0x108
[   16.094776]  __kasan_slab_pre_free+0x2c/0x48
[   16.095109]  kmem_cache_free+0xf0/0x468
[   16.095173]  kmem_cache_double_free+0x190/0x3c8
[   16.095361]  kunit_try_run_case+0x170/0x3f0
[   16.095555]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.096037]  kthread+0x328/0x630
[   16.096141]  ret_from_fork+0x10/0x20
[   16.096201] 
[   16.096220] Allocated by task 209:
[   16.096434]  kasan_save_stack+0x3c/0x68
[   16.096744]  kasan_save_track+0x20/0x40
[   16.096842]  kasan_save_alloc_info+0x40/0x58
[   16.097231]  __kasan_slab_alloc+0xa8/0xb0
[   16.097442]  kmem_cache_alloc_noprof+0x10c/0x398
[   16.097868]  kmem_cache_double_free+0x12c/0x3c8
[   16.098372]  kunit_try_run_case+0x170/0x3f0
[   16.098542]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.098595]  kthread+0x328/0x630
[   16.098748]  ret_from_fork+0x10/0x20
[   16.098846] 
[   16.098886] Freed by task 209:
[   16.098917]  kasan_save_stack+0x3c/0x68
[   16.099249]  kasan_save_track+0x20/0x40
[   16.099525]  kasan_save_free_info+0x4c/0x78
[   16.099726]  __kasan_slab_free+0x6c/0x98
[   16.099877]  kmem_cache_free+0x260/0x468
[   16.099915]  kmem_cache_double_free+0x140/0x3c8
[   16.100386]  kunit_try_run_case+0x170/0x3f0
[   16.100536]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.100829]  kthread+0x328/0x630
[   16.101233]  ret_from_fork+0x10/0x20
[   16.101454] 
[   16.101479] The buggy address belongs to the object at fff00000c3f85000
[   16.101479]  which belongs to the cache test_cache of size 200
[   16.101877] The buggy address is located 0 bytes inside of
[   16.101877]  200-byte region [fff00000c3f85000, fff00000c3f850c8)
[   16.102154] 
[   16.102199] The buggy address belongs to the physical page:
[   16.102488] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103f85
[   16.102878] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   16.102994] page_type: f5(slab)
[   16.103165] raw: 0bfffe0000000000 fff00000c3f17280 dead000000000122 0000000000000000
[   16.103620] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   16.103955] page dumped because: kasan: bad access detected
[   16.103994] 
[   16.104012] Memory state around the buggy address:
[   16.104271]  fff00000c3f84f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   16.104550]  fff00000c3f84f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   16.104861] >fff00000c3f85000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   16.105207]                    ^
[   16.105249]  fff00000c3f85080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   16.105467]  fff00000c3f85100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.105886] ==================================================================

[   13.281114] ==================================================================
[   13.281736] BUG: KASAN: double-free in kmem_cache_double_free+0x1e5/0x480
[   13.282051] Free of addr ffff888102b0b000 by task kunit_try_catch/226
[   13.283040] 
[   13.283360] CPU: 0 UID: 0 PID: 226 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7 #1 PREEMPT(voluntary) 
[   13.283410] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.283422] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.283454] Call Trace:
[   13.283466]  <TASK>
[   13.283483]  dump_stack_lvl+0x73/0xb0
[   13.283515]  print_report+0xd1/0x610
[   13.283537]  ? __virt_addr_valid+0x1db/0x2d0
[   13.283561]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.283581]  ? kmem_cache_double_free+0x1e5/0x480
[   13.283606]  kasan_report_invalid_free+0x10a/0x130
[   13.283629]  ? kmem_cache_double_free+0x1e5/0x480
[   13.283654]  ? kmem_cache_double_free+0x1e5/0x480
[   13.283677]  check_slab_allocation+0x101/0x130
[   13.283697]  __kasan_slab_pre_free+0x28/0x40
[   13.283717]  kmem_cache_free+0xed/0x420
[   13.283737]  ? kmem_cache_alloc_noprof+0x123/0x3f0
[   13.283758]  ? kmem_cache_double_free+0x1e5/0x480
[   13.283784]  kmem_cache_double_free+0x1e5/0x480
[   13.283807]  ? __pfx_kmem_cache_double_free+0x10/0x10
[   13.283839]  ? finish_task_switch.isra.0+0x153/0x700
[   13.283860]  ? __switch_to+0x47/0xf50
[   13.283889]  ? __pfx_read_tsc+0x10/0x10
[   13.283908]  ? ktime_get_ts64+0x86/0x230
[   13.283932]  kunit_try_run_case+0x1a5/0x480
[   13.283956]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.283978]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.284001]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.284023]  ? __kthread_parkme+0x82/0x180
[   13.284043]  ? preempt_count_sub+0x50/0x80
[   13.284065]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.284088]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.284110]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.284132]  kthread+0x337/0x6f0
[   13.284150]  ? trace_preempt_on+0x20/0xc0
[   13.284173]  ? __pfx_kthread+0x10/0x10
[   13.284193]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.284280]  ? calculate_sigpending+0x7b/0xa0
[   13.284304]  ? __pfx_kthread+0x10/0x10
[   13.284324]  ret_from_fork+0x116/0x1d0
[   13.284342]  ? __pfx_kthread+0x10/0x10
[   13.284362]  ret_from_fork_asm+0x1a/0x30
[   13.284392]  </TASK>
[   13.284401] 
[   13.295392] Allocated by task 226:
[   13.295886]  kasan_save_stack+0x45/0x70
[   13.296554]  kasan_save_track+0x18/0x40
[   13.296759]  kasan_save_alloc_info+0x3b/0x50
[   13.297065]  __kasan_slab_alloc+0x91/0xa0
[   13.297398]  kmem_cache_alloc_noprof+0x123/0x3f0
[   13.297733]  kmem_cache_double_free+0x14f/0x480
[   13.297958]  kunit_try_run_case+0x1a5/0x480
[   13.298169]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.298678]  kthread+0x337/0x6f0
[   13.298966]  ret_from_fork+0x116/0x1d0
[   13.299343]  ret_from_fork_asm+0x1a/0x30
[   13.299665] 
[   13.299768] Freed by task 226:
[   13.300096]  kasan_save_stack+0x45/0x70
[   13.300476]  kasan_save_track+0x18/0x40
[   13.300677]  kasan_save_free_info+0x3f/0x60
[   13.300903]  __kasan_slab_free+0x56/0x70
[   13.301572]  kmem_cache_free+0x249/0x420
[   13.301766]  kmem_cache_double_free+0x16a/0x480
[   13.302062]  kunit_try_run_case+0x1a5/0x480
[   13.302393]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.302860]  kthread+0x337/0x6f0
[   13.303045]  ret_from_fork+0x116/0x1d0
[   13.303425]  ret_from_fork_asm+0x1a/0x30
[   13.303805] 
[   13.303926] The buggy address belongs to the object at ffff888102b0b000
[   13.303926]  which belongs to the cache test_cache of size 200
[   13.304631] The buggy address is located 0 bytes inside of
[   13.304631]  200-byte region [ffff888102b0b000, ffff888102b0b0c8)
[   13.305500] 
[   13.305609] The buggy address belongs to the physical page:
[   13.305827] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102b0b
[   13.306623] flags: 0x200000000000000(node=0|zone=2)
[   13.306844] page_type: f5(slab)
[   13.307349] raw: 0200000000000000 ffff888101a35a00 dead000000000122 0000000000000000
[   13.307949] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   13.308587] page dumped because: kasan: bad access detected
[   13.308859] 
[   13.308955] Memory state around the buggy address:
[   13.309391]  ffff888102b0af00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.309897]  ffff888102b0af80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.310460] >ffff888102b0b000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   13.310839]                    ^
[   13.310991]  ffff888102b0b080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   13.311652]  ffff888102b0b100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.311951] ==================================================================