Hay
Date
July 8, 2025, 7:07 p.m.

Environment
qemu-arm64
qemu-x86_64

[   20.070802] ==================================================================
[   20.070862] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3c8
[   20.070918] Free of addr fff00000c6473001 by task kunit_try_catch/211
[   20.070962] 
[   20.071006] CPU: 1 UID: 0 PID: 211 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   20.071106] Tainted: [B]=BAD_PAGE, [N]=TEST
[   20.071133] Hardware name: linux,dummy-virt (DT)
[   20.071166] Call trace:
[   20.071187]  show_stack+0x20/0x38 (C)
[   20.071237]  dump_stack_lvl+0x8c/0xd0
[   20.071289]  print_report+0x118/0x608
[   20.071336]  kasan_report_invalid_free+0xc0/0xe8
[   20.071384]  check_slab_allocation+0xfc/0x108
[   20.071433]  __kasan_slab_pre_free+0x2c/0x48
[   20.071479]  kmem_cache_free+0xf0/0x468
[   20.071523]  kmem_cache_invalid_free+0x184/0x3c8
[   20.071570]  kunit_try_run_case+0x170/0x3f0
[   20.071618]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.071671]  kthread+0x328/0x630
[   20.071725]  ret_from_fork+0x10/0x20
[   20.071773] 
[   20.072217] Allocated by task 211:
[   20.072323]  kasan_save_stack+0x3c/0x68
[   20.072379]  kasan_save_track+0x20/0x40
[   20.072416]  kasan_save_alloc_info+0x40/0x58
[   20.072465]  __kasan_slab_alloc+0xa8/0xb0
[   20.072502]  kmem_cache_alloc_noprof+0x10c/0x398
[   20.072540]  kmem_cache_invalid_free+0x12c/0x3c8
[   20.072601]  kunit_try_run_case+0x170/0x3f0
[   20.072680]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.072744]  kthread+0x328/0x630
[   20.072789]  ret_from_fork+0x10/0x20
[   20.072857] 
[   20.072902] The buggy address belongs to the object at fff00000c6473000
[   20.072902]  which belongs to the cache test_cache of size 200
[   20.072985] The buggy address is located 1 bytes inside of
[   20.072985]  200-byte region [fff00000c6473000, fff00000c64730c8)
[   20.073058] 
[   20.073081] The buggy address belongs to the physical page:
[   20.073113] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106473
[   20.073280] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   20.073338] page_type: f5(slab)
[   20.073395] raw: 0bfffe0000000000 fff00000c563c500 dead000000000122 0000000000000000
[   20.073490] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   20.073533] page dumped because: kasan: bad access detected
[   20.073601] 
[   20.073650] Memory state around the buggy address:
[   20.073727]  fff00000c6472f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   20.073803]  fff00000c6472f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   20.073845] >fff00000c6473000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   20.074109]                    ^
[   20.074196]  fff00000c6473080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   20.074273]  fff00000c6473100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.074361] ==================================================================

[   13.695975] ==================================================================
[   13.696751] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d8/0x460
[   13.697567] Free of addr ffff888102b0c001 by task kunit_try_catch/228
[   13.698210] 
[   13.698483] CPU: 0 UID: 0 PID: 228 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   13.698532] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.698544] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.698566] Call Trace:
[   13.698579]  <TASK>
[   13.698598]  dump_stack_lvl+0x73/0xb0
[   13.698629]  print_report+0xd1/0x650
[   13.698690]  ? __virt_addr_valid+0x1db/0x2d0
[   13.698716]  ? kasan_complete_mode_report_info+0x2a/0x200
[   13.698752]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.698777]  kasan_report_invalid_free+0x10a/0x130
[   13.698800]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.698825]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.698847]  check_slab_allocation+0x11f/0x130
[   13.698868]  __kasan_slab_pre_free+0x28/0x40
[   13.698887]  kmem_cache_free+0xed/0x420
[   13.698906]  ? kmem_cache_alloc_noprof+0x123/0x3f0
[   13.698925]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.698952]  kmem_cache_invalid_free+0x1d8/0x460
[   13.698975]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   13.698997]  ? finish_task_switch.isra.0+0x153/0x700
[   13.699019]  ? __switch_to+0x47/0xf50
[   13.699058]  ? __pfx_read_tsc+0x10/0x10
[   13.699078]  ? ktime_get_ts64+0x86/0x230
[   13.699103]  kunit_try_run_case+0x1a5/0x480
[   13.699128]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.699149]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.699172]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.699195]  ? __kthread_parkme+0x82/0x180
[   13.699215]  ? preempt_count_sub+0x50/0x80
[   13.699237]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.699259]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.699281]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.699302]  kthread+0x337/0x6f0
[   13.699320]  ? trace_preempt_on+0x20/0xc0
[   13.699343]  ? __pfx_kthread+0x10/0x10
[   13.699362]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.699383]  ? calculate_sigpending+0x7b/0xa0
[   13.699406]  ? __pfx_kthread+0x10/0x10
[   13.699427]  ret_from_fork+0x116/0x1d0
[   13.699444]  ? __pfx_kthread+0x10/0x10
[   13.699463]  ret_from_fork_asm+0x1a/0x30
[   13.699494]  </TASK>
[   13.699505] 
[   13.713531] Allocated by task 228:
[   13.713765]  kasan_save_stack+0x45/0x70
[   13.713914]  kasan_save_track+0x18/0x40
[   13.714075]  kasan_save_alloc_info+0x3b/0x50
[   13.714325]  __kasan_slab_alloc+0x91/0xa0
[   13.714780]  kmem_cache_alloc_noprof+0x123/0x3f0
[   13.714996]  kmem_cache_invalid_free+0x157/0x460
[   13.715185]  kunit_try_run_case+0x1a5/0x480
[   13.715393]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.715928]  kthread+0x337/0x6f0
[   13.716281]  ret_from_fork+0x116/0x1d0
[   13.716435]  ret_from_fork_asm+0x1a/0x30
[   13.716868] 
[   13.717069] The buggy address belongs to the object at ffff888102b0c000
[   13.717069]  which belongs to the cache test_cache of size 200
[   13.717751] The buggy address is located 1 bytes inside of
[   13.717751]  200-byte region [ffff888102b0c000, ffff888102b0c0c8)
[   13.718107] 
[   13.718270] The buggy address belongs to the physical page:
[   13.718844] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102b0c
[   13.719628] flags: 0x200000000000000(node=0|zone=2)
[   13.720140] page_type: f5(slab)
[   13.720468] raw: 0200000000000000 ffff88810161c780 dead000000000122 0000000000000000
[   13.721269] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   13.721925] page dumped because: kasan: bad access detected
[   13.722468] 
[   13.722594] Memory state around the buggy address:
[   13.723031]  ffff888102b0bf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.723416]  ffff888102b0bf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.723895] >ffff888102b0c000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   13.724557]                    ^
[   13.724907]  ffff888102b0c080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   13.725279]  ffff888102b0c100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.725780] ==================================================================