Hay
Date
July 11, 2025, 11:09 p.m.

Environment
qemu-arm64
qemu-x86_64

[   17.624481] ==================================================================
[   17.624828] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3c8
[   17.624908] Free of addr fff00000c58d9001 by task kunit_try_catch/212
[   17.624951] 
[   17.625125] CPU: 0 UID: 0 PID: 212 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   17.625231] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.625294] Hardware name: linux,dummy-virt (DT)
[   17.625335] Call trace:
[   17.625382]  show_stack+0x20/0x38 (C)
[   17.625449]  dump_stack_lvl+0x8c/0xd0
[   17.625501]  print_report+0x118/0x608
[   17.625548]  kasan_report_invalid_free+0xc0/0xe8
[   17.625716]  check_slab_allocation+0xfc/0x108
[   17.625771]  __kasan_slab_pre_free+0x2c/0x48
[   17.625819]  kmem_cache_free+0xf0/0x468
[   17.625880]  kmem_cache_invalid_free+0x184/0x3c8
[   17.625929]  kunit_try_run_case+0x170/0x3f0
[   17.626001]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.626058]  kthread+0x328/0x630
[   17.626217]  ret_from_fork+0x10/0x20
[   17.626386] 
[   17.626437] Allocated by task 212:
[   17.626704]  kasan_save_stack+0x3c/0x68
[   17.627080]  kasan_save_track+0x20/0x40
[   17.627167]  kasan_save_alloc_info+0x40/0x58
[   17.627207]  __kasan_slab_alloc+0xa8/0xb0
[   17.627244]  kmem_cache_alloc_noprof+0x10c/0x398
[   17.627284]  kmem_cache_invalid_free+0x12c/0x3c8
[   17.627505]  kunit_try_run_case+0x170/0x3f0
[   17.627548]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.627616]  kthread+0x328/0x630
[   17.627663]  ret_from_fork+0x10/0x20
[   17.627745] 
[   17.627799] The buggy address belongs to the object at fff00000c58d9000
[   17.627799]  which belongs to the cache test_cache of size 200
[   17.627880] The buggy address is located 1 bytes inside of
[   17.627880]  200-byte region [fff00000c58d9000, fff00000c58d90c8)
[   17.628056] 
[   17.628126] The buggy address belongs to the physical page:
[   17.628293] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1058d9
[   17.628356] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   17.628437] page_type: f5(slab)
[   17.628477] raw: 0bfffe0000000000 fff00000c3ea3b40 dead000000000122 0000000000000000
[   17.628527] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   17.628872] page dumped because: kasan: bad access detected
[   17.628960] 
[   17.629082] Memory state around the buggy address:
[   17.629158]  fff00000c58d8f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   17.629202]  fff00000c58d8f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   17.629244] >fff00000c58d9000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   17.629282]                    ^
[   17.629311]  fff00000c58d9080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   17.629352]  fff00000c58d9100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.629492] ==================================================================

[   13.094946] ==================================================================
[   13.095612] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d8/0x460
[   13.096308] Free of addr ffff88810394d001 by task kunit_try_catch/228
[   13.097209] 
[   13.097467] CPU: 0 UID: 0 PID: 228 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   13.097513] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.097524] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.097545] Call Trace:
[   13.097558]  <TASK>
[   13.097575]  dump_stack_lvl+0x73/0xb0
[   13.097609]  print_report+0xd1/0x650
[   13.097631]  ? __virt_addr_valid+0x1db/0x2d0
[   13.097656]  ? kasan_complete_mode_report_info+0x2a/0x200
[   13.097678]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.097704]  kasan_report_invalid_free+0x10a/0x130
[   13.097728]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.097764]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.097789]  check_slab_allocation+0x11f/0x130
[   13.097811]  __kasan_slab_pre_free+0x28/0x40
[   13.097831]  kmem_cache_free+0xed/0x420
[   13.097851]  ? kmem_cache_alloc_noprof+0x123/0x3f0
[   13.097871]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.097899]  kmem_cache_invalid_free+0x1d8/0x460
[   13.097960]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   13.097986]  ? finish_task_switch.isra.0+0x153/0x700
[   13.098010]  ? __switch_to+0x47/0xf50
[   13.098039]  ? __pfx_read_tsc+0x10/0x10
[   13.098060]  ? ktime_get_ts64+0x86/0x230
[   13.098084]  kunit_try_run_case+0x1a5/0x480
[   13.098109]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.098132]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.098156]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.098179]  ? __kthread_parkme+0x82/0x180
[   13.098201]  ? preempt_count_sub+0x50/0x80
[   13.098224]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.098248]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.098272]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.098296]  kthread+0x337/0x6f0
[   13.098315]  ? trace_preempt_on+0x20/0xc0
[   13.098340]  ? __pfx_kthread+0x10/0x10
[   13.098380]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.098402]  ? calculate_sigpending+0x7b/0xa0
[   13.098429]  ? __pfx_kthread+0x10/0x10
[   13.098452]  ret_from_fork+0x116/0x1d0
[   13.098472]  ? __pfx_kthread+0x10/0x10
[   13.098492]  ret_from_fork_asm+0x1a/0x30
[   13.098528]  </TASK>
[   13.098539] 
[   13.113054] Allocated by task 228:
[   13.113369]  kasan_save_stack+0x45/0x70
[   13.113518]  kasan_save_track+0x18/0x40
[   13.113650]  kasan_save_alloc_info+0x3b/0x50
[   13.113856]  __kasan_slab_alloc+0x91/0xa0
[   13.114221]  kmem_cache_alloc_noprof+0x123/0x3f0
[   13.114673]  kmem_cache_invalid_free+0x157/0x460
[   13.115158]  kunit_try_run_case+0x1a5/0x480
[   13.115597]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.116118]  kthread+0x337/0x6f0
[   13.116440]  ret_from_fork+0x116/0x1d0
[   13.116579]  ret_from_fork_asm+0x1a/0x30
[   13.116716] 
[   13.116805] The buggy address belongs to the object at ffff88810394d000
[   13.116805]  which belongs to the cache test_cache of size 200
[   13.117898] The buggy address is located 1 bytes inside of
[   13.117898]  200-byte region [ffff88810394d000, ffff88810394d0c8)
[   13.119248] 
[   13.119357] The buggy address belongs to the physical page:
[   13.119530] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10394d
[   13.119801] flags: 0x200000000000000(node=0|zone=2)
[   13.120289] page_type: f5(slab)
[   13.120622] raw: 0200000000000000 ffff88810394a000 dead000000000122 0000000000000000
[   13.121399] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   13.122330] page dumped because: kasan: bad access detected
[   13.122548] 
[   13.122618] Memory state around the buggy address:
[   13.122789]  ffff88810394cf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.123498]  ffff88810394cf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.124230] >ffff88810394d000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   13.124830]                    ^
[   13.124979]  ffff88810394d080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   13.125530]  ffff88810394d100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.125754] ==================================================================