Hay
Date
June 7, 2025, 10:40 a.m.

Environment
qemu-arm64
qemu-x86_64

[   23.656564] ==================================================================
[   23.656768] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3c8
[   23.657383] Free of addr fff00000c7773001 by task kunit_try_catch/215
[   23.657582] 
[   23.657683] CPU: 1 UID: 0 PID: 215 Comm: kunit_try_catch Tainted: G    B            N  6.15.2-rc1 #1 PREEMPT 
[   23.658062] Tainted: [B]=BAD_PAGE, [N]=TEST
[   23.658285] Hardware name: linux,dummy-virt (DT)
[   23.658452] Call trace:
[   23.658556]  show_stack+0x20/0x38 (C)
[   23.658727]  dump_stack_lvl+0x8c/0xd0
[   23.658859]  print_report+0x118/0x608
[   23.658960]  kasan_report_invalid_free+0xc0/0xe8
[   23.659055]  check_slab_allocation+0xfc/0x108
[   23.659167]  __kasan_slab_pre_free+0x2c/0x48
[   23.659288]  kmem_cache_free+0xf0/0x468
[   23.659423]  kmem_cache_invalid_free+0x184/0x3c8
[   23.659565]  kunit_try_run_case+0x170/0x3f0
[   23.659715]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   23.659853]  kthread+0x328/0x630
[   23.660336]  ret_from_fork+0x10/0x20
[   23.660760] 
[   23.660812] Allocated by task 215:
[   23.661000]  kasan_save_stack+0x3c/0x68
[   23.661466]  kasan_save_track+0x20/0x40
[   23.661867]  kasan_save_alloc_info+0x40/0x58
[   23.662030]  __kasan_slab_alloc+0xa8/0xb0
[   23.662122]  kmem_cache_alloc_noprof+0x10c/0x398
[   23.662260]  kmem_cache_invalid_free+0x12c/0x3c8
[   23.662445]  kunit_try_run_case+0x170/0x3f0
[   23.662548]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   23.662923]  kthread+0x328/0x630
[   23.663105]  ret_from_fork+0x10/0x20
[   23.663195] 
[   23.663245] The buggy address belongs to the object at fff00000c7773000
[   23.663245]  which belongs to the cache test_cache of size 200
[   23.663381] The buggy address is located 1 bytes inside of
[   23.663381]  200-byte region [fff00000c7773000, fff00000c77730c8)
[   23.663523] 
[   23.663570] The buggy address belongs to the physical page:
[   23.663646] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107773
[   23.664113] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   23.664358] page_type: f5(slab)
[   23.664515] raw: 0bfffe0000000000 fff00000c56b53c0 dead000000000122 0000000000000000
[   23.664638] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   23.665025] page dumped because: kasan: bad access detected
[   23.665169] 
[   23.665217] Memory state around the buggy address:
[   23.665304]  fff00000c7772f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.665436]  fff00000c7772f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.665556] >fff00000c7773000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   23.665676]                    ^
[   23.665750]  fff00000c7773080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   23.666172]  fff00000c7773100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.666330] ==================================================================

[   14.642444] ==================================================================
[   14.643084] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d8/0x460
[   14.643674] Free of addr ffff8881039e8001 by task kunit_try_catch/231
[   14.643957] 
[   14.644104] CPU: 1 UID: 0 PID: 231 Comm: kunit_try_catch Tainted: G    B            N  6.15.2-rc1 #1 PREEMPT(voluntary) 
[   14.644334] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.644361] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.644407] Call Trace:
[   14.644437]  <TASK>
[   14.644473]  dump_stack_lvl+0x73/0xb0
[   14.644534]  print_report+0xd1/0x650
[   14.644591]  ? __virt_addr_valid+0x1db/0x2d0
[   14.644636]  ? kasan_complete_mode_report_info+0x2a/0x200
[   14.644677]  ? kmem_cache_invalid_free+0x1d8/0x460
[   14.644721]  kasan_report_invalid_free+0x10a/0x130
[   14.644771]  ? kmem_cache_invalid_free+0x1d8/0x460
[   14.644818]  ? kmem_cache_invalid_free+0x1d8/0x460
[   14.644863]  check_slab_allocation+0x11f/0x130
[   14.644909]  __kasan_slab_pre_free+0x28/0x40
[   14.644952]  kmem_cache_free+0xed/0x420
[   14.644991]  ? kmem_cache_alloc_noprof+0x123/0x3f0
[   14.645024]  ? kmem_cache_invalid_free+0x1d8/0x460
[   14.645062]  kmem_cache_invalid_free+0x1d8/0x460
[   14.645100]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   14.645135]  ? finish_task_switch.isra.0+0x153/0x700
[   14.645176]  ? __switch_to+0x5d9/0xf60
[   14.645211]  ? dequeue_task_fair+0x166/0x4e0
[   14.645260]  ? __pfx_read_tsc+0x10/0x10
[   14.645299]  ? ktime_get_ts64+0x86/0x230
[   14.645343]  kunit_try_run_case+0x1a5/0x480
[   14.645393]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.645430]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   14.645470]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.645512]  ? __kthread_parkme+0x82/0x180
[   14.645566]  ? preempt_count_sub+0x50/0x80
[   14.645618]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.645652]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.645689]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.645716]  kthread+0x337/0x6f0
[   14.645734]  ? trace_preempt_on+0x20/0xc0
[   14.645760]  ? __pfx_kthread+0x10/0x10
[   14.645777]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.645798]  ? calculate_sigpending+0x7b/0xa0
[   14.645821]  ? __pfx_kthread+0x10/0x10
[   14.645839]  ret_from_fork+0x41/0x80
[   14.645860]  ? __pfx_kthread+0x10/0x10
[   14.645878]  ret_from_fork_asm+0x1a/0x30
[   14.645907]  </TASK>
[   14.645921] 
[   14.659101] Allocated by task 231:
[   14.659296]  kasan_save_stack+0x45/0x70
[   14.659475]  kasan_save_track+0x18/0x40
[   14.659639]  kasan_save_alloc_info+0x3b/0x50
[   14.659821]  __kasan_slab_alloc+0x91/0xa0
[   14.660016]  kmem_cache_alloc_noprof+0x123/0x3f0
[   14.660228]  kmem_cache_invalid_free+0x157/0x460
[   14.660429]  kunit_try_run_case+0x1a5/0x480
[   14.662085]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.662454]  kthread+0x337/0x6f0
[   14.662969]  ret_from_fork+0x41/0x80
[   14.663475]  ret_from_fork_asm+0x1a/0x30
[   14.664076] 
[   14.664190] The buggy address belongs to the object at ffff8881039e8000
[   14.664190]  which belongs to the cache test_cache of size 200
[   14.664524] The buggy address is located 1 bytes inside of
[   14.664524]  200-byte region [ffff8881039e8000, ffff8881039e80c8)
[   14.665707] 
[   14.665927] The buggy address belongs to the physical page:
[   14.667245] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1039e8
[   14.667600] flags: 0x200000000000000(node=0|zone=2)
[   14.667984] page_type: f5(slab)
[   14.668266] raw: 0200000000000000 ffff888101c8f500 dead000000000122 0000000000000000
[   14.668505] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   14.669533] page dumped because: kasan: bad access detected
[   14.670240] 
[   14.670408] Memory state around the buggy address:
[   14.671276]  ffff8881039e7f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   14.671674]  ffff8881039e7f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   14.672546] >ffff8881039e8000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   14.673323]                    ^
[   14.673967]  ffff8881039e8080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   14.674311]  ffff8881039e8100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.675111] ==================================================================