Hay
Date
July 9, 2025, 11:07 p.m.

Environment
qemu-arm64
qemu-x86_64

[   17.492191] ==================================================================
[   17.492693] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3c8
[   17.492773] Free of addr fff00000c6cdb001 by task kunit_try_catch/211
[   17.492818] 
[   17.492861] CPU: 1 UID: 0 PID: 211 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   17.492947] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.492975] Hardware name: linux,dummy-virt (DT)
[   17.493009] Call trace:
[   17.493062]  show_stack+0x20/0x38 (C)
[   17.493607]  dump_stack_lvl+0x8c/0xd0
[   17.493758]  print_report+0x118/0x608
[   17.493807]  kasan_report_invalid_free+0xc0/0xe8
[   17.493858]  check_slab_allocation+0xfc/0x108
[   17.495144]  __kasan_slab_pre_free+0x2c/0x48
[   17.495252]  kmem_cache_free+0xf0/0x468
[   17.495303]  kmem_cache_invalid_free+0x184/0x3c8
[   17.495352]  kunit_try_run_case+0x170/0x3f0
[   17.495403]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.496485]  kthread+0x328/0x630
[   17.497359]  ret_from_fork+0x10/0x20
[   17.497858] 
[   17.498185] Allocated by task 211:
[   17.498460]  kasan_save_stack+0x3c/0x68
[   17.499142]  kasan_save_track+0x20/0x40
[   17.499239]  kasan_save_alloc_info+0x40/0x58
[   17.499924]  __kasan_slab_alloc+0xa8/0xb0
[   17.500209]  kmem_cache_alloc_noprof+0x10c/0x398
[   17.500612]  kmem_cache_invalid_free+0x12c/0x3c8
[   17.501584]  kunit_try_run_case+0x170/0x3f0
[   17.501692]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.501737]  kthread+0x328/0x630
[   17.502342]  ret_from_fork+0x10/0x20
[   17.502716] 
[   17.502948] The buggy address belongs to the object at fff00000c6cdb000
[   17.502948]  which belongs to the cache test_cache of size 200
[   17.503162] The buggy address is located 1 bytes inside of
[   17.503162]  200-byte region [fff00000c6cdb000, fff00000c6cdb0c8)
[   17.504023] 
[   17.504385] The buggy address belongs to the physical page:
[   17.505061] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106cdb
[   17.505295] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   17.505997] page_type: f5(slab)
[   17.506536] raw: 0bfffe0000000000 fff00000c56b2b40 dead000000000122 0000000000000000
[   17.506942] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   17.507404] page dumped because: kasan: bad access detected
[   17.507513] 
[   17.508063] Memory state around the buggy address:
[   17.508506]  fff00000c6cdaf00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   17.509179]  fff00000c6cdaf80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   17.509388] >fff00000c6cdb000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   17.509430]                    ^
[   17.509615]  fff00000c6cdb080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   17.509662]  fff00000c6cdb100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.510098] ==================================================================

[   13.270877] ==================================================================
[   13.271895] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d8/0x460
[   13.272990] Free of addr ffff8881038da001 by task kunit_try_catch/228
[   13.273945] 
[   13.274383] CPU: 1 UID: 0 PID: 228 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   13.274433] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.274445] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.274467] Call Trace:
[   13.274517]  <TASK>
[   13.274535]  dump_stack_lvl+0x73/0xb0
[   13.274571]  print_report+0xd1/0x650
[   13.274627]  ? __virt_addr_valid+0x1db/0x2d0
[   13.274652]  ? kasan_complete_mode_report_info+0x2a/0x200
[   13.274782]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.274809]  kasan_report_invalid_free+0x10a/0x130
[   13.274834]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.274860]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.274885]  check_slab_allocation+0x11f/0x130
[   13.274907]  __kasan_slab_pre_free+0x28/0x40
[   13.274927]  kmem_cache_free+0xed/0x420
[   13.274947]  ? kmem_cache_alloc_noprof+0x123/0x3f0
[   13.274968]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.274996]  kmem_cache_invalid_free+0x1d8/0x460
[   13.275050]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   13.275095]  ? finish_task_switch.isra.0+0x153/0x700
[   13.275120]  ? __switch_to+0x47/0xf50
[   13.275149]  ? __pfx_read_tsc+0x10/0x10
[   13.275170]  ? ktime_get_ts64+0x86/0x230
[   13.275196]  kunit_try_run_case+0x1a5/0x480
[   13.275223]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.275246]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.275271]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.275294]  ? __kthread_parkme+0x82/0x180
[   13.275315]  ? preempt_count_sub+0x50/0x80
[   13.275338]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.275362]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.275386]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.275411]  kthread+0x337/0x6f0
[   13.275430]  ? trace_preempt_on+0x20/0xc0
[   13.275454]  ? __pfx_kthread+0x10/0x10
[   13.275474]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.275495]  ? calculate_sigpending+0x7b/0xa0
[   13.275518]  ? __pfx_kthread+0x10/0x10
[   13.275539]  ret_from_fork+0x116/0x1d0
[   13.275557]  ? __pfx_kthread+0x10/0x10
[   13.275577]  ret_from_fork_asm+0x1a/0x30
[   13.275608]  </TASK>
[   13.275618] 
[   13.289259] Allocated by task 228:
[   13.289430]  kasan_save_stack+0x45/0x70
[   13.289616]  kasan_save_track+0x18/0x40
[   13.289801]  kasan_save_alloc_info+0x3b/0x50
[   13.289996]  __kasan_slab_alloc+0x91/0xa0
[   13.290631]  kmem_cache_alloc_noprof+0x123/0x3f0
[   13.290810]  kmem_cache_invalid_free+0x157/0x460
[   13.291018]  kunit_try_run_case+0x1a5/0x480
[   13.291522]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.291772]  kthread+0x337/0x6f0
[   13.291932]  ret_from_fork+0x116/0x1d0
[   13.292241]  ret_from_fork_asm+0x1a/0x30
[   13.292436] 
[   13.292522] The buggy address belongs to the object at ffff8881038da000
[   13.292522]  which belongs to the cache test_cache of size 200
[   13.293000] The buggy address is located 1 bytes inside of
[   13.293000]  200-byte region [ffff8881038da000, ffff8881038da0c8)
[   13.294241] 
[   13.294530] The buggy address belongs to the physical page:
[   13.294767] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1038da
[   13.295228] flags: 0x200000000000000(node=0|zone=2)
[   13.295453] page_type: f5(slab)
[   13.295605] raw: 0200000000000000 ffff888101dbda00 dead000000000122 0000000000000000
[   13.295923] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   13.296301] page dumped because: kasan: bad access detected
[   13.296538] 
[   13.296627] Memory state around the buggy address:
[   13.296840]  ffff8881038d9f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.297204]  ffff8881038d9f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.297496] >ffff8881038da000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   13.297791]                    ^
[   13.297940]  ffff8881038da080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   13.299080]  ffff8881038da100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.299323] ==================================================================