Hay
Date
July 19, 2025, 11:11 a.m.

Environment
qemu-arm64
qemu-x86_64

[   16.114272] ==================================================================
[   16.114336] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3c8
[   16.114408] Free of addr fff00000c63c0001 by task kunit_try_catch/212
[   16.114458] 
[   16.114499] CPU: 0 UID: 0 PID: 212 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   16.114598] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.114626] Hardware name: linux,dummy-virt (DT)
[   16.114662] Call trace:
[   16.114687]  show_stack+0x20/0x38 (C)
[   16.114740]  dump_stack_lvl+0x8c/0xd0
[   16.114793]  print_report+0x118/0x5d0
[   16.114840]  kasan_report_invalid_free+0xc0/0xe8
[   16.114890]  check_slab_allocation+0xfc/0x108
[   16.114937]  __kasan_slab_pre_free+0x2c/0x48
[   16.114986]  kmem_cache_free+0xf0/0x468
[   16.115032]  kmem_cache_invalid_free+0x184/0x3c8
[   16.115080]  kunit_try_run_case+0x170/0x3f0
[   16.115131]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.115183]  kthread+0x328/0x630
[   16.115226]  ret_from_fork+0x10/0x20
[   16.115275] 
[   16.115293] Allocated by task 212:
[   16.115324]  kasan_save_stack+0x3c/0x68
[   16.115363]  kasan_save_track+0x20/0x40
[   16.115398]  kasan_save_alloc_info+0x40/0x58
[   16.115438]  __kasan_slab_alloc+0xa8/0xb0
[   16.115476]  kmem_cache_alloc_noprof+0x10c/0x398
[   16.115515]  kmem_cache_invalid_free+0x12c/0x3c8
[   16.119586]  kunit_try_run_case+0x170/0x3f0
[   16.119633]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.119677]  kthread+0x328/0x630
[   16.119710]  ret_from_fork+0x10/0x20
[   16.119744] 
[   16.119766] The buggy address belongs to the object at fff00000c63c0000
[   16.119766]  which belongs to the cache test_cache of size 200
[   16.119825] The buggy address is located 1 bytes inside of
[   16.119825]  200-byte region [fff00000c63c0000, fff00000c63c00c8)
[   16.119885] 
[   16.119906] The buggy address belongs to the physical page:
[   16.119941] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1063c0
[   16.119997] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   16.120049] page_type: f5(slab)
[   16.120092] raw: 0bfffe0000000000 fff00000c1b473c0 dead000000000122 0000000000000000
[   16.120143] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   16.120184] page dumped because: kasan: bad access detected
[   16.120214] 
[   16.120232] Memory state around the buggy address:
[   16.120265]  fff00000c63bff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.120308]  fff00000c63bff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.120351] >fff00000c63c0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   16.120389]                    ^
[   16.120416]  fff00000c63c0080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   16.120459]  fff00000c63c0100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.120497] ==================================================================

[   12.770910] ==================================================================
[   12.771561] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d8/0x460
[   12.771921] Free of addr ffff888102f6e001 by task kunit_try_catch/229
[   12.772263] 
[   12.772430] CPU: 1 UID: 0 PID: 229 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   12.772479] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.772490] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.772524] Call Trace:
[   12.772557]  <TASK>
[   12.772574]  dump_stack_lvl+0x73/0xb0
[   12.772605]  print_report+0xd1/0x610
[   12.772627]  ? __virt_addr_valid+0x1db/0x2d0
[   12.772651]  ? kasan_complete_mode_report_info+0x2a/0x200
[   12.772673]  ? kmem_cache_invalid_free+0x1d8/0x460
[   12.772698]  kasan_report_invalid_free+0x10a/0x130
[   12.772722]  ? kmem_cache_invalid_free+0x1d8/0x460
[   12.772747]  ? kmem_cache_invalid_free+0x1d8/0x460
[   12.772771]  check_slab_allocation+0x11f/0x130
[   12.772794]  __kasan_slab_pre_free+0x28/0x40
[   12.772814]  kmem_cache_free+0xed/0x420
[   12.772834]  ? kmem_cache_alloc_noprof+0x123/0x3f0
[   12.772854]  ? kmem_cache_invalid_free+0x1d8/0x460
[   12.772900]  kmem_cache_invalid_free+0x1d8/0x460
[   12.772924]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   12.772947]  ? finish_task_switch.isra.0+0x153/0x700
[   12.772971]  ? __switch_to+0x47/0xf50
[   12.772999]  ? __pfx_read_tsc+0x10/0x10
[   12.773020]  ? ktime_get_ts64+0x86/0x230
[   12.773139]  kunit_try_run_case+0x1a5/0x480
[   12.773164]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.773188]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.773213]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.773237]  ? __kthread_parkme+0x82/0x180
[   12.773257]  ? preempt_count_sub+0x50/0x80
[   12.773279]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.773303]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.773326]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.773349]  kthread+0x337/0x6f0
[   12.773367]  ? trace_preempt_on+0x20/0xc0
[   12.773390]  ? __pfx_kthread+0x10/0x10
[   12.773409]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.773430]  ? calculate_sigpending+0x7b/0xa0
[   12.773455]  ? __pfx_kthread+0x10/0x10
[   12.773475]  ret_from_fork+0x116/0x1d0
[   12.773508]  ? __pfx_kthread+0x10/0x10
[   12.773527]  ret_from_fork_asm+0x1a/0x30
[   12.773558]  </TASK>
[   12.773568] 
[   12.784726] Allocated by task 229:
[   12.784900]  kasan_save_stack+0x45/0x70
[   12.785199]  kasan_save_track+0x18/0x40
[   12.785386]  kasan_save_alloc_info+0x3b/0x50
[   12.785591]  __kasan_slab_alloc+0x91/0xa0
[   12.785776]  kmem_cache_alloc_noprof+0x123/0x3f0
[   12.785983]  kmem_cache_invalid_free+0x157/0x460
[   12.786429]  kunit_try_run_case+0x1a5/0x480
[   12.786642]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.786871]  kthread+0x337/0x6f0
[   12.787021]  ret_from_fork+0x116/0x1d0
[   12.787264]  ret_from_fork_asm+0x1a/0x30
[   12.787446] 
[   12.787548] The buggy address belongs to the object at ffff888102f6e000
[   12.787548]  which belongs to the cache test_cache of size 200
[   12.788032] The buggy address is located 1 bytes inside of
[   12.788032]  200-byte region [ffff888102f6e000, ffff888102f6e0c8)
[   12.788727] 
[   12.788818] The buggy address belongs to the physical page:
[   12.789091] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102f6e
[   12.789621] flags: 0x200000000000000(node=0|zone=2)
[   12.789843] page_type: f5(slab)
[   12.789994] raw: 0200000000000000 ffff8881018a9780 dead000000000122 0000000000000000
[   12.790684] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   12.790998] page dumped because: kasan: bad access detected
[   12.791487] 
[   12.791573] Memory state around the buggy address:
[   12.791729]  ffff888102f6df00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.791944]  ffff888102f6df80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.792164] >ffff888102f6e000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   12.792379]                    ^
[   12.792501]  ffff888102f6e080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   12.792717]  ffff888102f6e100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.793035] ==================================================================