Hay
Date
June 7, 2025, 10:40 a.m.

Environment
qemu-arm64
qemu-x86_64

[   23.902951] ==================================================================
[   23.903540] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3b8
[   23.903875] Free of addr fff00000c6457001 by task kunit_try_catch/200
[   23.904909] 
[   23.905239] CPU: 1 UID: 0 PID: 200 Comm: kunit_try_catch Tainted: G    B            N 6.14.11-rc1 #1
[   23.906021] Tainted: [B]=BAD_PAGE, [N]=TEST
[   23.906104] Hardware name: linux,dummy-virt (DT)
[   23.906728] Call trace:
[   23.906831]  show_stack+0x20/0x38 (C)
[   23.907006]  dump_stack_lvl+0x8c/0xd0
[   23.907151]  print_report+0x118/0x608
[   23.907283]  kasan_report_invalid_free+0xc0/0xe8
[   23.907404]  check_slab_allocation+0xfc/0x108
[   23.907521]  __kasan_slab_pre_free+0x2c/0x48
[   23.907616]  kmem_cache_free+0xf0/0x468
[   23.907680]  kmem_cache_invalid_free+0x184/0x3b8
[   23.907739]  kunit_try_run_case+0x170/0x3f0
[   23.907800]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   23.907867]  kthread+0x318/0x620
[   23.907959]  ret_from_fork+0x10/0x20
[   23.908020] 
[   23.915721] Allocated by task 200:
[   23.916501]  kasan_save_stack+0x3c/0x68
[   23.917332]  kasan_save_track+0x20/0x40
[   23.917954]  kasan_save_alloc_info+0x40/0x58
[   23.918477]  __kasan_slab_alloc+0xa8/0xb0
[   23.919238]  kmem_cache_alloc_noprof+0x10c/0x398
[   23.919819]  kmem_cache_invalid_free+0x12c/0x3b8
[   23.920614]  kunit_try_run_case+0x170/0x3f0
[   23.921535]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   23.922256]  kthread+0x318/0x620
[   23.922678]  ret_from_fork+0x10/0x20
[   23.923215] 
[   23.923540] The buggy address belongs to the object at fff00000c6457000
[   23.923540]  which belongs to the cache test_cache of size 200
[   23.924674] The buggy address is located 1 bytes inside of
[   23.924674]  200-byte region [fff00000c6457000, fff00000c64570c8)
[   23.926560] 
[   23.926827] The buggy address belongs to the physical page:
[   23.927691] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106457
[   23.928305] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   23.928929] page_type: f5(slab)
[   23.929746] raw: 0bfffe0000000000 fff00000c5679c80 dead000000000122 0000000000000000
[   23.930580] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   23.931701] page dumped because: kasan: bad access detected
[   23.932197] 
[   23.932455] Memory state around the buggy address:
[   23.933717]  fff00000c6456f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   23.934636]  fff00000c6456f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   23.935336] >fff00000c6457000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   23.936304]                    ^
[   23.936804]  fff00000c6457080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   23.937897]  fff00000c6457100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.938592] ==================================================================

