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

Environment
qemu-arm64
qemu-x86_64

[   18.130736] ==================================================================
[   18.131235] BUG: KASAN: slab-out-of-bounds in kmalloc_memmove_invalid_size+0x154/0x2e0
[   18.131305] Read of size 64 at addr fff00000c6879a04 by task kunit_try_catch/182
[   18.131459] 
[   18.131546] CPU: 1 UID: 0 PID: 182 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250515 #1 PREEMPT 
[   18.131728] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.131786] Hardware name: linux,dummy-virt (DT)
[   18.131816] Call trace:
[   18.131837]  show_stack+0x20/0x38 (C)
[   18.131893]  dump_stack_lvl+0x8c/0xd0
[   18.131938]  print_report+0x118/0x608
[   18.132287]  kasan_report+0xdc/0x128
[   18.132366]  kasan_check_range+0x100/0x1a8
[   18.132496]  __asan_memmove+0x3c/0x98
[   18.132549]  kmalloc_memmove_invalid_size+0x154/0x2e0
[   18.132636]  kunit_try_run_case+0x170/0x3f0
[   18.132823]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.132892]  kthread+0x328/0x630
[   18.132938]  ret_from_fork+0x10/0x20
[   18.133123] 
[   18.133149] Allocated by task 182:
[   18.133199]  kasan_save_stack+0x3c/0x68
[   18.133242]  kasan_save_track+0x20/0x40
[   18.133278]  kasan_save_alloc_info+0x40/0x58
[   18.133459]  __kasan_kmalloc+0xd4/0xd8
[   18.133545]  __kmalloc_cache_noprof+0x15c/0x3c0
[   18.133601]  kmalloc_memmove_invalid_size+0xb0/0x2e0
[   18.133948]  kunit_try_run_case+0x170/0x3f0
[   18.134117]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.134454]  kthread+0x328/0x630
[   18.134752]  ret_from_fork+0x10/0x20
[   18.134952] 
[   18.135034] The buggy address belongs to the object at fff00000c6879a00
[   18.135034]  which belongs to the cache kmalloc-64 of size 64
[   18.135259] The buggy address is located 4 bytes inside of
[   18.135259]  allocated 64-byte region [fff00000c6879a00, fff00000c6879a40)
[   18.135430] 
[   18.135753] The buggy address belongs to the physical page:
[   18.135887] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106879
[   18.135993] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.136148] page_type: f5(slab)
[   18.136227] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   18.136433] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   18.136538] page dumped because: kasan: bad access detected
[   18.136701] 
[   18.136745] Memory state around the buggy address:
[   18.136843]  fff00000c6879900: 00 00 00 00 00 01 fc fc fc fc fc fc fc fc fc fc
[   18.136927]  fff00000c6879980: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   18.137003] >fff00000c6879a00: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   18.137041]                                            ^
[   18.137343]  fff00000c6879a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.137532]  fff00000c6879b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.137621] ==================================================================


[   14.309832] ==================================================================
[   14.310311] BUG: KASAN: slab-out-of-bounds in kmalloc_memmove_invalid_size+0x16f/0x330
[   14.311155] Read of size 64 at addr ffff88810230b104 by task kunit_try_catch/200
[   14.311474] 
[   14.311677] CPU: 1 UID: 0 PID: 200 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250515 #1 PREEMPT(voluntary) 
[   14.311772] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.311794] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.311820] Call Trace:
[   14.311835]  <TASK>
[   14.311862]  dump_stack_lvl+0x73/0xb0
[   14.311898]  print_report+0xd1/0x650
[   14.311921]  ? __virt_addr_valid+0x1db/0x2d0
[   14.311954]  ? kmalloc_memmove_invalid_size+0x16f/0x330
[   14.311990]  ? kasan_complete_mode_report_info+0x2a/0x200
[   14.312022]  ? kmalloc_memmove_invalid_size+0x16f/0x330
[   14.312062]  kasan_report+0x141/0x180
[   14.312103]  ? kmalloc_memmove_invalid_size+0x16f/0x330
[   14.312159]  kasan_check_range+0x10c/0x1c0
[   14.312206]  __asan_memmove+0x27/0x70
[   14.312261]  kmalloc_memmove_invalid_size+0x16f/0x330
[   14.312310]  ? __pfx_kmalloc_memmove_invalid_size+0x10/0x10
[   14.312360]  ? __pfx_kmalloc_memmove_invalid_size+0x10/0x10
[   14.312415]  kunit_try_run_case+0x1a5/0x480
[   14.312445]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.312465]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   14.312489]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.312509]  ? __kthread_parkme+0x82/0x180
[   14.312529]  ? preempt_count_sub+0x50/0x80
[   14.312554]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.312576]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.312596]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.312617]  kthread+0x337/0x6f0
[   14.312635]  ? trace_preempt_on+0x20/0xc0
[   14.312658]  ? __pfx_kthread+0x10/0x10
[   14.312678]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.312697]  ? calculate_sigpending+0x7b/0xa0
[   14.312720]  ? __pfx_kthread+0x10/0x10
[   14.312740]  ret_from_fork+0x116/0x1d0
[   14.312758]  ? __pfx_kthread+0x10/0x10
[   14.312777]  ret_from_fork_asm+0x1a/0x30
[   14.312808]  </TASK>
[   14.312820] 
[   14.319761] Allocated by task 200:
[   14.320066]  kasan_save_stack+0x45/0x70
[   14.320399]  kasan_save_track+0x18/0x40
[   14.320681]  kasan_save_alloc_info+0x3b/0x50
[   14.321001]  __kasan_kmalloc+0xb7/0xc0
[   14.321319]  __kmalloc_cache_noprof+0x189/0x420
[   14.321657]  kmalloc_memmove_invalid_size+0xac/0x330
[   14.322046]  kunit_try_run_case+0x1a5/0x480
[   14.322377]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.322774]  kthread+0x337/0x6f0
[   14.323054]  ret_from_fork+0x116/0x1d0
[   14.323374]  ret_from_fork_asm+0x1a/0x30
[   14.323690] 
[   14.323806] The buggy address belongs to the object at ffff88810230b100
[   14.323806]  which belongs to the cache kmalloc-64 of size 64
[   14.324281] The buggy address is located 4 bytes inside of
[   14.324281]  allocated 64-byte region [ffff88810230b100, ffff88810230b140)
[   14.324829] 
[   14.324990] The buggy address belongs to the physical page:
[   14.325282] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10230b
[   14.325660] flags: 0x200000000000000(node=0|zone=2)
[   14.325923] page_type: f5(slab)
[   14.326088] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   14.326607] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   14.326939] page dumped because: kasan: bad access detected
[   14.327290] 
[   14.327433] Memory state around the buggy address:
[   14.327704]  ffff88810230b000: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   14.328107]  ffff88810230b080: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   14.328504] >ffff88810230b100: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   14.328777]                                            ^
[   14.329044]  ffff88810230b180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.329359]  ffff88810230b200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.329641] ==================================================================