Hay
Date
June 2, 2025, 2:10 p.m.

Environment
qemu-arm64
qemu-x86_64

[   20.805756] ==================================================================
[   20.806549] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x190/0x3d8
[   20.806935] Free of addr fff00000c6cf6001 by task kunit_try_catch/198
[   20.807604] 
[   20.807826] CPU: 0 UID: 0 PID: 198 Comm: kunit_try_catch Tainted: G    B            N 6.12.32-rc1 #1
[   20.807947] Tainted: [B]=BAD_PAGE, [N]=TEST
[   20.807983] Hardware name: linux,dummy-virt (DT)
[   20.808025] Call trace:
[   20.808055]  dump_backtrace+0x9c/0x128
[   20.808122]  show_stack+0x20/0x38
[   20.808165]  dump_stack_lvl+0x8c/0xd0
[   20.808218]  print_report+0x118/0x5f0
[   20.808278]  kasan_report_invalid_free+0xc0/0xe8
[   20.808327]  check_slab_allocation+0xfc/0x108
[   20.808372]  __kasan_slab_pre_free+0x2c/0x48
[   20.808417]  kmem_cache_free+0xf0/0x460
[   20.808462]  kmem_cache_invalid_free+0x190/0x3d8
[   20.808512]  kunit_try_run_case+0x170/0x3f0
[   20.808560]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.808612]  kthread+0x24c/0x2d0
[   20.808657]  ret_from_fork+0x10/0x20
[   20.808707] 
[   20.813111] Allocated by task 198:
[   20.813691]  kasan_save_stack+0x3c/0x68
[   20.814113]  kasan_save_track+0x20/0x40
[   20.814322]  kasan_save_alloc_info+0x40/0x58
[   20.814700]  __kasan_slab_alloc+0xa8/0xb0
[   20.814926]  kmem_cache_alloc_noprof+0xf8/0x300
[   20.815233]  kmem_cache_invalid_free+0x130/0x3d8
[   20.815608]  kunit_try_run_case+0x170/0x3f0
[   20.815883]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.816290]  kthread+0x24c/0x2d0
[   20.816517]  ret_from_fork+0x10/0x20
[   20.816758] 
[   20.816959] The buggy address belongs to the object at fff00000c6cf6000
[   20.816959]  which belongs to the cache test_cache of size 200
[   20.817517] The buggy address is located 1 bytes inside of
[   20.817517]  200-byte region [fff00000c6cf6000, fff00000c6cf60c8)
[   20.818471] 
[   20.818707] The buggy address belongs to the physical page:
[   20.819086] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106cf6
[   20.819741] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   20.820010] page_type: f5(slab)
[   20.820262] raw: 0bfffe0000000000 fff00000c5a6fa00 dead000000000122 0000000000000000
[   20.820769] raw: 0000000000000000 00000000800f000f 00000001f5000000 0000000000000000
[   20.821214] page dumped because: kasan: bad access detected
[   20.821649] 
[   20.821778] Memory state around the buggy address:
[   20.822085]  fff00000c6cf5f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.822547]  fff00000c6cf5f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.822978] >fff00000c6cf6000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   20.823583]                    ^
[   20.823782]  fff00000c6cf6080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   20.824206]  fff00000c6cf6100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.824524] ==================================================================

[   12.821531] ==================================================================
[   12.821990] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d9/0x470
[   12.822395] Free of addr ffff888102982001 by task kunit_try_catch/216
[   12.822585] 
[   12.822708] CPU: 1 UID: 0 PID: 216 Comm: kunit_try_catch Tainted: G    B            N 6.12.32-rc1 #1
[   12.822785] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.822806] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.823288] Call Trace:
[   12.823335]  <TASK>
[   12.823376]  dump_stack_lvl+0x73/0xb0
[   12.823434]  print_report+0xd1/0x640
[   12.823458]  ? __virt_addr_valid+0x1db/0x2d0
[   12.823484]  ? kasan_complete_mode_report_info+0x2a/0x200
[   12.823504]  ? kmem_cache_invalid_free+0x1d9/0x470
[   12.823525]  kasan_report_invalid_free+0xfc/0x120
[   12.823547]  ? kmem_cache_invalid_free+0x1d9/0x470
[   12.823567]  ? kmem_cache_invalid_free+0x1d9/0x470
[   12.823586]  check_slab_allocation+0x11f/0x130
[   12.823606]  __kasan_slab_pre_free+0x28/0x40
[   12.823625]  kmem_cache_free+0xee/0x400
[   12.823644]  ? kmem_cache_alloc_noprof+0x107/0x350
[   12.823685]  ? kmem_cache_invalid_free+0x1d9/0x470
[   12.823708]  kmem_cache_invalid_free+0x1d9/0x470
[   12.823728]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   12.823746]  ? finish_task_switch.isra.0+0x153/0x700
[   12.823766]  ? __switch_to+0x5d9/0xf60
[   12.823791]  ? __pfx_read_tsc+0x10/0x10
[   12.823809]  ? ktime_get_ts64+0x84/0x230
[   12.823832]  kunit_try_run_case+0x1a6/0x480
[   12.823854]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.823871]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   12.823891]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.823912]  ? __kthread_parkme+0x82/0x160
[   12.823930]  ? preempt_count_sub+0x50/0x80
[   12.823949]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.823967]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.823988]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.824010]  kthread+0x257/0x310
[   12.824026]  ? __pfx_kthread+0x10/0x10
[   12.824042]  ret_from_fork+0x41/0x80
[   12.824071]  ? __pfx_kthread+0x10/0x10
[   12.824089]  ret_from_fork_asm+0x1a/0x30
[   12.824117]  </TASK>
[   12.824129] 
[   12.833606] Allocated by task 216:
[   12.833899]  kasan_save_stack+0x45/0x70
[   12.834422]  kasan_save_track+0x18/0x40
[   12.834746]  kasan_save_alloc_info+0x3b/0x50
[   12.834943]  __kasan_slab_alloc+0x91/0xa0
[   12.835284]  kmem_cache_alloc_noprof+0x107/0x350
[   12.835621]  kmem_cache_invalid_free+0x158/0x470
[   12.835964]  kunit_try_run_case+0x1a6/0x480
[   12.836325]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.836699]  kthread+0x257/0x310
[   12.836880]  ret_from_fork+0x41/0x80
[   12.837120]  ret_from_fork_asm+0x1a/0x30
[   12.837537] 
[   12.837698] The buggy address belongs to the object at ffff888102982000
[   12.837698]  which belongs to the cache test_cache of size 200
[   12.838390] The buggy address is located 1 bytes inside of
[   12.838390]  200-byte region [ffff888102982000, ffff8881029820c8)
[   12.838942] 
[   12.839135] The buggy address belongs to the physical page:
[   12.839390] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102982
[   12.839793] flags: 0x200000000000000(node=0|zone=2)
[   12.840025] page_type: f5(slab)
[   12.840276] raw: 0200000000000000 ffff888101ad0140 dead000000000122 0000000000000000
[   12.840554] raw: 0000000000000000 00000000800f000f 00000001f5000000 0000000000000000
[   12.841255] page dumped because: kasan: bad access detected
[   12.841617] 
[   12.841749] Memory state around the buggy address:
[   12.841938]  ffff888102981f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.842384]  ffff888102981f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.842871] >ffff888102982000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   12.843454]                    ^
[   12.843719]  ffff888102982080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   12.844057]  ffff888102982100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.844476] ==================================================================