Hay
Date
Dec. 3, 2024, 11:38 p.m.

Environment
qemu-arm64
qemu-x86_64

[   31.747822] ==================================================================
[   31.749175] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3b8
[   31.749905] Free of addr fff00000c5915001 by task kunit_try_catch/200
[   31.750716] 
[   31.751164] CPU: 1 UID: 0 PID: 200 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241203 #1
[   31.752896] Tainted: [B]=BAD_PAGE, [N]=TEST
[   31.753505] Hardware name: linux,dummy-virt (DT)
[   31.754301] Call trace:
[   31.754762]  show_stack+0x20/0x38 (C)
[   31.755745]  dump_stack_lvl+0x8c/0xd0
[   31.756383]  print_report+0x118/0x5e0
[   31.756942]  kasan_report_invalid_free+0xb0/0xd8
[   31.757632]  check_slab_allocation+0xfc/0x108
[   31.758365]  __kasan_slab_pre_free+0x2c/0x48
[   31.759364]  kmem_cache_free+0xf0/0x470
[   31.759947]  kmem_cache_invalid_free+0x184/0x3b8
[   31.760655]  kunit_try_run_case+0x14c/0x3d0
[   31.761273]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.762099]  kthread+0x24c/0x2d0
[   31.762573]  ret_from_fork+0x10/0x20
[   31.763594] 
[   31.763887] Allocated by task 200:
[   31.764386]  kasan_save_stack+0x3c/0x68
[   31.764976]  kasan_save_track+0x20/0x40
[   31.765614]  kasan_save_alloc_info+0x40/0x58
[   31.766253]  __kasan_slab_alloc+0xa8/0xb0
[   31.766970]  kmem_cache_alloc_noprof+0x108/0x398
[   31.768044]  kmem_cache_invalid_free+0x12c/0x3b8
[   31.768630]  kunit_try_run_case+0x14c/0x3d0
[   31.769400]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.770133]  kthread+0x24c/0x2d0
[   31.770678]  ret_from_fork+0x10/0x20
[   31.771614] 
[   31.771945] The buggy address belongs to the object at fff00000c5915000
[   31.771945]  which belongs to the cache test_cache of size 200
[   31.773270] The buggy address is located 1 bytes inside of
[   31.773270]  200-byte region [fff00000c5915000, fff00000c59150c8)
[   31.774593] 
[   31.774886] The buggy address belongs to the physical page:
[   31.775572] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105915
[   31.776592] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   31.777657] page_type: f5(slab)
[   31.778556] raw: 0bfffe0000000000 fff00000c56f9640 dead000000000122 0000000000000000
[   31.779576] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   31.780755] page dumped because: kasan: bad access detected
[   31.781302] 
[   31.781688] Memory state around the buggy address:
[   31.782424]  fff00000c5914f00: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc
[   31.783493]  fff00000c5914f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.784370] >fff00000c5915000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   31.785229]                    ^
[   31.785902]  fff00000c5915080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   31.786812]  fff00000c5915100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.787929] ==================================================================

[   27.179889] ==================================================================
[   27.180572] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d9/0x470
[   27.181254] Free of addr ffff88810298f001 by task kunit_try_catch/220
[   27.181996] 
[   27.182183] CPU: 0 UID: 0 PID: 220 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241203 #1
[   27.183167] Tainted: [B]=BAD_PAGE, [N]=TEST
[   27.183454] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   27.184193] Call Trace:
[   27.184413]  <TASK>
[   27.184950]  dump_stack_lvl+0x73/0xb0
[   27.185364]  print_report+0xd1/0x640
[   27.186393]  ? __virt_addr_valid+0x1db/0x2d0
[   27.187124]  ? kmem_cache_invalid_free+0x1d9/0x470
[   27.187427]  ? kasan_complete_mode_report_info+0x2a/0x200
[   27.187759]  ? kmem_cache_invalid_free+0x1d9/0x470
[   27.188362]  kasan_report_invalid_free+0xc0/0xf0
[   27.188842]  ? kmem_cache_invalid_free+0x1d9/0x470
[   27.189516]  ? kmem_cache_invalid_free+0x1d9/0x470
[   27.189825]  check_slab_allocation+0x11f/0x130
[   27.190204]  __kasan_slab_pre_free+0x28/0x40
[   27.190830]  kmem_cache_free+0xee/0x420
[   27.191271]  ? kmem_cache_alloc_noprof+0x11e/0x3e0
[   27.191895]  ? kmem_cache_invalid_free+0x1d9/0x470
[   27.192223]  kmem_cache_invalid_free+0x1d9/0x470
[   27.192537]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   27.193181]  ? finish_task_switch.isra.0+0x153/0x700
[   27.193856]  ? __switch_to+0x5d9/0xf60
[   27.194292]  ? __pfx_read_tsc+0x10/0x10
[   27.194869]  ? ktime_get_ts64+0x86/0x230
[   27.195199]  kunit_try_run_case+0x1b3/0x490
[   27.195794]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.196206]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   27.197793]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   27.198172]  ? __kthread_parkme+0x82/0x160
[   27.199020]  ? preempt_count_sub+0x50/0x80
[   27.199371]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.200480]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   27.201007]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.201750]  kthread+0x257/0x310
[   27.202049]  ? __pfx_kthread+0x10/0x10
[   27.202316]  ret_from_fork+0x41/0x80
[   27.203401]  ? __pfx_kthread+0x10/0x10
[   27.203836]  ret_from_fork_asm+0x1a/0x30
[   27.204233]  </TASK>
[   27.204470] 
[   27.205314] Allocated by task 220:
[   27.205816]  kasan_save_stack+0x3d/0x60
[   27.206102]  kasan_save_track+0x18/0x40
[   27.206460]  kasan_save_alloc_info+0x3b/0x50
[   27.207558]  __kasan_slab_alloc+0x91/0xa0
[   27.207963]  kmem_cache_alloc_noprof+0x11e/0x3e0
[   27.208326]  kmem_cache_invalid_free+0x158/0x470
[   27.209300]  kunit_try_run_case+0x1b3/0x490
[   27.209794]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.210224]  kthread+0x257/0x310
[   27.211345]  ret_from_fork+0x41/0x80
[   27.211745]  ret_from_fork_asm+0x1a/0x30
[   27.212140] 
[   27.212803] The buggy address belongs to the object at ffff88810298f000
[   27.212803]  which belongs to the cache test_cache of size 200
[   27.213850] The buggy address is located 1 bytes inside of
[   27.213850]  200-byte region [ffff88810298f000, ffff88810298f0c8)
[   27.215145] 
[   27.215555] The buggy address belongs to the physical page:
[   27.216152] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10298f
[   27.217416] flags: 0x200000000000000(node=0|zone=2)
[   27.217815] page_type: f5(slab)
[   27.218517] raw: 0200000000000000 ffff88810155cdc0 dead000000000122 0000000000000000
[   27.219217] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   27.220269] page dumped because: kasan: bad access detected
[   27.220982] 
[   27.221202] Memory state around the buggy address:
[   27.221985]  ffff88810298ef00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.222451]  ffff88810298ef80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.223097] >ffff88810298f000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   27.223784]                    ^
[   27.224021]  ffff88810298f080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   27.225277]  ffff88810298f100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.226113] ==================================================================