Hay
Date
June 18, 2025, 6:43 a.m.

Environment
qemu-arm64
qemu-x86_64

[   21.890959] ==================================================================
[   21.891117] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3c8
[   21.891208] Free of addr fff00000c7784001 by task kunit_try_catch/221
[   21.891255] 
[   21.891421] CPU: 0 UID: 0 PID: 221 Comm: kunit_try_catch Tainted: G    B   W        N  6.16.0-rc2-next-20250618 #1 PREEMPT 
[   21.891556] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   21.891658] Hardware name: linux,dummy-virt (DT)
[   21.891734] Call trace:
[   21.891766]  show_stack+0x20/0x38 (C)
[   21.891830]  dump_stack_lvl+0x8c/0xd0
[   21.891888]  print_report+0x118/0x608
[   21.891945]  kasan_report_invalid_free+0xc0/0xe8
[   21.892011]  check_slab_allocation+0xfc/0x108
[   21.892086]  __kasan_slab_pre_free+0x2c/0x48
[   21.892142]  kmem_cache_free+0xf0/0x468
[   21.892196]  kmem_cache_invalid_free+0x184/0x3c8
[   21.892251]  kunit_try_run_case+0x170/0x3f0
[   21.892345]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.892460]  kthread+0x328/0x630
[   21.892576]  ret_from_fork+0x10/0x20
[   21.892643] 
[   21.892666] Allocated by task 221:
[   21.892747]  kasan_save_stack+0x3c/0x68
[   21.892837]  kasan_save_track+0x20/0x40
[   21.892878]  kasan_save_alloc_info+0x40/0x58
[   21.892921]  __kasan_slab_alloc+0xa8/0xb0
[   21.892961]  kmem_cache_alloc_noprof+0x10c/0x398
[   21.893002]  kmem_cache_invalid_free+0x12c/0x3c8
[   21.893077]  kunit_try_run_case+0x170/0x3f0
[   21.893163]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.893312]  kthread+0x328/0x630
[   21.893502]  ret_from_fork+0x10/0x20
[   21.893705] 
[   21.893787] The buggy address belongs to the object at fff00000c7784000
[   21.893787]  which belongs to the cache test_cache of size 200
[   21.894211] The buggy address is located 1 bytes inside of
[   21.894211]  200-byte region [fff00000c7784000, fff00000c77840c8)
[   21.894361] 
[   21.894388] The buggy address belongs to the physical page:
[   21.894422] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107784
[   21.894478] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   21.894532] page_type: f5(slab)
[   21.894577] raw: 0bfffe0000000000 fff00000c5beddc0 dead000000000122 0000000000000000
[   21.894628] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   21.895524] page dumped because: kasan: bad access detected
[   21.895592] 
[   21.895698] Memory state around the buggy address:
[   21.895900]  fff00000c7783f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.895951]  fff00000c7783f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.895995] >fff00000c7784000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   21.896046]                    ^
[   21.896080]  fff00000c7784080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   21.896124]  fff00000c7784100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.896164] ==================================================================

[   11.863723] ==================================================================
[   11.864175] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d8/0x460
[   11.864749] Free of addr ffff888102ca3001 by task kunit_try_catch/237
[   11.865169] 
[   11.865321] CPU: 1 UID: 0 PID: 237 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250618 #1 PREEMPT(voluntary) 
[   11.865370] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.865382] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.865403] Call Trace:
[   11.865415]  <TASK>
[   11.865432]  dump_stack_lvl+0x73/0xb0
[   11.865464]  print_report+0xd1/0x650
[   11.865485]  ? __virt_addr_valid+0x1db/0x2d0
[   11.865508]  ? kasan_complete_mode_report_info+0x2a/0x200
[   11.865532]  ? kmem_cache_invalid_free+0x1d8/0x460
[   11.865556]  kasan_report_invalid_free+0x10a/0x130
[   11.865578]  ? kmem_cache_invalid_free+0x1d8/0x460
[   11.865602]  ? kmem_cache_invalid_free+0x1d8/0x460
[   11.865624]  check_slab_allocation+0x11f/0x130
[   11.865644]  __kasan_slab_pre_free+0x28/0x40
[   11.865663]  kmem_cache_free+0xed/0x420
[   11.865681]  ? kmem_cache_alloc_noprof+0x123/0x3f0
[   11.865699]  ? kmem_cache_invalid_free+0x1d8/0x460
[   11.865725]  kmem_cache_invalid_free+0x1d8/0x460
[   11.865747]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   11.865770]  ? finish_task_switch.isra.0+0x153/0x700
[   11.865791]  ? __switch_to+0x47/0xf50
[   11.865819]  ? __pfx_read_tsc+0x10/0x10
[   11.865839]  ? ktime_get_ts64+0x86/0x230
[   11.865864]  kunit_try_run_case+0x1a5/0x480
[   11.865888]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.865909]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.865931]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.865951]  ? __kthread_parkme+0x82/0x180
[   11.865970]  ? preempt_count_sub+0x50/0x80
[   11.865991]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.866013]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.866034]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.866055]  kthread+0x337/0x6f0
[   11.866073]  ? trace_preempt_on+0x20/0xc0
[   11.866096]  ? __pfx_kthread+0x10/0x10
[   11.866115]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.866134]  ? calculate_sigpending+0x7b/0xa0
[   11.866157]  ? __pfx_kthread+0x10/0x10
[   11.866177]  ret_from_fork+0x116/0x1d0
[   11.866194]  ? __pfx_kthread+0x10/0x10
[   11.866231]  ret_from_fork_asm+0x1a/0x30
[   11.866260]  </TASK>
[   11.866271] 
[   11.874551] Allocated by task 237:
[   11.874732]  kasan_save_stack+0x45/0x70
[   11.875273]  kasan_save_track+0x18/0x40
[   11.875403]  kasan_save_alloc_info+0x3b/0x50
[   11.875538]  __kasan_slab_alloc+0x91/0xa0
[   11.875665]  kmem_cache_alloc_noprof+0x123/0x3f0
[   11.875955]  kmem_cache_invalid_free+0x157/0x460
[   11.876178]  kunit_try_run_case+0x1a5/0x480
[   11.876387]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.876878]  kthread+0x337/0x6f0
[   11.877069]  ret_from_fork+0x116/0x1d0
[   11.877455]  ret_from_fork_asm+0x1a/0x30
[   11.877616] 
[   11.878033] The buggy address belongs to the object at ffff888102ca3000
[   11.878033]  which belongs to the cache test_cache of size 200
[   11.879362] The buggy address is located 1 bytes inside of
[   11.879362]  200-byte region [ffff888102ca3000, ffff888102ca30c8)
[   11.879766] 
[   11.879838] The buggy address belongs to the physical page:
[   11.880348] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102ca3
[   11.880981] flags: 0x200000000000000(node=0|zone=2)
[   11.881430] page_type: f5(slab)
[   11.881721] raw: 0200000000000000 ffff88810108eb40 dead000000000122 0000000000000000
[   11.882328] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   11.882732] page dumped because: kasan: bad access detected
[   11.882961] 
[   11.883042] Memory state around the buggy address:
[   11.883510]  ffff888102ca2f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.883947]  ffff888102ca2f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.884369] >ffff888102ca3000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   11.884955]                    ^
[   11.885115]  ffff888102ca3080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   11.885662]  ffff888102ca3100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.885914] ==================================================================