Hay
Date
May 15, 2025, 10:38 a.m.

Environment
qemu-arm64
qemu-x86_64

[   18.110273] ==================================================================
[   18.110714] BUG: KASAN: out-of-bounds in kmalloc_memmove_negative_size+0x154/0x2e0
[   18.110822] Read of size 18446744073709551614 at addr fff00000c6879804 by task kunit_try_catch/180
[   18.111228] 
[   18.111417] CPU: 1 UID: 0 PID: 180 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250515 #1 PREEMPT 
[   18.111619] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.111809] Hardware name: linux,dummy-virt (DT)
[   18.111862] Call trace:
[   18.111886]  show_stack+0x20/0x38 (C)
[   18.111995]  dump_stack_lvl+0x8c/0xd0
[   18.112485]  print_report+0x118/0x608
[   18.113784]  kasan_report+0xdc/0x128
[   18.114042]  kasan_check_range+0x100/0x1a8
[   18.114294]  __asan_memmove+0x3c/0x98
[   18.114343]  kmalloc_memmove_negative_size+0x154/0x2e0
[   18.114399]  kunit_try_run_case+0x170/0x3f0
[   18.114676]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.115082]  kthread+0x328/0x630
[   18.115561]  ret_from_fork+0x10/0x20
[   18.115927] 
[   18.116190] Allocated by task 180:
[   18.116235]  kasan_save_stack+0x3c/0x68
[   18.116361]  kasan_save_track+0x20/0x40
[   18.116505]  kasan_save_alloc_info+0x40/0x58
[   18.116831]  __kasan_kmalloc+0xd4/0xd8
[   18.116959]  __kmalloc_cache_noprof+0x15c/0x3c0
[   18.117048]  kmalloc_memmove_negative_size+0xb0/0x2e0
[   18.117338]  kunit_try_run_case+0x170/0x3f0
[   18.117552]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.117617]  kthread+0x328/0x630
[   18.117820]  ret_from_fork+0x10/0x20
[   18.117868] 
[   18.118002] The buggy address belongs to the object at fff00000c6879800
[   18.118002]  which belongs to the cache kmalloc-64 of size 64
[   18.118546] The buggy address is located 4 bytes inside of
[   18.118546]  64-byte region [fff00000c6879800, fff00000c6879840)
[   18.118625] 
[   18.118864] The buggy address belongs to the physical page:
[   18.119037] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106879
[   18.119316] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.119416] page_type: f5(slab)
[   18.119590] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   18.119712] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   18.119756] page dumped because: kasan: bad access detected
[   18.119999] 
[   18.120068] Memory state around the buggy address:
[   18.120264]  fff00000c6879700: 00 00 00 00 01 fc fc fc fc fc fc fc fc fc fc fc
[   18.120415]  fff00000c6879780: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   18.120710] >fff00000c6879800: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   18.120816]                    ^
[   18.120885]  fff00000c6879880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.120930]  fff00000c6879900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.120979] ==================================================================


[   14.279087] ==================================================================
[   14.279653] BUG: KASAN: out-of-bounds in kmalloc_memmove_negative_size+0x171/0x330
[   14.280200] Read of size 18446744073709551614 at addr ffff88810230b084 by task kunit_try_catch/198
[   14.280546] 
[   14.280686] CPU: 1 UID: 0 PID: 198 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250515 #1 PREEMPT(voluntary) 
[   14.280774] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.280789] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.280810] Call Trace:
[   14.280825]  <TASK>
[   14.280845]  dump_stack_lvl+0x73/0xb0
[   14.280876]  print_report+0xd1/0x650
[   14.280902]  ? __virt_addr_valid+0x1db/0x2d0
[   14.280938]  ? kmalloc_memmove_negative_size+0x171/0x330
[   14.280969]  ? kasan_complete_mode_report_info+0x2a/0x200
[   14.280989]  ? kmalloc_memmove_negative_size+0x171/0x330
[   14.281037]  kasan_report+0x141/0x180
[   14.281059]  ? kmalloc_memmove_negative_size+0x171/0x330
[   14.281086]  kasan_check_range+0x10c/0x1c0
[   14.281107]  __asan_memmove+0x27/0x70
[   14.281126]  kmalloc_memmove_negative_size+0x171/0x330
[   14.281148]  ? __pfx_kmalloc_memmove_negative_size+0x10/0x10
[   14.281171]  ? __schedule+0x10cc/0x2b60
[   14.281192]  ? __pfx_read_tsc+0x10/0x10
[   14.281212]  ? ktime_get_ts64+0x86/0x230
[   14.281522]  kunit_try_run_case+0x1a5/0x480
[   14.281573]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.281609]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   14.281653]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.281695]  ? __kthread_parkme+0x82/0x180
[   14.281738]  ? preempt_count_sub+0x50/0x80
[   14.281787]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.281833]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.281878]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.281921]  kthread+0x337/0x6f0
[   14.281960]  ? trace_preempt_on+0x20/0xc0
[   14.282006]  ? __pfx_kthread+0x10/0x10
[   14.282046]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.282087]  ? calculate_sigpending+0x7b/0xa0
[   14.282120]  ? __pfx_kthread+0x10/0x10
[   14.282184]  ret_from_fork+0x116/0x1d0
[   14.282212]  ? __pfx_kthread+0x10/0x10
[   14.282245]  ret_from_fork_asm+0x1a/0x30
[   14.282277]  </TASK>
[   14.282289] 
[   14.292037] Allocated by task 198:
[   14.292443]  kasan_save_stack+0x45/0x70
[   14.292651]  kasan_save_track+0x18/0x40
[   14.292822]  kasan_save_alloc_info+0x3b/0x50
[   14.292997]  __kasan_kmalloc+0xb7/0xc0
[   14.293161]  __kmalloc_cache_noprof+0x189/0x420
[   14.293355]  kmalloc_memmove_negative_size+0xac/0x330
[   14.294037]  kunit_try_run_case+0x1a5/0x480
[   14.294405]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.295048]  kthread+0x337/0x6f0
[   14.295436]  ret_from_fork+0x116/0x1d0
[   14.295950]  ret_from_fork_asm+0x1a/0x30
[   14.296423] 
[   14.296777] The buggy address belongs to the object at ffff88810230b080
[   14.296777]  which belongs to the cache kmalloc-64 of size 64
[   14.297362] The buggy address is located 4 bytes inside of
[   14.297362]  64-byte region [ffff88810230b080, ffff88810230b0c0)
[   14.297991] 
[   14.298154] The buggy address belongs to the physical page:
[   14.298559] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10230b
[   14.299060] flags: 0x200000000000000(node=0|zone=2)
[   14.299519] page_type: f5(slab)
[   14.299887] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   14.300163] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   14.300417] page dumped because: kasan: bad access detected
[   14.300619] 
[   14.300720] Memory state around the buggy address:
[   14.301219]  ffff88810230af80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.301960]  ffff88810230b000: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   14.302589] >ffff88810230b080: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   14.302822]                    ^
[   14.303040]  ffff88810230b100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.303775]  ffff88810230b180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.304306] ==================================================================