Hay
Date
July 18, 2025, 11:11 p.m.

Environment
qemu-arm64
qemu-x86_64

[   16.056866] ==================================================================
[   16.057051] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3c8
[   16.057579] Free of addr fff00000c3f2a001 by task kunit_try_catch/211
[   16.057892] 
[   16.057935] CPU: 1 UID: 0 PID: 211 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   16.058021] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.058047] Hardware name: linux,dummy-virt (DT)
[   16.058269] Call trace:
[   16.058297]  show_stack+0x20/0x38 (C)
[   16.058571]  dump_stack_lvl+0x8c/0xd0
[   16.058622]  print_report+0x118/0x5d0
[   16.058747]  kasan_report_invalid_free+0xc0/0xe8
[   16.058799]  check_slab_allocation+0xfc/0x108
[   16.058848]  __kasan_slab_pre_free+0x2c/0x48
[   16.058991]  kmem_cache_free+0xf0/0x468
[   16.059039]  kmem_cache_invalid_free+0x184/0x3c8
[   16.059090]  kunit_try_run_case+0x170/0x3f0
[   16.059138]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.059192]  kthread+0x328/0x630
[   16.059656]  ret_from_fork+0x10/0x20
[   16.059832] 
[   16.059853] Allocated by task 211:
[   16.059885]  kasan_save_stack+0x3c/0x68
[   16.059954]  kasan_save_track+0x20/0x40
[   16.060013]  kasan_save_alloc_info+0x40/0x58
[   16.060126]  __kasan_slab_alloc+0xa8/0xb0
[   16.060165]  kmem_cache_alloc_noprof+0x10c/0x398
[   16.060211]  kmem_cache_invalid_free+0x12c/0x3c8
[   16.061091]  kunit_try_run_case+0x170/0x3f0
[   16.061572]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.061633]  kthread+0x328/0x630
[   16.061668]  ret_from_fork+0x10/0x20
[   16.061706] 
[   16.061726] The buggy address belongs to the object at fff00000c3f2a000
[   16.061726]  which belongs to the cache test_cache of size 200
[   16.061785] The buggy address is located 1 bytes inside of
[   16.061785]  200-byte region [fff00000c3f2a000, fff00000c3f2a0c8)
[   16.061845] 
[   16.061867] The buggy address belongs to the physical page:
[   16.061901] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103f2a
[   16.061955] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   16.062006] page_type: f5(slab)
[   16.062047] raw: 0bfffe0000000000 fff00000c3e97c80 dead000000000122 0000000000000000
[   16.062098] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   16.062138] page dumped because: kasan: bad access detected
[   16.062167] 
[   16.062187] Memory state around the buggy address:
[   16.062219]  fff00000c3f29f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   16.062262]  fff00000c3f29f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   16.062305] >fff00000c3f2a000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   16.062364]                    ^
[   16.062392]  fff00000c3f2a080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   16.062434]  fff00000c3f2a100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.062473] ==================================================================

[   12.900879] ==================================================================
[   12.901426] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d8/0x460
[   12.901791] Free of addr ffff8881030f3001 by task kunit_try_catch/230
[   12.902230] 
[   12.902362] CPU: 1 UID: 0 PID: 230 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   12.902406] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.902464] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.902485] Call Trace:
[   12.902497]  <TASK>
[   12.902523]  dump_stack_lvl+0x73/0xb0
[   12.902555]  print_report+0xd1/0x610
[   12.902577]  ? __virt_addr_valid+0x1db/0x2d0
[   12.902601]  ? kasan_complete_mode_report_info+0x2a/0x200
[   12.902652]  ? kmem_cache_invalid_free+0x1d8/0x460
[   12.902679]  kasan_report_invalid_free+0x10a/0x130
[   12.902716]  ? kmem_cache_invalid_free+0x1d8/0x460
[   12.902743]  ? kmem_cache_invalid_free+0x1d8/0x460
[   12.902767]  check_slab_allocation+0x11f/0x130
[   12.902788]  __kasan_slab_pre_free+0x28/0x40
[   12.902835]  kmem_cache_free+0xed/0x420
[   12.902855]  ? kmem_cache_alloc_noprof+0x123/0x3f0
[   12.902875]  ? kmem_cache_invalid_free+0x1d8/0x460
[   12.902912]  kmem_cache_invalid_free+0x1d8/0x460
[   12.902937]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   12.902961]  ? finish_task_switch.isra.0+0x153/0x700
[   12.902983]  ? __switch_to+0x47/0xf50
[   12.903028]  ? __pfx_read_tsc+0x10/0x10
[   12.903048]  ? ktime_get_ts64+0x86/0x230
[   12.903071]  kunit_try_run_case+0x1a5/0x480
[   12.903113]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.903134]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.903171]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.903193]  ? __kthread_parkme+0x82/0x180
[   12.903225]  ? preempt_count_sub+0x50/0x80
[   12.903248]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.903278]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.903311]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.903346]  kthread+0x337/0x6f0
[   12.903365]  ? trace_preempt_on+0x20/0xc0
[   12.903387]  ? __pfx_kthread+0x10/0x10
[   12.903406]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.903438]  ? calculate_sigpending+0x7b/0xa0
[   12.903478]  ? __pfx_kthread+0x10/0x10
[   12.903498]  ret_from_fork+0x116/0x1d0
[   12.903516]  ? __pfx_kthread+0x10/0x10
[   12.903535]  ret_from_fork_asm+0x1a/0x30
[   12.903566]  </TASK>
[   12.903575] 
[   12.912522] Allocated by task 230:
[   12.912743]  kasan_save_stack+0x45/0x70
[   12.912970]  kasan_save_track+0x18/0x40
[   12.913343]  kasan_save_alloc_info+0x3b/0x50
[   12.913585]  __kasan_slab_alloc+0x91/0xa0
[   12.913796]  kmem_cache_alloc_noprof+0x123/0x3f0
[   12.914135]  kmem_cache_invalid_free+0x157/0x460
[   12.914396]  kunit_try_run_case+0x1a5/0x480
[   12.914657]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.914913]  kthread+0x337/0x6f0
[   12.915186]  ret_from_fork+0x116/0x1d0
[   12.915385]  ret_from_fork_asm+0x1a/0x30
[   12.915600] 
[   12.915694] The buggy address belongs to the object at ffff8881030f3000
[   12.915694]  which belongs to the cache test_cache of size 200
[   12.916337] The buggy address is located 1 bytes inside of
[   12.916337]  200-byte region [ffff8881030f3000, ffff8881030f30c8)
[   12.916776] 
[   12.916900] The buggy address belongs to the physical page:
[   12.917317] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1030f3
[   12.917707] flags: 0x200000000000000(node=0|zone=2)
[   12.917948] page_type: f5(slab)
[   12.918212] raw: 0200000000000000 ffff888101093a00 dead000000000122 0000000000000000
[   12.918651] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   12.919055] page dumped because: kasan: bad access detected
[   12.919381] 
[   12.919510] Memory state around the buggy address:
[   12.919740]  ffff8881030f2f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.920148]  ffff8881030f2f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.920421] >ffff8881030f3000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   12.920764]                    ^
[   12.920939]  ffff8881030f3080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   12.921398]  ffff8881030f3100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.921716] ==================================================================