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

Environment
qemu-arm64
qemu-x86_64

[   19.073967] ==================================================================
[   19.074123] BUG: KASAN: out-of-bounds in kmalloc_memmove_negative_size+0x154/0x2e0
[   19.074235] Read of size 18446744073709551614 at addr fff00000c78aa204 by task kunit_try_catch/181
[   19.074748] 
[   19.075011] CPU: 0 UID: 0 PID: 181 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   19.075289] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.075397] Hardware name: linux,dummy-virt (DT)
[   19.075472] Call trace:
[   19.075519]  show_stack+0x20/0x38 (C)
[   19.075636]  dump_stack_lvl+0x8c/0xd0
[   19.075743]  print_report+0x118/0x608
[   19.075832]  kasan_report+0xdc/0x128
[   19.075914]  kasan_check_range+0x100/0x1a8
[   19.076008]  __asan_memmove+0x3c/0x98
[   19.076090]  kmalloc_memmove_negative_size+0x154/0x2e0
[   19.076187]  kunit_try_run_case+0x170/0x3f0
[   19.076281]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.076415]  kthread+0x328/0x630
[   19.076514]  ret_from_fork+0x10/0x20
[   19.076656] 
[   19.076694] Allocated by task 181:
[   19.076753]  kasan_save_stack+0x3c/0x68
[   19.076868]  kasan_save_track+0x20/0x40
[   19.076949]  kasan_save_alloc_info+0x40/0x58
[   19.077045]  __kasan_kmalloc+0xd4/0xd8
[   19.077220]  __kmalloc_cache_noprof+0x16c/0x3c0
[   19.077334]  kmalloc_memmove_negative_size+0xb0/0x2e0
[   19.077493]  kunit_try_run_case+0x170/0x3f0
[   19.077580]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.077666]  kthread+0x328/0x630
[   19.077742]  ret_from_fork+0x10/0x20
[   19.077823] 
[   19.077867] The buggy address belongs to the object at fff00000c78aa200
[   19.077867]  which belongs to the cache kmalloc-64 of size 64
[   19.077991] The buggy address is located 4 bytes inside of
[   19.077991]  64-byte region [fff00000c78aa200, fff00000c78aa240)
[   19.078118] 
[   19.078177] The buggy address belongs to the physical page:
[   19.078269] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1078aa
[   19.078394] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.078507] page_type: f5(slab)
[   19.078594] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   19.078708] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   19.079278] page dumped because: kasan: bad access detected
[   19.079365] 
[   19.079409] Memory state around the buggy address:
[   19.079470]  fff00000c78aa100: 00 00 00 00 01 fc fc fc fc fc fc fc fc fc fc fc
[   19.079569]  fff00000c78aa180: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   19.080474] >fff00000c78aa200: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   19.080656]                    ^
[   19.080931]  fff00000c78aa280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.081064]  fff00000c78aa300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.081242] ==================================================================

[   13.815418] ==================================================================
[   13.816018] BUG: KASAN: out-of-bounds in kmalloc_memmove_negative_size+0x171/0x330
[   13.816443] Read of size 18446744073709551614 at addr ffff8881038d5504 by task kunit_try_catch/197
[   13.816862] 
[   13.817006] CPU: 0 UID: 0 PID: 197 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   13.817063] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.817078] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.817104] Call Trace:
[   13.817119]  <TASK>
[   13.817141]  dump_stack_lvl+0x73/0xb0
[   13.817175]  print_report+0xd1/0x650
[   13.817201]  ? __virt_addr_valid+0x1db/0x2d0
[   13.817229]  ? kmalloc_memmove_negative_size+0x171/0x330
[   13.817258]  ? kasan_complete_mode_report_info+0x2a/0x200
[   13.817283]  ? kmalloc_memmove_negative_size+0x171/0x330
[   13.817906]  kasan_report+0x141/0x180
[   13.817943]  ? kmalloc_memmove_negative_size+0x171/0x330
[   13.817979]  kasan_check_range+0x10c/0x1c0
[   13.818007]  __asan_memmove+0x27/0x70
[   13.818030]  kmalloc_memmove_negative_size+0x171/0x330
[   13.818058]  ? __pfx_kmalloc_memmove_negative_size+0x10/0x10
[   13.818088]  ? __schedule+0x10cc/0x2b60
[   13.818116]  ? __pfx_read_tsc+0x10/0x10
[   13.818143]  ? ktime_get_ts64+0x86/0x230
[   13.818172]  kunit_try_run_case+0x1a5/0x480
[   13.818203]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.818228]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.818256]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.818283]  ? __kthread_parkme+0x82/0x180
[   13.818307]  ? preempt_count_sub+0x50/0x80
[   13.818334]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.818361]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.818387]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.818413]  kthread+0x337/0x6f0
[   13.818444]  ? trace_preempt_on+0x20/0xc0
[   13.818472]  ? __pfx_kthread+0x10/0x10
[   13.818496]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.818520]  ? calculate_sigpending+0x7b/0xa0
[   13.818548]  ? __pfx_kthread+0x10/0x10
[   13.818573]  ret_from_fork+0x116/0x1d0
[   13.818594]  ? __pfx_kthread+0x10/0x10
[   13.818618]  ret_from_fork_asm+0x1a/0x30
[   13.818671]  </TASK>
[   13.818685] 
[   13.830832] Allocated by task 197:
[   13.831075]  kasan_save_stack+0x45/0x70
[   13.831333]  kasan_save_track+0x18/0x40
[   13.831544]  kasan_save_alloc_info+0x3b/0x50
[   13.832364]  __kasan_kmalloc+0xb7/0xc0
[   13.832605]  __kmalloc_cache_noprof+0x189/0x420
[   13.833172]  kmalloc_memmove_negative_size+0xac/0x330
[   13.833451]  kunit_try_run_case+0x1a5/0x480
[   13.833989]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.834243]  kthread+0x337/0x6f0
[   13.834461]  ret_from_fork+0x116/0x1d0
[   13.834698]  ret_from_fork_asm+0x1a/0x30
[   13.835188] 
[   13.835318] The buggy address belongs to the object at ffff8881038d5500
[   13.835318]  which belongs to the cache kmalloc-64 of size 64
[   13.835921] The buggy address is located 4 bytes inside of
[   13.835921]  64-byte region [ffff8881038d5500, ffff8881038d5540)
[   13.836426] 
[   13.836549] The buggy address belongs to the physical page:
[   13.836936] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1038d5
[   13.837316] flags: 0x200000000000000(node=0|zone=2)
[   13.837570] page_type: f5(slab)
[   13.837908] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   13.838284] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   13.838735] page dumped because: kasan: bad access detected
[   13.839280] 
[   13.839408] Memory state around the buggy address:
[   13.839641]  ffff8881038d5400: 00 00 00 00 01 fc fc fc fc fc fc fc fc fc fc fc
[   13.840132]  ffff8881038d5480: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   13.840700] >ffff8881038d5500: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   13.841187]                    ^
[   13.841395]  ffff8881038d5580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.841908]  ffff8881038d5600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.842217] ==================================================================