Hay
Date
June 17, 2025, 6:35 a.m.

Environment
qemu-arm64
qemu-x86_64

[   16.940141] ==================================================================
[   16.940220] BUG: KASAN: out-of-bounds in kmalloc_memmove_negative_size+0x154/0x2e0
[   16.940285] Read of size 18446744073709551614 at addr fff00000c505c104 by task kunit_try_catch/189
[   16.940559] 
[   16.940773] CPU: 1 UID: 0 PID: 189 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250617 #1 PREEMPT 
[   16.940882] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.940910] Hardware name: linux,dummy-virt (DT)
[   16.941460] Call trace:
[   16.941505]  show_stack+0x20/0x38 (C)
[   16.941743]  dump_stack_lvl+0x8c/0xd0
[   16.941813]  print_report+0x118/0x608
[   16.941893]  kasan_report+0xdc/0x128
[   16.941955]  kasan_check_range+0x100/0x1a8
[   16.942022]  __asan_memmove+0x3c/0x98
[   16.942138]  kmalloc_memmove_negative_size+0x154/0x2e0
[   16.942345]  kunit_try_run_case+0x170/0x3f0
[   16.942584]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.942759]  kthread+0x328/0x630
[   16.942862]  ret_from_fork+0x10/0x20
[   16.943018] 
[   16.943086] Allocated by task 189:
[   16.943211]  kasan_save_stack+0x3c/0x68
[   16.943257]  kasan_save_track+0x20/0x40
[   16.943320]  kasan_save_alloc_info+0x40/0x58
[   16.943497]  __kasan_kmalloc+0xd4/0xd8
[   16.943734]  __kmalloc_cache_noprof+0x16c/0x3c0
[   16.943815]  kmalloc_memmove_negative_size+0xb0/0x2e0
[   16.943952]  kunit_try_run_case+0x170/0x3f0
[   16.944011]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.944237]  kthread+0x328/0x630
[   16.944517]  ret_from_fork+0x10/0x20
[   16.945285] 
[   16.945342] The buggy address belongs to the object at fff00000c505c100
[   16.945342]  which belongs to the cache kmalloc-64 of size 64
[   16.945417] The buggy address is located 4 bytes inside of
[   16.945417]  64-byte region [fff00000c505c100, fff00000c505c140)
[   16.945498] 
[   16.945520] The buggy address belongs to the physical page:
[   16.945605] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10505c
[   16.946154] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   16.946250] page_type: f5(slab)
[   16.946311] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   16.946364] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   16.946904] page dumped because: kasan: bad access detected
[   16.947602] 
[   16.947652] Memory state around the buggy address:
[   16.947699]  fff00000c505c000: 00 00 00 00 01 fc fc fc fc fc fc fc fc fc fc fc
[   16.947778]  fff00000c505c080: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   16.947847] >fff00000c505c100: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   16.948196]                    ^
[   16.948379]  fff00000c505c180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.948488]  fff00000c505c200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.948556] ==================================================================

[   18.213158] ==================================================================
[   18.214622] BUG: KASAN: out-of-bounds in kmalloc_memmove_negative_size+0x171/0x330
[   18.215390] Read of size 18446744073709551614 at addr ffff888102aa7504 by task kunit_try_catch/207
[   18.216149] 
[   18.216739] CPU: 1 UID: 0 PID: 207 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250617 #1 PREEMPT(voluntary) 
[   18.216884] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.216921] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   18.216976] Call Trace:
[   18.217012]  <TASK>
[   18.217057]  dump_stack_lvl+0x73/0xb0
[   18.217143]  print_report+0xd1/0x650
[   18.217227]  ? __virt_addr_valid+0x1db/0x2d0
[   18.217303]  ? kmalloc_memmove_negative_size+0x171/0x330
[   18.217382]  ? kasan_complete_mode_report_info+0x2a/0x200
[   18.217455]  ? kmalloc_memmove_negative_size+0x171/0x330
[   18.217562]  kasan_report+0x141/0x180
[   18.217642]  ? kmalloc_memmove_negative_size+0x171/0x330
[   18.217688]  kasan_check_range+0x10c/0x1c0
[   18.217722]  __asan_memmove+0x27/0x70
[   18.217749]  kmalloc_memmove_negative_size+0x171/0x330
[   18.217783]  ? __pfx_kmalloc_memmove_negative_size+0x10/0x10
[   18.217818]  ? __schedule+0x10cc/0x2b60
[   18.217875]  ? __pfx_read_tsc+0x10/0x10
[   18.217909]  ? ktime_get_ts64+0x86/0x230
[   18.217943]  kunit_try_run_case+0x1a5/0x480
[   18.217977]  ? __pfx_kunit_try_run_case+0x10/0x10
[   18.218009]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   18.218038]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   18.218074]  ? __kthread_parkme+0x82/0x180
[   18.218101]  ? preempt_count_sub+0x50/0x80
[   18.218133]  ? __pfx_kunit_try_run_case+0x10/0x10
[   18.218164]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   18.218195]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   18.218240]  kthread+0x337/0x6f0
[   18.218308]  ? trace_preempt_on+0x20/0xc0
[   18.218372]  ? __pfx_kthread+0x10/0x10
[   18.218404]  ? _raw_spin_unlock_irq+0x47/0x80
[   18.218439]  ? calculate_sigpending+0x7b/0xa0
[   18.218474]  ? __pfx_kthread+0x10/0x10
[   18.218529]  ret_from_fork+0x116/0x1d0
[   18.218585]  ? __pfx_kthread+0x10/0x10
[   18.218638]  ret_from_fork_asm+0x1a/0x30
[   18.218713]  </TASK>
[   18.218747] 
[   18.235891] Allocated by task 207:
[   18.236417]  kasan_save_stack+0x45/0x70
[   18.236856]  kasan_save_track+0x18/0x40
[   18.237666]  kasan_save_alloc_info+0x3b/0x50
[   18.238124]  __kasan_kmalloc+0xb7/0xc0
[   18.238510]  __kmalloc_cache_noprof+0x189/0x420
[   18.239187]  kmalloc_memmove_negative_size+0xac/0x330
[   18.239857]  kunit_try_run_case+0x1a5/0x480
[   18.240501]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   18.241054]  kthread+0x337/0x6f0
[   18.241648]  ret_from_fork+0x116/0x1d0
[   18.242028]  ret_from_fork_asm+0x1a/0x30
[   18.243109] 
[   18.243452] The buggy address belongs to the object at ffff888102aa7500
[   18.243452]  which belongs to the cache kmalloc-64 of size 64
[   18.244698] The buggy address is located 4 bytes inside of
[   18.244698]  64-byte region [ffff888102aa7500, ffff888102aa7540)
[   18.245751] 
[   18.246047] The buggy address belongs to the physical page:
[   18.246694] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102aa7
[   18.247611] flags: 0x200000000000000(node=0|zone=2)
[   18.248026] page_type: f5(slab)
[   18.249118] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   18.249746] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   18.250296] page dumped because: kasan: bad access detected
[   18.250764] 
[   18.251430] Memory state around the buggy address:
[   18.251860]  ffff888102aa7400: 00 00 00 00 05 fc fc fc fc fc fc fc fc fc fc fc
[   18.252605]  ffff888102aa7480: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   18.253979] >ffff888102aa7500: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   18.254710]                    ^
[   18.255052]  ffff888102aa7580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.255894]  ffff888102aa7600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.256781] ==================================================================