[   18.671980] ==================================================================
[   18.672718] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d9/0x470
[   18.673559] Free of addr ffff888102cad001 by task kunit_try_catch/219
[   18.674760] 
[   18.675189] CPU: 0 UID: 0 PID: 219 Comm: kunit_try_catch Tainted: G    B            N 6.14.11-rc1 #1
[   18.675436] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.675467] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   18.675497] Call Trace:
[   18.675520]  <TASK>
[   18.675549]  dump_stack_lvl+0x73/0xb0
[   18.675600]  print_report+0xd1/0x650
[   18.675631]  ? __virt_addr_valid+0x1db/0x2d0
[   18.675663]  ? kasan_complete_mode_report_info+0x2a/0x200
[   18.675709]  ? kmem_cache_invalid_free+0x1d9/0x470
[   18.675740]  kasan_report_invalid_free+0xfc/0x120
[   18.675770]  ? kmem_cache_invalid_free+0x1d9/0x470
[   18.675802]  ? kmem_cache_invalid_free+0x1d9/0x470
[   18.675832]  check_slab_allocation+0x11f/0x130
[   18.675876]  __kasan_slab_pre_free+0x28/0x40
[   18.675906]  kmem_cache_free+0xee/0x420
[   18.675932]  ? kmem_cache_alloc_noprof+0x124/0x400
[   18.675957]  ? kmem_cache_invalid_free+0x1d9/0x470
[   18.675989]  kmem_cache_invalid_free+0x1d9/0x470
[   18.676019]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   18.676047]  ? finish_task_switch.isra.0+0x153/0x700
[   18.676078]  ? __switch_to+0x5d9/0xf60
[   18.676115]  ? __pfx_read_tsc+0x10/0x10
[   18.676143]  ? ktime_get_ts64+0x86/0x230
[   18.676175]  kunit_try_run_case+0x1a6/0x480
[   18.676206]  ? __pfx_kunit_try_run_case+0x10/0x10
[   18.676232]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   18.676263]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   18.676292]  ? __kthread_parkme+0x82/0x160
[   18.676337]  ? preempt_count_sub+0x50/0x80
[   18.676368]  ? __pfx_kunit_try_run_case+0x10/0x10
[   18.676397]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   18.676430]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   18.676461]  kthread+0x324/0x6e0
[   18.676487]  ? trace_preempt_on+0x20/0xc0
[   18.676518]  ? __pfx_kthread+0x10/0x10
[   18.676545]  ? _raw_spin_unlock_irq+0x47/0x80
[   18.676572]  ? calculate_sigpending+0x7b/0xa0
[   18.676600]  ? __pfx_kthread+0x10/0x10
[   18.676628]  ret_from_fork+0x41/0x80
[   18.676651]  ? __pfx_kthread+0x10/0x10
[   18.676678]  ret_from_fork_asm+0x1a/0x30
[   18.676719]  </TASK>
[   18.676733] 
[   18.691591] Allocated by task 219:
[   18.692651]  kasan_save_stack+0x45/0x70
[   18.693642]  kasan_save_track+0x18/0x40
[   18.694180]  kasan_save_alloc_info+0x3b/0x50
[   18.694749]  __kasan_slab_alloc+0x91/0xa0
[   18.695299]  kmem_cache_alloc_noprof+0x124/0x400
[   18.695661]  kmem_cache_invalid_free+0x158/0x470
[   18.696154]  kunit_try_run_case+0x1a6/0x480
[   18.696626]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   18.697228]  kthread+0x324/0x6e0
[   18.697872]  ret_from_fork+0x41/0x80
[   18.698185]  ret_from_fork_asm+0x1a/0x30
[   18.698511] 
[   18.698948] The buggy address belongs to the object at ffff888102cad000
[   18.698948]  which belongs to the cache test_cache of size 200
[   18.699674] The buggy address is located 1 bytes inside of
[   18.699674]  200-byte region [ffff888102cad000, ffff888102cad0c8)
[   18.700602] 
[   18.700760] The buggy address belongs to the physical page:
[   18.701217] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102cad
[   18.701954] flags: 0x200000000000000(node=0|zone=2)
[   18.702377] page_type: f5(slab)
[   18.702635] raw: 0200000000000000 ffff8881003b1140 dead000000000122 0000000000000000
[   18.703164] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   18.703811] page dumped because: kasan: bad access detected
[   18.704419] 
[   18.704563] Memory state around the buggy address:
[   18.705057]  ffff888102cacf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.705928]  ffff888102cacf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.706246] >ffff888102cad000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   18.707637]                    ^
[   18.707903]  ffff888102cad080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   18.708448]  ffff888102cad100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.709197] ==================================================================