Hay
Date
Dec. 4, 2024, 3:07 p.m.

Environment
qemu-arm64
qemu-x86_64

[   33.389694] ==================================================================
[   33.391375] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3b8
[   33.392352] Free of addr fff00000c66ad001 by task kunit_try_catch/199
[   33.393038] 
[   33.393470] CPU: 1 UID: 0 PID: 199 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241204 #1
[   33.395170] Tainted: [B]=BAD_PAGE, [N]=TEST
[   33.395782] Hardware name: linux,dummy-virt (DT)
[   33.396345] Call trace:
[   33.396794]  show_stack+0x20/0x38 (C)
[   33.397522]  dump_stack_lvl+0x8c/0xd0
[   33.398476]  print_report+0x118/0x5e0
[   33.399094]  kasan_report_invalid_free+0xb0/0xd8
[   33.399736]  check_slab_allocation+0xfc/0x108
[   33.400480]  __kasan_slab_pre_free+0x2c/0x48
[   33.401015]  kmem_cache_free+0xf0/0x470
[   33.401778]  kmem_cache_invalid_free+0x184/0x3b8
[   33.402462]  kunit_try_run_case+0x14c/0x3d0
[   33.403150]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.403852]  kthread+0x24c/0x2d0
[   33.404499]  ret_from_fork+0x10/0x20
[   33.405292] 
[   33.405613] Allocated by task 199:
[   33.407076]  kasan_save_stack+0x3c/0x68
[   33.407383]  kasan_save_track+0x20/0x40
[   33.407711]  kasan_save_alloc_info+0x40/0x58
[   33.408538]  __kasan_slab_alloc+0xa8/0xb0
[   33.409255]  kmem_cache_alloc_noprof+0x108/0x398
[   33.409906]  kmem_cache_invalid_free+0x12c/0x3b8
[   33.411174]  kunit_try_run_case+0x14c/0x3d0
[   33.411600]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.412463]  kthread+0x24c/0x2d0
[   33.413246]  ret_from_fork+0x10/0x20
[   33.414075] 
[   33.414697] The buggy address belongs to the object at fff00000c66ad000
[   33.414697]  which belongs to the cache test_cache of size 200
[   33.416492] The buggy address is located 1 bytes inside of
[   33.416492]  200-byte region [fff00000c66ad000, fff00000c66ad0c8)
[   33.417494] 
[   33.417970] The buggy address belongs to the physical page:
[   33.419387] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1066ad
[   33.420911] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   33.421641] page_type: f5(slab)
[   33.422492] raw: 0bfffe0000000000 fff00000c5699c80 dead000000000122 0000000000000000
[   33.424023] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   33.425297] page dumped because: kasan: bad access detected
[   33.426028] 
[   33.426350] Memory state around the buggy address:
[   33.427830]  fff00000c66acf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   33.428982]  fff00000c66acf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   33.429573] >fff00000c66ad000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   33.430818]                    ^
[   33.431305]  fff00000c66ad080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   33.432266]  fff00000c66ad100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   33.433124] ==================================================================

[   24.183733] ==================================================================
[   24.185847] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d9/0x470
[   24.186890] Free of addr ffff888101af4001 by task kunit_try_catch/219
[   24.187967] 
[   24.188192] CPU: 0 UID: 0 PID: 219 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241204 #1
[   24.190155] Tainted: [B]=BAD_PAGE, [N]=TEST
[   24.190810] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   24.191516] Call Trace:
[   24.191767]  <TASK>
[   24.192813]  dump_stack_lvl+0x73/0xb0
[   24.193139]  print_report+0xd1/0x640
[   24.194324]  ? __virt_addr_valid+0x1db/0x2d0
[   24.195056]  ? kmem_cache_invalid_free+0x1d9/0x470
[   24.195772]  ? kasan_complete_mode_report_info+0x2a/0x200
[   24.196280]  ? kmem_cache_invalid_free+0x1d9/0x470
[   24.196739]  kasan_report_invalid_free+0xc0/0xf0
[   24.197220]  ? kmem_cache_invalid_free+0x1d9/0x470
[   24.197624]  ? kmem_cache_invalid_free+0x1d9/0x470
[   24.198628]  check_slab_allocation+0x11f/0x130
[   24.199175]  __kasan_slab_pre_free+0x28/0x40
[   24.199758]  kmem_cache_free+0xee/0x420
[   24.200652]  ? kmem_cache_alloc_noprof+0x11e/0x3e0
[   24.201150]  ? kmem_cache_invalid_free+0x1d9/0x470
[   24.201822]  kmem_cache_invalid_free+0x1d9/0x470
[   24.202592]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   24.203103]  ? finish_task_switch.isra.0+0x153/0x700
[   24.203790]  ? __switch_to+0x5d9/0xf60
[   24.204430]  ? __pfx_read_tsc+0x10/0x10
[   24.204914]  ? ktime_get_ts64+0x86/0x230
[   24.205714]  kunit_try_run_case+0x1b3/0x490
[   24.206301]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.206917]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   24.207617]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   24.208139]  ? __kthread_parkme+0x82/0x160
[   24.208828]  ? preempt_count_sub+0x50/0x80
[   24.209366]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.209952]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   24.210798]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.211604]  kthread+0x257/0x310
[   24.212075]  ? __pfx_kthread+0x10/0x10
[   24.212426]  ret_from_fork+0x41/0x80
[   24.212836]  ? __pfx_kthread+0x10/0x10
[   24.213338]  ret_from_fork_asm+0x1a/0x30
[   24.213786]  </TASK>
[   24.214407] 
[   24.214592] Allocated by task 219:
[   24.214955]  kasan_save_stack+0x3d/0x60
[   24.215443]  kasan_save_track+0x18/0x40
[   24.215982]  kasan_save_alloc_info+0x3b/0x50
[   24.217407]  __kasan_slab_alloc+0x91/0xa0
[   24.217807]  kmem_cache_alloc_noprof+0x11e/0x3e0
[   24.218254]  kmem_cache_invalid_free+0x158/0x470
[   24.219959]  kunit_try_run_case+0x1b3/0x490
[   24.220529]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.221515]  kthread+0x257/0x310
[   24.222140]  ret_from_fork+0x41/0x80
[   24.222480]  ret_from_fork_asm+0x1a/0x30
[   24.223172] 
[   24.223452] The buggy address belongs to the object at ffff888101af4000
[   24.223452]  which belongs to the cache test_cache of size 200
[   24.224704] The buggy address is located 1 bytes inside of
[   24.224704]  200-byte region [ffff888101af4000, ffff888101af40c8)
[   24.226572] 
[   24.227211] The buggy address belongs to the physical page:
[   24.228034] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101af4
[   24.229305] flags: 0x200000000000000(node=0|zone=2)
[   24.229910] page_type: f5(slab)
[   24.230517] raw: 0200000000000000 ffff888101a9c640 dead000000000122 0000000000000000
[   24.231509] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   24.232792] page dumped because: kasan: bad access detected
[   24.233551] 
[   24.234048] Memory state around the buggy address:
[   24.234779]  ffff888101af3f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.236340]  ffff888101af3f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.237123] >ffff888101af4000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   24.237851]                    ^
[   24.238488]  ffff888101af4080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   24.239212]  ffff888101af4100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.239850] ==================================================================