Hay
Date
June 7, 2025, 10:40 a.m.

Environment
qemu-arm64
qemu-x86_64

[   21.510218] ==================================================================
[   21.511427] BUG: KASAN: out-of-bounds in kmalloc_memmove_negative_size+0x15c/0x2f8
[   21.512370] Read of size 18446744073709551614 at addr fff00000c413b704 by task kunit_try_catch/168
[   21.513157] 
[   21.513476] CPU: 1 UID: 0 PID: 168 Comm: kunit_try_catch Tainted: G    B            N 6.12.33-rc1 #1
[   21.513610] Tainted: [B]=BAD_PAGE, [N]=TEST
[   21.513644] Hardware name: linux,dummy-virt (DT)
[   21.513696] Call trace:
[   21.514053]  dump_backtrace+0x9c/0x128
[   21.514226]  show_stack+0x20/0x38
[   21.514387]  dump_stack_lvl+0x8c/0xd0
[   21.514492]  print_report+0x118/0x5f0
[   21.514542]  kasan_report+0xdc/0x128
[   21.514584]  kasan_check_range+0x100/0x1a8
[   21.514629]  __asan_memmove+0x3c/0x98
[   21.514672]  kmalloc_memmove_negative_size+0x15c/0x2f8
[   21.514723]  kunit_try_run_case+0x170/0x3f0
[   21.514767]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.514818]  kthread+0x24c/0x2d0
[   21.514860]  ret_from_fork+0x10/0x20
[   21.514907] 
[   21.523222] Allocated by task 168:
[   21.523685]  kasan_save_stack+0x3c/0x68
[   21.524402]  kasan_save_track+0x20/0x40
[   21.524980]  kasan_save_alloc_info+0x40/0x58
[   21.525459]  __kasan_kmalloc+0xd4/0xd8
[   21.526045]  __kmalloc_cache_noprof+0x154/0x320
[   21.526606]  kmalloc_memmove_negative_size+0xb8/0x2f8
[   21.527359]  kunit_try_run_case+0x170/0x3f0
[   21.527856]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.528562]  kthread+0x24c/0x2d0
[   21.529067]  ret_from_fork+0x10/0x20
[   21.529545] 
[   21.529848] The buggy address belongs to the object at fff00000c413b700
[   21.529848]  which belongs to the cache kmalloc-64 of size 64
[   21.531174] The buggy address is located 4 bytes inside of
[   21.531174]  64-byte region [fff00000c413b700, fff00000c413b740)
[   21.533285] 
[   21.533744] The buggy address belongs to the physical page:
[   21.534496] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10413b
[   21.535453] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   21.536210] page_type: f5(slab)
[   21.536629] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   21.537709] raw: 0000000000000000 0000000080200020 00000001f5000000 0000000000000000
[   21.538314] page dumped because: kasan: bad access detected
[   21.538571] 
[   21.538697] Memory state around the buggy address:
[   21.538930]  fff00000c413b600: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   21.539580]  fff00000c413b680: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   21.541159] >fff00000c413b700: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   21.541897]                    ^
[   21.542532]  fff00000c413b780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.543360]  fff00000c413b800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.544242] ==================================================================

[   17.866916] ==================================================================
[   17.868121] BUG: KASAN: out-of-bounds in kmalloc_memmove_negative_size+0x172/0x330
[   17.869515] Read of size 18446744073709551614 at addr ffff88810230b604 by task kunit_try_catch/185
[   17.870940] 
[   17.871173] CPU: 1 UID: 0 PID: 185 Comm: kunit_try_catch Tainted: G    B            N 6.12.33-rc1 #1
[   17.871540] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.871577] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   17.871637] Call Trace:
[   17.871751]  <TASK>
[   17.871802]  dump_stack_lvl+0x73/0xb0
[   17.871891]  print_report+0xd1/0x640
[   17.871928]  ? __virt_addr_valid+0x1db/0x2d0
[   17.871962]  ? kmalloc_memmove_negative_size+0x172/0x330
[   17.871993]  ? kasan_complete_mode_report_info+0x2a/0x200
[   17.872025]  ? kmalloc_memmove_negative_size+0x172/0x330
[   17.872080]  kasan_report+0x140/0x180
[   17.872118]  ? kmalloc_memmove_negative_size+0x172/0x330
[   17.872155]  kasan_check_range+0x10c/0x1c0
[   17.872183]  __asan_memmove+0x27/0x70
[   17.872232]  kmalloc_memmove_negative_size+0x172/0x330
[   17.872272]  ? __pfx_kmalloc_memmove_negative_size+0x10/0x10
[   17.872304]  ? __schedule+0xc49/0x27a0
[   17.872335]  ? __pfx_read_tsc+0x10/0x10
[   17.872363]  ? ktime_get_ts64+0x84/0x230
[   17.872399]  kunit_try_run_case+0x1a6/0x480
[   17.872432]  ? __pfx_kunit_try_run_case+0x10/0x10
[   17.872485]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   17.872558]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   17.872604]  ? __kthread_parkme+0x82/0x160
[   17.872633]  ? preempt_count_sub+0x50/0x80
[   17.872664]  ? __pfx_kunit_try_run_case+0x10/0x10
[   17.872691]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   17.872726]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   17.872763]  kthread+0x257/0x310
[   17.872788]  ? __pfx_kthread+0x10/0x10
[   17.872828]  ret_from_fork+0x41/0x80
[   17.872885]  ? __pfx_kthread+0x10/0x10
[   17.872912]  ret_from_fork_asm+0x1a/0x30
[   17.872953]  </TASK>
[   17.872967] 
[   17.893140] Allocated by task 185:
[   17.893638]  kasan_save_stack+0x45/0x70
[   17.894140]  kasan_save_track+0x18/0x40
[   17.894542]  kasan_save_alloc_info+0x3b/0x50
[   17.895131]  __kasan_kmalloc+0xb7/0xc0
[   17.895589]  __kmalloc_cache_noprof+0x168/0x350
[   17.896016]  kmalloc_memmove_negative_size+0xad/0x330
[   17.896803]  kunit_try_run_case+0x1a6/0x480
[   17.897453]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   17.898554]  kthread+0x257/0x310
[   17.898988]  ret_from_fork+0x41/0x80
[   17.899538]  ret_from_fork_asm+0x1a/0x30
[   17.899816] 
[   17.899974] The buggy address belongs to the object at ffff88810230b600
[   17.899974]  which belongs to the cache kmalloc-64 of size 64
[   17.901781] The buggy address is located 4 bytes inside of
[   17.901781]  64-byte region [ffff88810230b600, ffff88810230b640)
[   17.902405] 
[   17.902594] The buggy address belongs to the physical page:
[   17.903757] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10230b
[   17.906862] flags: 0x200000000000000(node=0|zone=2)
[   17.907791] page_type: f5(slab)
[   17.908738] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   17.909179] raw: 0000000000000000 0000000080200020 00000001f5000000 0000000000000000
[   17.910361] page dumped because: kasan: bad access detected
[   17.910858] 
[   17.911724] Memory state around the buggy address:
[   17.912660]  ffff88810230b500: 00 00 00 00 01 fc fc fc fc fc fc fc fc fc fc fc
[   17.913268]  ffff88810230b580: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   17.914157] >ffff88810230b600: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   17.915970]                    ^
[   17.916697]  ffff88810230b680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.917545]  ffff88810230b700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.918039] ==================================================================