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

Environment
qemu-arm64
qemu-x86_64

[   18.714627] ==================================================================
[   18.714690] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3c8
[   18.715977] Free of addr fff00000c76e8001 by task kunit_try_catch/211
[   18.716282] 
[   18.716512] CPU: 1 UID: 0 PID: 211 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   18.716833] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.717247] Hardware name: linux,dummy-virt (DT)
[   18.717319] Call trace:
[   18.717427]  show_stack+0x20/0x38 (C)
[   18.717538]  dump_stack_lvl+0x8c/0xd0
[   18.717608]  print_report+0x118/0x608
[   18.718180]  kasan_report_invalid_free+0xc0/0xe8
[   18.718275]  check_slab_allocation+0xfc/0x108
[   18.718663]  __kasan_slab_pre_free+0x2c/0x48
[   18.718736]  kmem_cache_free+0xf0/0x468
[   18.718989]  kmem_cache_invalid_free+0x184/0x3c8
[   18.719152]  kunit_try_run_case+0x170/0x3f0
[   18.719368]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.719621]  kthread+0x328/0x630
[   18.719766]  ret_from_fork+0x10/0x20
[   18.720195] 
[   18.720239] Allocated by task 211:
[   18.720272]  kasan_save_stack+0x3c/0x68
[   18.720334]  kasan_save_track+0x20/0x40
[   18.720797]  kasan_save_alloc_info+0x40/0x58
[   18.720992]  __kasan_slab_alloc+0xa8/0xb0
[   18.721135]  kmem_cache_alloc_noprof+0x10c/0x398
[   18.721208]  kmem_cache_invalid_free+0x12c/0x3c8
[   18.721264]  kunit_try_run_case+0x170/0x3f0
[   18.721432]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.721772]  kthread+0x328/0x630
[   18.721903]  ret_from_fork+0x10/0x20
[   18.721969] 
[   18.722063] The buggy address belongs to the object at fff00000c76e8000
[   18.722063]  which belongs to the cache test_cache of size 200
[   18.722124] The buggy address is located 1 bytes inside of
[   18.722124]  200-byte region [fff00000c76e8000, fff00000c76e80c8)
[   18.722527] 
[   18.722555] The buggy address belongs to the physical page:
[   18.722862] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1076e8
[   18.723086] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.723370] page_type: f5(slab)
[   18.723629] raw: 0bfffe0000000000 fff00000c46f5b40 dead000000000122 0000000000000000
[   18.723878] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   18.724124] page dumped because: kasan: bad access detected
[   18.724192] 
[   18.724244] Memory state around the buggy address:
[   18.724409]  fff00000c76e7f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   18.724463]  fff00000c76e7f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   18.724592] >fff00000c76e8000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   18.724633]                    ^
[   18.724661]  fff00000c76e8080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   18.724912]  fff00000c76e8100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.725048] ==================================================================

[   12.723087] ==================================================================
[   12.723697] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d8/0x460
[   12.723955] Free of addr ffff88810398b001 by task kunit_try_catch/228
[   12.724155] 
[   12.724290] CPU: 1 UID: 0 PID: 228 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   12.724340] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.724352] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.724375] Call Trace:
[   12.724388]  <TASK>
[   12.724426]  dump_stack_lvl+0x73/0xb0
[   12.724461]  print_report+0xd1/0x650
[   12.724483]  ? __virt_addr_valid+0x1db/0x2d0
[   12.724508]  ? kasan_complete_mode_report_info+0x2a/0x200
[   12.724529]  ? kmem_cache_invalid_free+0x1d8/0x460
[   12.724553]  kasan_report_invalid_free+0x10a/0x130
[   12.724576]  ? kmem_cache_invalid_free+0x1d8/0x460
[   12.724601]  ? kmem_cache_invalid_free+0x1d8/0x460
[   12.724624]  check_slab_allocation+0x11f/0x130
[   12.724644]  __kasan_slab_pre_free+0x28/0x40
[   12.724664]  kmem_cache_free+0xed/0x420
[   12.724722]  ? kmem_cache_alloc_noprof+0x123/0x3f0
[   12.724760]  ? kmem_cache_invalid_free+0x1d8/0x460
[   12.724805]  kmem_cache_invalid_free+0x1d8/0x460
[   12.724829]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   12.724854]  ? finish_task_switch.isra.0+0x153/0x700
[   12.724877]  ? __switch_to+0x47/0xf50
[   12.724905]  ? __pfx_read_tsc+0x10/0x10
[   12.724925]  ? ktime_get_ts64+0x86/0x230
[   12.724948]  kunit_try_run_case+0x1a5/0x480
[   12.724974]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.724995]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.725019]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.725040]  ? __kthread_parkme+0x82/0x180
[   12.725061]  ? preempt_count_sub+0x50/0x80
[   12.725082]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.725103]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.725124]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.725145]  kthread+0x337/0x6f0
[   12.725163]  ? trace_preempt_on+0x20/0xc0
[   12.725186]  ? __pfx_kthread+0x10/0x10
[   12.725484]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.725515]  ? calculate_sigpending+0x7b/0xa0
[   12.725541]  ? __pfx_kthread+0x10/0x10
[   12.725561]  ret_from_fork+0x116/0x1d0
[   12.725580]  ? __pfx_kthread+0x10/0x10
[   12.725598]  ret_from_fork_asm+0x1a/0x30
[   12.725629]  </TASK>
[   12.725640] 
[   12.737118] Allocated by task 228:
[   12.737367]  kasan_save_stack+0x45/0x70
[   12.737533]  kasan_save_track+0x18/0x40
[   12.737665]  kasan_save_alloc_info+0x3b/0x50
[   12.738132]  __kasan_slab_alloc+0x91/0xa0
[   12.738884]  kmem_cache_alloc_noprof+0x123/0x3f0
[   12.739091]  kmem_cache_invalid_free+0x157/0x460
[   12.739395]  kunit_try_run_case+0x1a5/0x480
[   12.739960]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.740195]  kthread+0x337/0x6f0
[   12.740386]  ret_from_fork+0x116/0x1d0
[   12.740629]  ret_from_fork_asm+0x1a/0x30
[   12.740873] 
[   12.740974] The buggy address belongs to the object at ffff88810398b000
[   12.740974]  which belongs to the cache test_cache of size 200
[   12.741592] The buggy address is located 1 bytes inside of
[   12.741592]  200-byte region [ffff88810398b000, ffff88810398b0c8)
[   12.742025] 
[   12.742129] The buggy address belongs to the physical page:
[   12.742332] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10398b
[   12.742642] flags: 0x200000000000000(node=0|zone=2)
[   12.742984] page_type: f5(slab)
[   12.743423] raw: 0200000000000000 ffff888101d0c780 dead000000000122 0000000000000000
[   12.743667] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   12.745053] page dumped because: kasan: bad access detected
[   12.745529] 
[   12.745818] Memory state around the buggy address:
[   12.746109]  ffff88810398af00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.746593]  ffff88810398af80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.747027] >ffff88810398b000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   12.747474]                    ^
[   12.747799]  ffff88810398b080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   12.748097]  ffff88810398b100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.748693] ==================================================================