Hay
Date
July 6, 2025, 11:09 a.m.

Environment
qemu-arm64
qemu-x86_64

[   18.136674] ==================================================================
[   18.136738] BUG: KASAN: out-of-bounds in kmalloc_memmove_negative_size+0x154/0x2e0
[   18.137181] Read of size 18446744073709551614 at addr fff00000c641e984 by task kunit_try_catch/180
[   18.137447] 
[   18.137566] CPU: 1 UID: 0 PID: 180 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   18.137935] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.137995] Hardware name: linux,dummy-virt (DT)
[   18.138106] Call trace:
[   18.138168]  show_stack+0x20/0x38 (C)
[   18.138349]  dump_stack_lvl+0x8c/0xd0
[   18.138409]  print_report+0x118/0x608
[   18.138560]  kasan_report+0xdc/0x128
[   18.138666]  kasan_check_range+0x100/0x1a8
[   18.139014]  __asan_memmove+0x3c/0x98
[   18.139129]  kmalloc_memmove_negative_size+0x154/0x2e0
[   18.139534]  kunit_try_run_case+0x170/0x3f0
[   18.139679]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.139786]  kthread+0x328/0x630
[   18.139938]  ret_from_fork+0x10/0x20
[   18.141009] 
[   18.141033] Allocated by task 180:
[   18.141483]  kasan_save_stack+0x3c/0x68
[   18.141632]  kasan_save_track+0x20/0x40
[   18.141753]  kasan_save_alloc_info+0x40/0x58
[   18.141958]  __kasan_kmalloc+0xd4/0xd8
[   18.142005]  __kmalloc_cache_noprof+0x16c/0x3c0
[   18.143117]  kmalloc_memmove_negative_size+0xb0/0x2e0
[   18.143226]  kunit_try_run_case+0x170/0x3f0
[   18.143320]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.143395]  kthread+0x328/0x630
[   18.143529]  ret_from_fork+0x10/0x20
[   18.143568] 
[   18.143870] The buggy address belongs to the object at fff00000c641e980
[   18.143870]  which belongs to the cache kmalloc-64 of size 64
[   18.144109] The buggy address is located 4 bytes inside of
[   18.144109]  64-byte region [fff00000c641e980, fff00000c641e9c0)
[   18.144827] 
[   18.144904] The buggy address belongs to the physical page:
[   18.145044] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10641e
[   18.145131] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.145641] page_type: f5(slab)
[   18.145866] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   18.146067] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   18.146246] page dumped because: kasan: bad access detected
[   18.146351] 
[   18.146485] Memory state around the buggy address:
[   18.146590]  fff00000c641e880: 00 00 00 00 01 fc fc fc fc fc fc fc fc fc fc fc
[   18.146634]  fff00000c641e900: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   18.146676] >fff00000c641e980: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   18.146713]                    ^
[   18.146742]  fff00000c641ea00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.147109]  fff00000c641ea80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.147260] ==================================================================

[   11.783431] ==================================================================
[   11.784979] BUG: KASAN: out-of-bounds in kmalloc_memmove_negative_size+0x171/0x330
[   11.786218] Read of size 18446744073709551614 at addr ffff888102b17f04 by task kunit_try_catch/197
[   11.786589] 
[   11.786716] CPU: 0 UID: 0 PID: 197 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   11.786764] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.786776] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.786799] Call Trace:
[   11.786813]  <TASK>
[   11.786876]  dump_stack_lvl+0x73/0xb0
[   11.786911]  print_report+0xd1/0x650
[   11.786947]  ? __virt_addr_valid+0x1db/0x2d0
[   11.786971]  ? kmalloc_memmove_negative_size+0x171/0x330
[   11.786995]  ? kasan_complete_mode_report_info+0x2a/0x200
[   11.787017]  ? kmalloc_memmove_negative_size+0x171/0x330
[   11.787059]  kasan_report+0x141/0x180
[   11.787081]  ? kmalloc_memmove_negative_size+0x171/0x330
[   11.787115]  kasan_check_range+0x10c/0x1c0
[   11.787138]  __asan_memmove+0x27/0x70
[   11.787157]  kmalloc_memmove_negative_size+0x171/0x330
[   11.787182]  ? __pfx_kmalloc_memmove_negative_size+0x10/0x10
[   11.787207]  ? __schedule+0x10cc/0x2b60
[   11.787229]  ? __pfx_read_tsc+0x10/0x10
[   11.787250]  ? ktime_get_ts64+0x86/0x230
[   11.787276]  kunit_try_run_case+0x1a5/0x480
[   11.787301]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.787323]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.787347]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.787369]  ? __kthread_parkme+0x82/0x180
[   11.787390]  ? preempt_count_sub+0x50/0x80
[   11.787414]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.787437]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.787459]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.787482]  kthread+0x337/0x6f0
[   11.787501]  ? trace_preempt_on+0x20/0xc0
[   11.787524]  ? __pfx_kthread+0x10/0x10
[   11.787544]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.787564]  ? calculate_sigpending+0x7b/0xa0
[   11.787590]  ? __pfx_kthread+0x10/0x10
[   11.787610]  ret_from_fork+0x116/0x1d0
[   11.787629]  ? __pfx_kthread+0x10/0x10
[   11.787649]  ret_from_fork_asm+0x1a/0x30
[   11.787679]  </TASK>
[   11.787691] 
[   11.795735] Allocated by task 197:
[   11.795920]  kasan_save_stack+0x45/0x70
[   11.796216]  kasan_save_track+0x18/0x40
[   11.796369]  kasan_save_alloc_info+0x3b/0x50
[   11.796546]  __kasan_kmalloc+0xb7/0xc0
[   11.796896]  __kmalloc_cache_noprof+0x189/0x420
[   11.797083]  kmalloc_memmove_negative_size+0xac/0x330
[   11.797252]  kunit_try_run_case+0x1a5/0x480
[   11.797454]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.797706]  kthread+0x337/0x6f0
[   11.797873]  ret_from_fork+0x116/0x1d0
[   11.798050]  ret_from_fork_asm+0x1a/0x30
[   11.798223] 
[   11.798297] The buggy address belongs to the object at ffff888102b17f00
[   11.798297]  which belongs to the cache kmalloc-64 of size 64
[   11.798719] The buggy address is located 4 bytes inside of
[   11.798719]  64-byte region [ffff888102b17f00, ffff888102b17f40)
[   11.799625] 
[   11.799717] The buggy address belongs to the physical page:
[   11.799987] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102b17
[   11.800286] flags: 0x200000000000000(node=0|zone=2)
[   11.800452] page_type: f5(slab)
[   11.800592] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   11.800947] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   11.801312] page dumped because: kasan: bad access detected
[   11.801583] 
[   11.801731] Memory state around the buggy address:
[   11.801938]  ffff888102b17e00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.802226]  ffff888102b17e80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.802459] >ffff888102b17f00: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   11.802775]                    ^
[   11.802950]  ffff888102b17f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.803313]  ffff888102b18000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   11.803562] ==================================================================