Hay
Date
July 4, 2025, 11:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   29.645422] ==================================================================
[   29.645518] BUG: KASAN: slab-out-of-bounds in kmalloc_memmove_invalid_size+0x154/0x2e0
[   29.645572] Read of size 64 at addr fff00000c9b70784 by task kunit_try_catch/215
[   29.645621] 
[   29.645650] CPU: 0 UID: 0 PID: 215 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4-next-20250704 #1 PREEMPT 
[   29.645887] Tainted: [B]=BAD_PAGE, [N]=TEST
[   29.645970] Hardware name: linux,dummy-virt (DT)
[   29.646002] Call trace:
[   29.646026]  show_stack+0x20/0x38 (C)
[   29.646207]  dump_stack_lvl+0x8c/0xd0
[   29.646258]  print_report+0x118/0x608
[   29.646303]  kasan_report+0xdc/0x128
[   29.646348]  kasan_check_range+0x100/0x1a8
[   29.646393]  __asan_memmove+0x3c/0x98
[   29.646436]  kmalloc_memmove_invalid_size+0x154/0x2e0
[   29.646600]  kunit_try_run_case+0x170/0x3f0
[   29.646708]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.646812]  kthread+0x328/0x630
[   29.646895]  ret_from_fork+0x10/0x20
[   29.647047] 
[   29.647166] Allocated by task 215:
[   29.647194]  kasan_save_stack+0x3c/0x68
[   29.647259]  kasan_save_track+0x20/0x40
[   29.647301]  kasan_save_alloc_info+0x40/0x58
[   29.647341]  __kasan_kmalloc+0xd4/0xd8
[   29.647584]  __kmalloc_cache_noprof+0x16c/0x3c0
[   29.647682]  kmalloc_memmove_invalid_size+0xb0/0x2e0
[   29.647771]  kunit_try_run_case+0x170/0x3f0
[   29.647862]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.648006]  kthread+0x328/0x630
[   29.648109]  ret_from_fork+0x10/0x20
[   29.648148] 
[   29.648168] The buggy address belongs to the object at fff00000c9b70780
[   29.648168]  which belongs to the cache kmalloc-64 of size 64
[   29.648226] The buggy address is located 4 bytes inside of
[   29.648226]  allocated 64-byte region [fff00000c9b70780, fff00000c9b707c0)
[   29.648288] 
[   29.648319] The buggy address belongs to the physical page:
[   29.648364] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109b70
[   29.648433] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   29.648481] page_type: f5(slab)
[   29.648520] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   29.648580] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   29.648622] page dumped because: kasan: bad access detected
[   29.648655] 
[   29.648673] Memory state around the buggy address:
[   29.648720]  fff00000c9b70680: 00 00 00 00 00 01 fc fc fc fc fc fc fc fc fc fc
[   29.648773]  fff00000c9b70700: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   29.648820] >fff00000c9b70780: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   29.648866]                                            ^
[   29.648912]  fff00000c9b70800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.648953]  fff00000c9b70880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.648991] ==================================================================

[   25.139513] ==================================================================
[   25.140717] BUG: KASAN: slab-out-of-bounds in kmalloc_memmove_invalid_size+0x16f/0x330
[   25.141347] Read of size 64 at addr ffff888104512104 by task kunit_try_catch/231
[   25.141665] 
[   25.142109] CPU: 1 UID: 0 PID: 231 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4-next-20250704 #1 PREEMPT(voluntary) 
[   25.142168] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.142182] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   25.142208] Call Trace:
[   25.142234]  <TASK>
[   25.142259]  dump_stack_lvl+0x73/0xb0
[   25.142300]  print_report+0xd1/0x650
[   25.142324]  ? __virt_addr_valid+0x1db/0x2d0
[   25.142351]  ? kmalloc_memmove_invalid_size+0x16f/0x330
[   25.142375]  ? kasan_complete_mode_report_info+0x2a/0x200
[   25.142413]  ? kmalloc_memmove_invalid_size+0x16f/0x330
[   25.142438]  kasan_report+0x141/0x180
[   25.142460]  ? kmalloc_memmove_invalid_size+0x16f/0x330
[   25.142489]  kasan_check_range+0x10c/0x1c0
[   25.142513]  __asan_memmove+0x27/0x70
[   25.142536]  kmalloc_memmove_invalid_size+0x16f/0x330
[   25.142560]  ? __pfx_kmalloc_memmove_invalid_size+0x10/0x10
[   25.142584]  ? __schedule+0x10cc/0x2b60
[   25.142610]  ? __pfx_read_tsc+0x10/0x10
[   25.142632]  ? ktime_get_ts64+0x86/0x230
[   25.142660]  kunit_try_run_case+0x1a5/0x480
[   25.142688]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.142711]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   25.142736]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   25.142760]  ? __kthread_parkme+0x82/0x180
[   25.142782]  ? preempt_count_sub+0x50/0x80
[   25.142806]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.142831]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.142856]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   25.142881]  kthread+0x337/0x6f0
[   25.142901]  ? trace_preempt_on+0x20/0xc0
[   25.142927]  ? __pfx_kthread+0x10/0x10
[   25.142948]  ? _raw_spin_unlock_irq+0x47/0x80
[   25.142971]  ? calculate_sigpending+0x7b/0xa0
[   25.142996]  ? __pfx_kthread+0x10/0x10
[   25.143018]  ret_from_fork+0x116/0x1d0
[   25.143037]  ? __pfx_kthread+0x10/0x10
[   25.143058]  ret_from_fork_asm+0x1a/0x30
[   25.143090]  </TASK>
[   25.143104] 
[   25.150888] Allocated by task 231:
[   25.151086]  kasan_save_stack+0x45/0x70
[   25.151284]  kasan_save_track+0x18/0x40
[   25.151676]  kasan_save_alloc_info+0x3b/0x50
[   25.151845]  __kasan_kmalloc+0xb7/0xc0
[   25.151978]  __kmalloc_cache_noprof+0x189/0x420
[   25.152252]  kmalloc_memmove_invalid_size+0xac/0x330
[   25.152535]  kunit_try_run_case+0x1a5/0x480
[   25.152774]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.153071]  kthread+0x337/0x6f0
[   25.153330]  ret_from_fork+0x116/0x1d0
[   25.153562]  ret_from_fork_asm+0x1a/0x30
[   25.153705] 
[   25.153799] The buggy address belongs to the object at ffff888104512100
[   25.153799]  which belongs to the cache kmalloc-64 of size 64
[   25.154430] The buggy address is located 4 bytes inside of
[   25.154430]  allocated 64-byte region [ffff888104512100, ffff888104512140)
[   25.154983] 
[   25.155078] The buggy address belongs to the physical page:
[   25.155282] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x104512
[   25.156185] flags: 0x200000000000000(node=0|zone=2)
[   25.156444] page_type: f5(slab)
[   25.156638] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   25.156976] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   25.157327] page dumped because: kasan: bad access detected
[   25.157624] 
[   25.157697] Memory state around the buggy address:
[   25.157853]  ffff888104512000: 00 00 00 00 00 01 fc fc fc fc fc fc fc fc fc fc
[   25.158071]  ffff888104512080: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   25.158559] >ffff888104512100: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   25.158889]                                            ^
[   25.159132]  ffff888104512180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.159468]  ffff888104512200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.159728] ==================================================================