Hay
Date
March 19, 2025, 10:35 a.m.

Environment
qemu-arm64
qemu-x86_64

[   34.356211] ==================================================================
[   34.356413] BUG: KASAN: out-of-bounds in kmalloc_memmove_negative_size+0x154/0x2e0
[   34.356568] Read of size 18446744073709551614 at addr fff00000c5d89704 by task kunit_try_catch/182
[   34.356883] 
[   34.356998] CPU: 1 UID: 0 PID: 182 Comm: kunit_try_catch Tainted: G    B            N  6.14.0-rc7-next-20250319 #1 PREEMPT 
[   34.357335] Tainted: [B]=BAD_PAGE, [N]=TEST
[   34.357422] Hardware name: linux,dummy-virt (DT)
[   34.358016] Call trace:
[   34.358114]  show_stack+0x20/0x38 (C)
[   34.358272]  dump_stack_lvl+0x8c/0xd0
[   34.358415]  print_report+0x118/0x5f0
[   34.358610]  kasan_report+0xc8/0x118
[   34.358749]  kasan_check_range+0x100/0x1a8
[   34.358910]  __asan_memmove+0x3c/0x98
[   34.359095]  kmalloc_memmove_negative_size+0x154/0x2e0
[   34.359270]  kunit_try_run_case+0x14c/0x3d0
[   34.359444]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   34.359670]  kthread+0x318/0x618
[   34.359813]  ret_from_fork+0x10/0x20
[   34.360034] 
[   34.360117] Allocated by task 182:
[   34.360203]  kasan_save_stack+0x3c/0x68
[   34.360459]  kasan_save_track+0x20/0x40
[   34.360611]  kasan_save_alloc_info+0x40/0x58
[   34.360912]  __kasan_kmalloc+0xd4/0xd8
[   34.361267]  __kmalloc_cache_noprof+0x15c/0x3c0
[   34.361523]  kmalloc_memmove_negative_size+0xb0/0x2e0
[   34.361665]  kunit_try_run_case+0x14c/0x3d0
[   34.362315]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   34.362670]  kthread+0x318/0x618
[   34.362811]  ret_from_fork+0x10/0x20
[   34.363415] 
[   34.363488] The buggy address belongs to the object at fff00000c5d89700
[   34.363488]  which belongs to the cache kmalloc-64 of size 64
[   34.364008] The buggy address is located 4 bytes inside of
[   34.364008]  64-byte region [fff00000c5d89700, fff00000c5d89740)
[   34.364541] 
[   34.364940] The buggy address belongs to the physical page:
[   34.365082] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105d89
[   34.365610] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   34.365781] page_type: f5(slab)
[   34.366107] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   34.366590] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   34.366745] page dumped because: kasan: bad access detected
[   34.366851] 
[   34.367531] Memory state around the buggy address:
[   34.367790]  fff00000c5d89600: 00 00 00 00 01 fc fc fc fc fc fc fc fc fc fc fc
[   34.368217]  fff00000c5d89680: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   34.368569] >fff00000c5d89700: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   34.368692]                    ^
[   34.368784]  fff00000c5d89780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   34.369478]  fff00000c5d89800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   34.369891] ==================================================================

