Hay
Date
July 3, 2025, 3:13 p.m.

Environment
qemu-arm64
qemu-x86_64

[   16.332567] ==================================================================
[   16.332695] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3c8
[   16.332757] Free of addr fff00000c78ad001 by task kunit_try_catch/214
[   16.332798] 
[   16.332830] CPU: 1 UID: 0 PID: 214 Comm: kunit_try_catch Tainted: G    B            N  6.15.5-rc1 #1 PREEMPT 
[   16.333149] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.333228] Hardware name: linux,dummy-virt (DT)
[   16.333264] Call trace:
[   16.333300]  show_stack+0x20/0x38 (C)
[   16.333352]  dump_stack_lvl+0x8c/0xd0
[   16.333403]  print_report+0x118/0x608
[   16.333446]  kasan_report_invalid_free+0xc0/0xe8
[   16.333513]  check_slab_allocation+0xfc/0x108
[   16.333559]  __kasan_slab_pre_free+0x2c/0x48
[   16.333605]  kmem_cache_free+0xf0/0x468
[   16.333770]  kmem_cache_invalid_free+0x184/0x3c8
[   16.333842]  kunit_try_run_case+0x170/0x3f0
[   16.333894]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.333958]  kthread+0x328/0x630
[   16.334033]  ret_from_fork+0x10/0x20
[   16.334120] 
[   16.334207] Allocated by task 214:
[   16.334363]  kasan_save_stack+0x3c/0x68
[   16.334550]  kasan_save_track+0x20/0x40
[   16.334742]  kasan_save_alloc_info+0x40/0x58
[   16.334778]  __kasan_slab_alloc+0xa8/0xb0
[   16.334829]  kmem_cache_alloc_noprof+0x10c/0x398
[   16.334868]  kmem_cache_invalid_free+0x12c/0x3c8
[   16.335077]  kunit_try_run_case+0x170/0x3f0
[   16.335166]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.335211]  kthread+0x328/0x630
[   16.335499]  ret_from_fork+0x10/0x20
[   16.335585] 
[   16.335643] The buggy address belongs to the object at fff00000c78ad000
[   16.335643]  which belongs to the cache test_cache of size 200
[   16.335701] The buggy address is located 1 bytes inside of
[   16.335701]  200-byte region [fff00000c78ad000, fff00000c78ad0c8)
[   16.335844] 
[   16.335982] The buggy address belongs to the physical page:
[   16.336070] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1078ad
[   16.336125] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   16.336394] page_type: f5(slab)
[   16.336438] raw: 0bfffe0000000000 fff00000c78a7140 dead000000000122 0000000000000000
[   16.336554] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   16.336665] page dumped because: kasan: bad access detected
[   16.336696] 
[   16.336714] Memory state around the buggy address:
[   16.336756]  fff00000c78acf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.336820]  fff00000c78acf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.336863] >fff00000c78ad000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   16.336910]                    ^
[   16.336943]  fff00000c78ad080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   16.337024]  fff00000c78ad100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.337082] ==================================================================

[   11.888587] ==================================================================
[   11.889065] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d8/0x460
[   11.889632] Free of addr ffff88810314b001 by task kunit_try_catch/230
[   11.889841] 
[   11.890414] CPU: 0 UID: 0 PID: 230 Comm: kunit_try_catch Tainted: G    B            N  6.15.5-rc1 #1 PREEMPT(voluntary) 
[   11.890469] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.890482] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.890505] Call Trace:
[   11.890518]  <TASK>
[   11.890538]  dump_stack_lvl+0x73/0xb0
[   11.890569]  print_report+0xd1/0x650
[   11.890593]  ? __virt_addr_valid+0x1db/0x2d0
[   11.890617]  ? kasan_complete_mode_report_info+0x2a/0x200
[   11.890639]  ? kmem_cache_invalid_free+0x1d8/0x460
[   11.890662]  kasan_report_invalid_free+0x10a/0x130
[   11.890687]  ? kmem_cache_invalid_free+0x1d8/0x460
[   11.890710]  ? kmem_cache_invalid_free+0x1d8/0x460
[   11.890730]  check_slab_allocation+0x11f/0x130
[   11.890752]  __kasan_slab_pre_free+0x28/0x40
[   11.890773]  kmem_cache_free+0xed/0x420
[   11.890795]  ? kmem_cache_alloc_noprof+0x123/0x3f0
[   11.890815]  ? kmem_cache_invalid_free+0x1d8/0x460
[   11.890839]  kmem_cache_invalid_free+0x1d8/0x460
[   11.890859]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   11.890880]  ? finish_task_switch.isra.0+0x153/0x700
[   11.890904]  ? __switch_to+0x5d9/0xf60
[   11.890926]  ? dequeue_task_fair+0x166/0x4e0
[   11.890952]  ? __pfx_read_tsc+0x10/0x10
[   11.890972]  ? ktime_get_ts64+0x86/0x230
[   11.890997]  kunit_try_run_case+0x1a5/0x480
[   11.891023]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.891045]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.891070]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.891093]  ? __kthread_parkme+0x82/0x180
[   11.891115]  ? preempt_count_sub+0x50/0x80
[   11.891139]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.891162]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.891184]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.891206]  kthread+0x337/0x6f0
[   11.891222]  ? trace_preempt_on+0x20/0xc0
[   11.891259]  ? __pfx_kthread+0x10/0x10
[   11.891378]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.891407]  ? calculate_sigpending+0x7b/0xa0
[   11.891430]  ? __pfx_kthread+0x10/0x10
[   11.891449]  ret_from_fork+0x41/0x80
[   11.891470]  ? __pfx_kthread+0x10/0x10
[   11.891488]  ret_from_fork_asm+0x1a/0x30
[   11.891519]  </TASK>
[   11.891530] 
[   11.903842] Allocated by task 230:
[   11.904319]  kasan_save_stack+0x45/0x70
[   11.904535]  kasan_save_track+0x18/0x40
[   11.904908]  kasan_save_alloc_info+0x3b/0x50
[   11.905111]  __kasan_slab_alloc+0x91/0xa0
[   11.905457]  kmem_cache_alloc_noprof+0x123/0x3f0
[   11.905891]  kmem_cache_invalid_free+0x157/0x460
[   11.906212]  kunit_try_run_case+0x1a5/0x480
[   11.906662]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.907027]  kthread+0x337/0x6f0
[   11.907203]  ret_from_fork+0x41/0x80
[   11.907402]  ret_from_fork_asm+0x1a/0x30
[   11.907862] 
[   11.907958] The buggy address belongs to the object at ffff88810314b000
[   11.907958]  which belongs to the cache test_cache of size 200
[   11.908852] The buggy address is located 1 bytes inside of
[   11.908852]  200-byte region [ffff88810314b000, ffff88810314b0c8)
[   11.909525] 
[   11.909838] The buggy address belongs to the physical page:
[   11.910079] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10314b
[   11.910636] flags: 0x200000000000000(node=0|zone=2)
[   11.910936] page_type: f5(slab)
[   11.911225] raw: 0200000000000000 ffff88810111e280 dead000000000122 0000000000000000
[   11.911880] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   11.912322] page dumped because: kasan: bad access detected
[   11.912732] 
[   11.912909] Memory state around the buggy address:
[   11.913140]  ffff88810314af00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.913717]  ffff88810314af80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.914164] >ffff88810314b000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   11.914637]                    ^
[   11.914883]  ffff88810314b080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   11.915350]  ffff88810314b100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.915927] ==================================================================