Hay
Date
July 24, 2025, 4:41 a.m.

Environment
qemu-arm64
qemu-x86_64

[   32.525440] ==================================================================
[   32.525861] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_2+0x150/0x2f8
[   32.526016] Write of size 2 at addr fff00000c9a8b177 by task kunit_try_catch/203
[   32.526126] 
[   32.526185] CPU: 0 UID: 0 PID: 203 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7-next-20250724 #1 PREEMPT 
[   32.526427] Tainted: [B]=BAD_PAGE, [N]=TEST
[   32.526462] Hardware name: linux,dummy-virt (DT)
[   32.526558] Call trace:
[   32.526718]  show_stack+0x20/0x38 (C)
[   32.526805]  dump_stack_lvl+0x8c/0xd0
[   32.526854]  print_report+0x118/0x5e8
[   32.526897]  kasan_report+0xdc/0x128
[   32.527338]  kasan_check_range+0x100/0x1a8
[   32.527461]  __asan_memset+0x34/0x78
[   32.527618]  kmalloc_oob_memset_2+0x150/0x2f8
[   32.527673]  kunit_try_run_case+0x170/0x3f0
[   32.527721]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.527791]  kthread+0x328/0x630
[   32.528068]  ret_from_fork+0x10/0x20
[   32.528276] 
[   32.528363] Allocated by task 203:
[   32.528412]  kasan_save_stack+0x3c/0x68
[   32.528473]  kasan_save_track+0x20/0x40
[   32.528660]  kasan_save_alloc_info+0x40/0x58
[   32.528806]  __kasan_kmalloc+0xd4/0xd8
[   32.528855]  __kmalloc_cache_noprof+0x16c/0x3c0
[   32.528895]  kmalloc_oob_memset_2+0xb0/0x2f8
[   32.528987]  kunit_try_run_case+0x170/0x3f0
[   32.529203]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.529435]  kthread+0x328/0x630
[   32.529618]  ret_from_fork+0x10/0x20
[   32.529788] 
[   32.529858] The buggy address belongs to the object at fff00000c9a8b100
[   32.529858]  which belongs to the cache kmalloc-128 of size 128
[   32.529937] The buggy address is located 119 bytes inside of
[   32.529937]  allocated 120-byte region [fff00000c9a8b100, fff00000c9a8b178)
[   32.530202] 
[   32.530230] The buggy address belongs to the physical page:
[   32.530270] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109a8b
[   32.530347] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   32.530449] page_type: f5(slab)
[   32.530667] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   32.530767] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   32.530859] page dumped because: kasan: bad access detected
[   32.530890] 
[   32.530912] Memory state around the buggy address:
[   32.530952]  fff00000c9a8b000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   32.531308]  fff00000c9a8b080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   32.531420] >fff00000c9a8b100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   32.531576]                                                                 ^
[   32.531651]  fff00000c9a8b180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   32.531718]  fff00000c9a8b200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   32.531765] ==================================================================

[   26.938961] ==================================================================
[   26.939667] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_2+0x166/0x330
[   26.940378] Write of size 2 at addr ffff888105454777 by task kunit_try_catch/220
[   26.940695] 
[   26.940804] CPU: 0 UID: 0 PID: 220 Comm: kunit_try_catch Tainted: G    B   W        N  6.16.0-rc7-next-20250724 #1 PREEMPT(voluntary) 
[   26.940858] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   26.940872] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   26.940894] Call Trace:
[   26.940907]  <TASK>
[   26.941327]  dump_stack_lvl+0x73/0xb0
[   26.941370]  print_report+0xd1/0x640
[   26.941410]  ? __virt_addr_valid+0x1db/0x2d0
[   26.941436]  ? kmalloc_oob_memset_2+0x166/0x330
[   26.941674]  ? kasan_complete_mode_report_info+0x2a/0x200
[   26.941708]  ? kmalloc_oob_memset_2+0x166/0x330
[   26.941847]  kasan_report+0x141/0x180
[   26.941886]  ? kmalloc_oob_memset_2+0x166/0x330
[   26.941926]  kasan_check_range+0x10c/0x1c0
[   26.942034]  __asan_memset+0x27/0x50
[   26.942074]  kmalloc_oob_memset_2+0x166/0x330
[   26.942097]  ? __pfx_kmalloc_oob_memset_2+0x10/0x10
[   26.942119]  ? __schedule+0x10da/0x2b60
[   26.942145]  ? __pfx_read_tsc+0x10/0x10
[   26.942167]  ? ktime_get_ts64+0x86/0x230
[   26.942191]  kunit_try_run_case+0x1a5/0x480
[   26.942218]  ? __pfx_kunit_try_run_case+0x10/0x10
[   26.942239]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   26.942264]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   26.942289]  ? __kthread_parkme+0x82/0x180
[   26.942309]  ? preempt_count_sub+0x50/0x80
[   26.942333]  ? __pfx_kunit_try_run_case+0x10/0x10
[   26.942356]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.942378]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   26.942401]  kthread+0x337/0x6f0
[   26.942421]  ? trace_preempt_on+0x20/0xc0
[   26.942445]  ? __pfx_kthread+0x10/0x10
[   26.942465]  ? _raw_spin_unlock_irq+0x47/0x80
[   26.942488]  ? calculate_sigpending+0x7b/0xa0
[   26.942511]  ? __pfx_kthread+0x10/0x10
[   26.942532]  ret_from_fork+0x116/0x1d0
[   26.942550]  ? __pfx_kthread+0x10/0x10
[   26.942570]  ret_from_fork_asm+0x1a/0x30
[   26.942611]  </TASK>
[   26.942622] 
[   26.950399] Allocated by task 220:
[   26.950563]  kasan_save_stack+0x45/0x70
[   26.950781]  kasan_save_track+0x18/0x40
[   26.951022]  kasan_save_alloc_info+0x3b/0x50
[   26.951226]  __kasan_kmalloc+0xb7/0xc0
[   26.951418]  __kmalloc_cache_noprof+0x189/0x420
[   26.951619]  kmalloc_oob_memset_2+0xac/0x330
[   26.951760]  kunit_try_run_case+0x1a5/0x480
[   26.951898]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.952105]  kthread+0x337/0x6f0
[   26.952277]  ret_from_fork+0x116/0x1d0
[   26.952455]  ret_from_fork_asm+0x1a/0x30
[   26.952655] 
[   26.952742] The buggy address belongs to the object at ffff888105454700
[   26.952742]  which belongs to the cache kmalloc-128 of size 128
[   26.953298] The buggy address is located 119 bytes inside of
[   26.953298]  allocated 120-byte region [ffff888105454700, ffff888105454778)
[   26.953854] 
[   26.953947] The buggy address belongs to the physical page:
[   26.954346] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105454
[   26.954680] flags: 0x200000000000000(node=0|zone=2)
[   26.955103] page_type: f5(slab)
[   26.955275] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   26.955640] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   26.956020] page dumped because: kasan: bad access detected
[   26.956317] 
[   26.956419] Memory state around the buggy address:
[   26.956602]  ffff888105454600: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   26.956924]  ffff888105454680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.957263] >ffff888105454700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   26.957549]                                                                 ^
[   26.957906]  ffff888105454780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.958200]  ffff888105454800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.958651] ==================================================================