[   22.039978] ==================================================================
[   22.040842] BUG: KASAN: out-of-bounds in kmalloc_memmove_negative_size+0x171/0x330
[   22.042033] Read of size 18446744073709551614 at addr ffff88810305c784 by task kunit_try_catch/201
[   22.042814] 
[   22.043023] CPU: 0 UID: 0 PID: 201 Comm: kunit_try_catch Tainted: G    B            N  6.14.0-rc7-next-20250319 #1 PREEMPT(voluntary) 
[   22.043163] Tainted: [B]=BAD_PAGE, [N]=TEST
[   22.043199] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   22.043251] Call Trace:
[   22.043280]  <TASK>
[   22.043312]  dump_stack_lvl+0x73/0xb0
[   22.043385]  print_report+0xd1/0x660
[   22.043448]  ? __virt_addr_valid+0x1db/0x2d0
[   22.043548]  ? kasan_complete_mode_report_info+0x2a/0x200
[   22.043680]  kasan_report+0x104/0x140
[   22.043751]  ? kmalloc_memmove_negative_size+0x171/0x330
[   22.043828]  ? kmalloc_memmove_negative_size+0x171/0x330
[   22.043916]  kasan_check_range+0x10c/0x1c0
[   22.044970]  __asan_memmove+0x27/0x70
[   22.045056]  kmalloc_memmove_negative_size+0x171/0x330
[   22.045155]  ? __pfx_kmalloc_memmove_negative_size+0x10/0x10
[   22.045235]  ? __schedule+0xd46/0x29c0
[   22.045294]  ? __pfx_read_tsc+0x10/0x10
[   22.045347]  ? ktime_get_ts64+0x86/0x240
[   22.045410]  kunit_try_run_case+0x1b2/0x490
[   22.045475]  ? __pfx_kunit_try_run_case+0x10/0x10
[   22.045530]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   22.045584]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   22.045640]  ? __kthread_parkme+0x82/0x160
[   22.045695]  ? preempt_count_sub+0x50/0x80
[   22.045786]  ? __pfx_kunit_try_run_case+0x10/0x10
[   22.045846]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.045906]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   22.045961]  kthread+0x323/0x710
[   22.046015]  ? trace_preempt_on+0x20/0xc0
[   22.046078]  ? __pfx_kthread+0x10/0x10
[   22.046165]  ? _raw_spin_unlock_irq+0x47/0x80
[   22.046224]  ? calculate_sigpending+0x7b/0xa0
[   22.046283]  ? __pfx_kthread+0x10/0x10
[   22.046343]  ret_from_fork+0x41/0x80
[   22.046397]  ? __pfx_kthread+0x10/0x10
[   22.046452]  ret_from_fork_asm+0x1a/0x30
[   22.046532]  </TASK>
[   22.046559] 
[   22.058462] Allocated by task 201:
[   22.058807]  kasan_save_stack+0x3d/0x60
[   22.059209]  kasan_save_track+0x18/0x40
[   22.059586]  kasan_save_alloc_info+0x3b/0x50
[   22.060061]  __kasan_kmalloc+0xb7/0xc0
[   22.062034]  __kmalloc_cache_noprof+0x183/0x410
[   22.062530]  kmalloc_memmove_negative_size+0xac/0x330
[   22.063896]  kunit_try_run_case+0x1b2/0x490
[   22.064397]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.064703]  kthread+0x323/0x710
[   22.064927]  ret_from_fork+0x41/0x80
[   22.065184]  ret_from_fork_asm+0x1a/0x30
[   22.065435] 
[   22.065568] The buggy address belongs to the object at ffff88810305c780
[   22.065568]  which belongs to the cache kmalloc-64 of size 64
[   22.066140] The buggy address is located 4 bytes inside of
[   22.066140]  64-byte region [ffff88810305c780, ffff88810305c7c0)
[   22.067053] 
[   22.068265] The buggy address belongs to the physical page:
[   22.069590] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10305c
[   22.070388] flags: 0x200000000000000(node=0|zone=2)
[   22.070857] page_type: f5(slab)
[   22.071884] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   22.072396] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   22.072792] page dumped because: kasan: bad access detected
[   22.073102] 
[   22.073285] Memory state around the buggy address:
[   22.073569]  ffff88810305c680: 00 00 00 00 01 fc fc fc fc fc fc fc fc fc fc fc
[   22.073943]  ffff88810305c700: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   22.077808] >ffff88810305c780: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   22.079543]                    ^
[   22.080364]  ffff88810305c800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.081618]  ffff88810305c880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.082849] ==================================================================