Hay
Date
July 16, 2025, 3:10 p.m.

Environment
qemu-arm64
qemu-x86_64

[   17.155099] ==================================================================
[   17.155315] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3c8
[   17.155571] Free of addr fff00000c7923001 by task kunit_try_catch/211
[   17.155699] 
[   17.155802] CPU: 1 UID: 0 PID: 211 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   17.155947] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.155975] Hardware name: linux,dummy-virt (DT)
[   17.156290] Call trace:
[   17.156328]  show_stack+0x20/0x38 (C)
[   17.156401]  dump_stack_lvl+0x8c/0xd0
[   17.156539]  print_report+0x118/0x5d0
[   17.156644]  kasan_report_invalid_free+0xc0/0xe8
[   17.156870]  check_slab_allocation+0xfc/0x108
[   17.156961]  __kasan_slab_pre_free+0x2c/0x48
[   17.157094]  kmem_cache_free+0xf0/0x468
[   17.157148]  kmem_cache_invalid_free+0x184/0x3c8
[   17.157465]  kunit_try_run_case+0x170/0x3f0
[   17.157608]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.157706]  kthread+0x328/0x630
[   17.157881]  ret_from_fork+0x10/0x20
[   17.157977] 
[   17.158105] Allocated by task 211:
[   17.158175]  kasan_save_stack+0x3c/0x68
[   17.158245]  kasan_save_track+0x20/0x40
[   17.158566]  kasan_save_alloc_info+0x40/0x58
[   17.158747]  __kasan_slab_alloc+0xa8/0xb0
[   17.158903]  kmem_cache_alloc_noprof+0x10c/0x398
[   17.158991]  kmem_cache_invalid_free+0x12c/0x3c8
[   17.159089]  kunit_try_run_case+0x170/0x3f0
[   17.159240]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.159286]  kthread+0x328/0x630
[   17.159562]  ret_from_fork+0x10/0x20
[   17.159643] 
[   17.159753] The buggy address belongs to the object at fff00000c7923000
[   17.159753]  which belongs to the cache test_cache of size 200
[   17.159829] The buggy address is located 1 bytes inside of
[   17.159829]  200-byte region [fff00000c7923000, fff00000c79230c8)
[   17.159898] 
[   17.159954] The buggy address belongs to the physical page:
[   17.159991] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107923
[   17.160052] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   17.160223] page_type: f5(slab)
[   17.160475] raw: 0bfffe0000000000 fff00000ffe78000 dead000000000122 0000000000000000
[   17.160560] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   17.160696] page dumped because: kasan: bad access detected
[   17.160815] 
[   17.160878] Memory state around the buggy address:
[   17.160971]  fff00000c7922f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.161016]  fff00000c7922f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.161309] >fff00000c7923000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   17.161370]                    ^
[   17.161515]  fff00000c7923080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   17.161601]  fff00000c7923100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.161767] ==================================================================

[   13.285813] ==================================================================
[   13.287138] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d8/0x460
[   13.287395] Free of addr ffff888103939001 by task kunit_try_catch/228
[   13.288325] 
[   13.288534] CPU: 1 UID: 0 PID: 228 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   13.288733] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.288748] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.288779] Call Trace:
[   13.288792]  <TASK>
[   13.288810]  dump_stack_lvl+0x73/0xb0
[   13.288846]  print_report+0xd1/0x610
[   13.288869]  ? __virt_addr_valid+0x1db/0x2d0
[   13.288896]  ? kasan_complete_mode_report_info+0x2a/0x200
[   13.288920]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.288946]  kasan_report_invalid_free+0x10a/0x130
[   13.288971]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.289000]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.289025]  check_slab_allocation+0x11f/0x130
[   13.289047]  __kasan_slab_pre_free+0x28/0x40
[   13.289068]  kmem_cache_free+0xed/0x420
[   13.289089]  ? kmem_cache_alloc_noprof+0x123/0x3f0
[   13.289110]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.289138]  kmem_cache_invalid_free+0x1d8/0x460
[   13.289163]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   13.289188]  ? finish_task_switch.isra.0+0x153/0x700
[   13.289213]  ? __switch_to+0x47/0xf50
[   13.289243]  ? __pfx_read_tsc+0x10/0x10
[   13.289266]  ? ktime_get_ts64+0x86/0x230
[   13.289291]  kunit_try_run_case+0x1a5/0x480
[   13.289319]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.289343]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.289369]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.289393]  ? __kthread_parkme+0x82/0x180
[   13.289416]  ? preempt_count_sub+0x50/0x80
[   13.289450]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.289475]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.289499]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.289525]  kthread+0x337/0x6f0
[   13.289545]  ? trace_preempt_on+0x20/0xc0
[   13.289570]  ? __pfx_kthread+0x10/0x10
[   13.289591]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.289613]  ? calculate_sigpending+0x7b/0xa0
[   13.289638]  ? __pfx_kthread+0x10/0x10
[   13.289660]  ret_from_fork+0x116/0x1d0
[   13.289679]  ? __pfx_kthread+0x10/0x10
[   13.289699]  ret_from_fork_asm+0x1a/0x30
[   13.289731]  </TASK>
[   13.289742] 
[   13.303180] Allocated by task 228:
[   13.303374]  kasan_save_stack+0x45/0x70
[   13.303703]  kasan_save_track+0x18/0x40
[   13.304410]  kasan_save_alloc_info+0x3b/0x50
[   13.304841]  __kasan_slab_alloc+0x91/0xa0
[   13.305262]  kmem_cache_alloc_noprof+0x123/0x3f0
[   13.305631]  kmem_cache_invalid_free+0x157/0x460
[   13.306165]  kunit_try_run_case+0x1a5/0x480
[   13.306430]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.306856]  kthread+0x337/0x6f0
[   13.307232]  ret_from_fork+0x116/0x1d0
[   13.307417]  ret_from_fork_asm+0x1a/0x30
[   13.307853] 
[   13.307954] The buggy address belongs to the object at ffff888103939000
[   13.307954]  which belongs to the cache test_cache of size 200
[   13.308792] The buggy address is located 1 bytes inside of
[   13.308792]  200-byte region [ffff888103939000, ffff8881039390c8)
[   13.309848] 
[   13.310199] The buggy address belongs to the physical page:
[   13.310446] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103939
[   13.310923] flags: 0x200000000000000(node=0|zone=2)
[   13.311404] page_type: f5(slab)
[   13.311706] raw: 0200000000000000 ffff888101b6aa00 dead000000000122 0000000000000000
[   13.312374] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   13.312827] page dumped because: kasan: bad access detected
[   13.313271] 
[   13.313367] Memory state around the buggy address:
[   13.313796]  ffff888103938f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.314667]  ffff888103938f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.315159] >ffff888103939000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   13.315485]                    ^
[   13.315642]  ffff888103939080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   13.315941]  ffff888103939100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.316231] ==================================================================