Hay
Date
May 15, 2025, 10:38 a.m.

Environment
qemu-arm64
qemu-x86_64

[   18.808371] ==================================================================
[   18.808437] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3c8
[   18.808957] Free of addr fff00000c6890001 by task kunit_try_catch/211
[   18.809016] 
[   18.809055] CPU: 0 UID: 0 PID: 211 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250515 #1 PREEMPT 
[   18.810322] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.810392] Hardware name: linux,dummy-virt (DT)
[   18.810473] Call trace:
[   18.810499]  show_stack+0x20/0x38 (C)
[   18.810553]  dump_stack_lvl+0x8c/0xd0
[   18.811143]  print_report+0x118/0x608
[   18.811332]  kasan_report_invalid_free+0xc0/0xe8
[   18.811384]  check_slab_allocation+0xfc/0x108
[   18.811459]  __kasan_slab_pre_free+0x2c/0x48
[   18.811508]  kmem_cache_free+0xf0/0x470
[   18.811557]  kmem_cache_invalid_free+0x184/0x3c8
[   18.812185]  kunit_try_run_case+0x170/0x3f0
[   18.812499]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.812678]  kthread+0x328/0x630
[   18.812794]  ret_from_fork+0x10/0x20
[   18.813108] 
[   18.813133] Allocated by task 211:
[   18.813177]  kasan_save_stack+0x3c/0x68
[   18.813220]  kasan_save_track+0x20/0x40
[   18.813257]  kasan_save_alloc_info+0x40/0x58
[   18.813536]  __kasan_slab_alloc+0xa8/0xb0
[   18.813587]  kmem_cache_alloc_noprof+0x10c/0x3a0
[   18.813662]  kmem_cache_invalid_free+0x12c/0x3c8
[   18.813869]  kunit_try_run_case+0x170/0x3f0
[   18.814199]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.814243]  kthread+0x328/0x630
[   18.814279]  ret_from_fork+0x10/0x20
[   18.814322] 
[   18.814342] The buggy address belongs to the object at fff00000c6890000
[   18.814342]  which belongs to the cache test_cache of size 200
[   18.814399] The buggy address is located 1 bytes inside of
[   18.814399]  200-byte region [fff00000c6890000, fff00000c68900c8)
[   18.814944] 
[   18.815115] The buggy address belongs to the physical page:
[   18.815151] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106890
[   18.815279] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.815333] page_type: f5(slab)
[   18.815375] raw: 0bfffe0000000000 fff00000c1736280 dead000000000122 0000000000000000
[   18.815961] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   18.816446] page dumped because: kasan: bad access detected
[   18.816697] 
[   18.816718] Memory state around the buggy address:
[   18.816988]  fff00000c688ff00: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc
[   18.817239]  fff00000c688ff80: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc
[   18.817295] >fff00000c6890000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   18.817335]                    ^
[   18.817362]  fff00000c6890080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   18.817414]  fff00000c6890100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.817451] ==================================================================


[   14.891230] ==================================================================
[   14.891765] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d8/0x460
[   14.892031] Free of addr ffff888102b5f001 by task kunit_try_catch/229
[   14.892254] 
[   14.892852] CPU: 0 UID: 0 PID: 229 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250515 #1 PREEMPT(voluntary) 
[   14.892982] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.893028] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.893076] Call Trace:
[   14.893123]  <TASK>
[   14.893164]  dump_stack_lvl+0x73/0xb0
[   14.893247]  print_report+0xd1/0x650
[   14.893300]  ? __virt_addr_valid+0x1db/0x2d0
[   14.893353]  ? kasan_complete_mode_report_info+0x2a/0x200
[   14.893393]  ? kmem_cache_invalid_free+0x1d8/0x460
[   14.893434]  kasan_report_invalid_free+0x10a/0x130
[   14.893494]  ? kmem_cache_invalid_free+0x1d8/0x460
[   14.893541]  ? kmem_cache_invalid_free+0x1d8/0x460
[   14.893586]  check_slab_allocation+0x11f/0x130
[   14.893627]  __kasan_slab_pre_free+0x28/0x40
[   14.893670]  kmem_cache_free+0xed/0x420
[   14.893718]  ? kmem_cache_alloc_noprof+0x123/0x3f0
[   14.893793]  ? kmem_cache_invalid_free+0x1d8/0x460
[   14.893856]  kmem_cache_invalid_free+0x1d8/0x460
[   14.893901]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   14.893943]  ? finish_task_switch.isra.0+0x153/0x700
[   14.893996]  ? __switch_to+0x47/0xf50
[   14.894062]  ? __pfx_read_tsc+0x10/0x10
[   14.894109]  ? ktime_get_ts64+0x86/0x230
[   14.894154]  kunit_try_run_case+0x1a5/0x480
[   14.894197]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.894242]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   14.894302]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.894328]  ? __kthread_parkme+0x82/0x180
[   14.894364]  ? preempt_count_sub+0x50/0x80
[   14.894390]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.894416]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.894443]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.894474]  kthread+0x337/0x6f0
[   14.894522]  ? trace_preempt_on+0x20/0xc0
[   14.894587]  ? __pfx_kthread+0x10/0x10
[   14.894609]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.894631]  ? calculate_sigpending+0x7b/0xa0
[   14.894657]  ? __pfx_kthread+0x10/0x10
[   14.894679]  ret_from_fork+0x116/0x1d0
[   14.894698]  ? __pfx_kthread+0x10/0x10
[   14.894719]  ret_from_fork_asm+0x1a/0x30
[   14.894754]  </TASK>
[   14.894767] 
[   14.906180] Allocated by task 229:
[   14.906391]  kasan_save_stack+0x45/0x70
[   14.907013]  kasan_save_track+0x18/0x40
[   14.907380]  kasan_save_alloc_info+0x3b/0x50
[   14.907835]  __kasan_slab_alloc+0x91/0xa0
[   14.908165]  kmem_cache_alloc_noprof+0x123/0x3f0
[   14.908585]  kmem_cache_invalid_free+0x157/0x460
[   14.908959]  kunit_try_run_case+0x1a5/0x480
[   14.909298]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.909813]  kthread+0x337/0x6f0
[   14.910012]  ret_from_fork+0x116/0x1d0
[   14.910321]  ret_from_fork_asm+0x1a/0x30
[   14.910696] 
[   14.910811] The buggy address belongs to the object at ffff888102b5f000
[   14.910811]  which belongs to the cache test_cache of size 200
[   14.911689] The buggy address is located 1 bytes inside of
[   14.911689]  200-byte region [ffff888102b5f000, ffff888102b5f0c8)
[   14.912386] 
[   14.912639] The buggy address belongs to the physical page:
[   14.913037] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102b5f
[   14.913713] flags: 0x200000000000000(node=0|zone=2)
[   14.914096] page_type: f5(slab)
[   14.914314] raw: 0200000000000000 ffff8881009b38c0 dead000000000122 0000000000000000
[   14.914906] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   14.915445] page dumped because: kasan: bad access detected
[   14.915851] 
[   14.916009] Memory state around the buggy address:
[   14.916319]  ffff888102b5ef00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.916985]  ffff888102b5ef80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.917335] >ffff888102b5f000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   14.917888]                    ^
[   14.918157]  ffff888102b5f080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   14.918534]  ffff888102b5f100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.918995] ==================================================================