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

Environment
qemu-arm64
qemu-x86_64

[   31.746672] ==================================================================
[   31.746744] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3c8
[   31.746816] Free of addr fff00000c9a5b001 by task kunit_try_catch/244
[   31.746858] 
[   31.747283] CPU: 0 UID: 0 PID: 244 Comm: kunit_try_catch Tainted: G    B   W        N  6.16.0-rc7-next-20250723 #1 PREEMPT 
[   31.747394] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   31.747426] Hardware name: linux,dummy-virt (DT)
[   31.747460] Call trace:
[   31.747485]  show_stack+0x20/0x38 (C)
[   31.747687]  dump_stack_lvl+0x8c/0xd0
[   31.747754]  print_report+0x118/0x5e8
[   31.747930]  kasan_report_invalid_free+0xc0/0xe8
[   31.747985]  check_slab_allocation+0xfc/0x108
[   31.748032]  __kasan_slab_pre_free+0x2c/0x48
[   31.748156]  kmem_cache_free+0xf0/0x468
[   31.748257]  kmem_cache_invalid_free+0x184/0x3c8
[   31.748336]  kunit_try_run_case+0x170/0x3f0
[   31.748423]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.748479]  kthread+0x328/0x630
[   31.748646]  ret_from_fork+0x10/0x20
[   31.748804] 
[   31.748887] Allocated by task 244:
[   31.748939]  kasan_save_stack+0x3c/0x68
[   31.749008]  kasan_save_track+0x20/0x40
[   31.749077]  kasan_save_alloc_info+0x40/0x58
[   31.749125]  __kasan_slab_alloc+0xa8/0xb0
[   31.749161]  kmem_cache_alloc_noprof+0x10c/0x398
[   31.749395]  kmem_cache_invalid_free+0x12c/0x3c8
[   31.749505]  kunit_try_run_case+0x170/0x3f0
[   31.749602]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.749681]  kthread+0x328/0x630
[   31.749799]  ret_from_fork+0x10/0x20
[   31.750100] 
[   31.750155] The buggy address belongs to the object at fff00000c9a5b000
[   31.750155]  which belongs to the cache test_cache of size 200
[   31.750219] The buggy address is located 1 bytes inside of
[   31.750219]  200-byte region [fff00000c9a5b000, fff00000c9a5b0c8)
[   31.750339] 
[   31.750384] The buggy address belongs to the physical page:
[   31.750440] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109a5b
[   31.750530] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   31.750624] page_type: f5(slab)
[   31.750665] raw: 0bfffe0000000000 fff00000c5c24780 dead000000000122 0000000000000000
[   31.750754] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   31.750812] page dumped because: kasan: bad access detected
[   31.750851] 
[   31.750890] Memory state around the buggy address:
[   31.750981]  fff00000c9a5af00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   31.751054]  fff00000c9a5af80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   31.751130] >fff00000c9a5b000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   31.751227]                    ^
[   31.751550]  fff00000c9a5b080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   31.751700]  fff00000c9a5b100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.751770] ==================================================================

[   25.948791] ==================================================================
[   25.950069] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d8/0x460
[   25.951109] Free of addr ffff888106118001 by task kunit_try_catch/260
[   25.951463] 
[   25.951586] CPU: 0 UID: 0 PID: 260 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7-next-20250723 #1 PREEMPT(voluntary) 
[   25.951653] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.951668] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   25.951692] Call Trace:
[   25.951708]  <TASK>
[   25.951730]  dump_stack_lvl+0x73/0xb0
[   25.951766]  print_report+0xd1/0x640
[   25.951792]  ? __virt_addr_valid+0x1db/0x2d0
[   25.951819]  ? kasan_complete_mode_report_info+0x2a/0x200
[   25.951845]  ? kmem_cache_invalid_free+0x1d8/0x460
[   25.951870]  kasan_report_invalid_free+0x10a/0x130
[   25.951893]  ? kmem_cache_invalid_free+0x1d8/0x460
[   25.951919]  ? kmem_cache_invalid_free+0x1d8/0x460
[   25.951944]  check_slab_allocation+0x11f/0x130
[   25.951966]  __kasan_slab_pre_free+0x28/0x40
[   25.951987]  kmem_cache_free+0xed/0x420
[   25.952007]  ? kmem_cache_alloc_noprof+0x123/0x3f0
[   25.952033]  ? kmem_cache_invalid_free+0x1d8/0x460
[   25.952059]  kmem_cache_invalid_free+0x1d8/0x460
[   25.952083]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   25.952107]  ? finish_task_switch.isra.0+0x153/0x700
[   25.952129]  ? __switch_to+0x47/0xf80
[   25.952181]  ? __pfx_read_tsc+0x10/0x10
[   25.952203]  ? ktime_get_ts64+0x86/0x230
[   25.952241]  kunit_try_run_case+0x1a5/0x480
[   25.952268]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.952290]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   25.952316]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   25.952341]  ? __kthread_parkme+0x82/0x180
[   25.952361]  ? preempt_count_sub+0x50/0x80
[   25.952384]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.952416]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.952516]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   25.952541]  kthread+0x337/0x6f0
[   25.952564]  ? trace_preempt_on+0x20/0xc0
[   25.952596]  ? __pfx_kthread+0x10/0x10
[   25.952619]  ? _raw_spin_unlock_irq+0x47/0x80
[   25.952644]  ? calculate_sigpending+0x7b/0xa0
[   25.952669]  ? __pfx_kthread+0x10/0x10
[   25.952691]  ret_from_fork+0x116/0x1d0
[   25.952711]  ? __pfx_kthread+0x10/0x10
[   25.952732]  ret_from_fork_asm+0x1a/0x30
[   25.952763]  </TASK>
[   25.952775] 
[   25.965405] Allocated by task 260:
[   25.965761]  kasan_save_stack+0x45/0x70
[   25.966117]  kasan_save_track+0x18/0x40
[   25.966578]  kasan_save_alloc_info+0x3b/0x50
[   25.967040]  __kasan_slab_alloc+0x91/0xa0
[   25.967467]  kmem_cache_alloc_noprof+0x123/0x3f0
[   25.967872]  kmem_cache_invalid_free+0x157/0x460
[   25.968036]  kunit_try_run_case+0x1a5/0x480
[   25.968189]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.968362]  kthread+0x337/0x6f0
[   25.969062]  ret_from_fork+0x116/0x1d0
[   25.969488]  ret_from_fork_asm+0x1a/0x30
[   25.969885] 
[   25.970066] The buggy address belongs to the object at ffff888106118000
[   25.970066]  which belongs to the cache test_cache of size 200
[   25.971164] The buggy address is located 1 bytes inside of
[   25.971164]  200-byte region [ffff888106118000, ffff8881061180c8)
[   25.971911] 
[   25.971984] The buggy address belongs to the physical page:
[   25.972232] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106118
[   25.972962] flags: 0x200000000000000(node=0|zone=2)
[   25.973624] page_type: f5(slab)
[   25.973942] raw: 0200000000000000 ffff888101dc63c0 dead000000000122 0000000000000000
[   25.974691] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   25.975091] page dumped because: kasan: bad access detected
[   25.975271] 
[   25.975338] Memory state around the buggy address:
[   25.975699]  ffff888106117f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.976361]  ffff888106117f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.977039] >ffff888106118000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   25.977727]                    ^
[   25.978079]  ffff888106118080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   25.978368]  ffff888106118100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.979232] ==================================================================