Hay
Date
July 8, 2025, 11:09 p.m.

Environment
qemu-arm64
qemu-x86_64

[   20.033283] ==================================================================
[   20.033348] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3c8
[   20.033410] Free of addr fff00000c772d001 by task kunit_try_catch/211
[   20.033452] 
[   20.033495] CPU: 1 UID: 0 PID: 211 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   20.033775] Tainted: [B]=BAD_PAGE, [N]=TEST
[   20.033863] Hardware name: linux,dummy-virt (DT)
[   20.034025] Call trace:
[   20.034098]  show_stack+0x20/0x38 (C)
[   20.034220]  dump_stack_lvl+0x8c/0xd0
[   20.034663]  print_report+0x118/0x608
[   20.035279]  kasan_report_invalid_free+0xc0/0xe8
[   20.035485]  check_slab_allocation+0xfc/0x108
[   20.035563]  __kasan_slab_pre_free+0x2c/0x48
[   20.035612]  kmem_cache_free+0xf0/0x468
[   20.035661]  kmem_cache_invalid_free+0x184/0x3c8
[   20.035711]  kunit_try_run_case+0x170/0x3f0
[   20.035759]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.035812]  kthread+0x328/0x630
[   20.035854]  ret_from_fork+0x10/0x20
[   20.036569] 
[   20.036597] Allocated by task 211:
[   20.036651]  kasan_save_stack+0x3c/0x68
[   20.036699]  kasan_save_track+0x20/0x40
[   20.037212]  kasan_save_alloc_info+0x40/0x58
[   20.037272]  __kasan_slab_alloc+0xa8/0xb0
[   20.037610]  kmem_cache_alloc_noprof+0x10c/0x398
[   20.037681]  kmem_cache_invalid_free+0x12c/0x3c8
[   20.038023]  kunit_try_run_case+0x170/0x3f0
[   20.038328]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.038556]  kthread+0x328/0x630
[   20.038593]  ret_from_fork+0x10/0x20
[   20.038630] 
[   20.039105] The buggy address belongs to the object at fff00000c772d000
[   20.039105]  which belongs to the cache test_cache of size 200
[   20.039476] The buggy address is located 1 bytes inside of
[   20.039476]  200-byte region [fff00000c772d000, fff00000c772d0c8)
[   20.039604] 
[   20.039626] The buggy address belongs to the physical page:
[   20.039659] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10772d
[   20.039990] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   20.040368] page_type: f5(slab)
[   20.040758] raw: 0bfffe0000000000 fff00000c63df280 dead000000000122 0000000000000000
[   20.041074] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   20.041261] page dumped because: kasan: bad access detected
[   20.041298] 
[   20.041397] Memory state around the buggy address:
[   20.041579]  fff00000c772cf00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   20.041625]  fff00000c772cf80: fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc fc
[   20.041671] >fff00000c772d000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   20.041709]                    ^
[   20.041737]  fff00000c772d080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   20.042434]  fff00000c772d100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.042493] ==================================================================

[   13.263184] ==================================================================
[   13.264001] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d8/0x460
[   13.264807] Free of addr ffff888102677001 by task kunit_try_catch/229
[   13.265494] 
[   13.265801] CPU: 1 UID: 0 PID: 229 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   13.265852] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.265863] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.265885] Call Trace:
[   13.265898]  <TASK>
[   13.265918]  dump_stack_lvl+0x73/0xb0
[   13.265954]  print_report+0xd1/0x650
[   13.265978]  ? __virt_addr_valid+0x1db/0x2d0
[   13.266004]  ? kasan_complete_mode_report_info+0x2a/0x200
[   13.266027]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.266054]  kasan_report_invalid_free+0x10a/0x130
[   13.266078]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.266105]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.266130]  check_slab_allocation+0x11f/0x130
[   13.266152]  __kasan_slab_pre_free+0x28/0x40
[   13.266173]  kmem_cache_free+0xed/0x420
[   13.266193]  ? kmem_cache_alloc_noprof+0x123/0x3f0
[   13.266213]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.266241]  kmem_cache_invalid_free+0x1d8/0x460
[   13.266265]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   13.266289]  ? finish_task_switch.isra.0+0x153/0x700
[   13.266314]  ? __switch_to+0x47/0xf50
[   13.266343]  ? __pfx_read_tsc+0x10/0x10
[   13.266365]  ? ktime_get_ts64+0x86/0x230
[   13.266390]  kunit_try_run_case+0x1a5/0x480
[   13.266416]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.266439]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.266464]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.266487]  ? __kthread_parkme+0x82/0x180
[   13.266509]  ? preempt_count_sub+0x50/0x80
[   13.266531]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.266623]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.266648]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.266678]  kthread+0x337/0x6f0
[   13.266696]  ? trace_preempt_on+0x20/0xc0
[   13.266721]  ? __pfx_kthread+0x10/0x10
[   13.266741]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.266762]  ? calculate_sigpending+0x7b/0xa0
[   13.266787]  ? __pfx_kthread+0x10/0x10
[   13.266807]  ret_from_fork+0x116/0x1d0
[   13.266825]  ? __pfx_kthread+0x10/0x10
[   13.266845]  ret_from_fork_asm+0x1a/0x30
[   13.266878]  </TASK>
[   13.266889] 
[   13.282483] Allocated by task 229:
[   13.282755]  kasan_save_stack+0x45/0x70
[   13.283167]  kasan_save_track+0x18/0x40
[   13.283647]  kasan_save_alloc_info+0x3b/0x50
[   13.283929]  __kasan_slab_alloc+0x91/0xa0
[   13.284361]  kmem_cache_alloc_noprof+0x123/0x3f0
[   13.284536]  kmem_cache_invalid_free+0x157/0x460
[   13.285020]  kunit_try_run_case+0x1a5/0x480
[   13.285404]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.285636]  kthread+0x337/0x6f0
[   13.285763]  ret_from_fork+0x116/0x1d0
[   13.285896]  ret_from_fork_asm+0x1a/0x30
[   13.286405] 
[   13.286587] The buggy address belongs to the object at ffff888102677000
[   13.286587]  which belongs to the cache test_cache of size 200
[   13.287944] The buggy address is located 1 bytes inside of
[   13.287944]  200-byte region [ffff888102677000, ffff8881026770c8)
[   13.288464] 
[   13.288621] The buggy address belongs to the physical page:
[   13.289108] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102677
[   13.290023] flags: 0x200000000000000(node=0|zone=2)
[   13.290224] page_type: f5(slab)
[   13.290346] raw: 0200000000000000 ffff888101d19b40 dead000000000122 0000000000000000
[   13.290616] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   13.291269] page dumped because: kasan: bad access detected
[   13.291877] 
[   13.292069] Memory state around the buggy address:
[   13.292483]  ffff888102676f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.293342]  ffff888102676f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.293720] >ffff888102677000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   13.293994]                    ^
[   13.294298]  ffff888102677080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   13.294986]  ffff888102677100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.295621] ==================================================================