Hay
Date
July 19, 2025, 11:11 a.m.

Environment
qemu-arm64
qemu-x86_64

[   15.308504] ==================================================================
[   15.308599] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_in_memset+0x144/0x2d0
[   15.308929] Write of size 128 at addr fff00000c5f9db00 by task kunit_try_catch/171
[   15.308986] 
[   15.309021] CPU: 1 UID: 0 PID: 171 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   15.309100] Tainted: [B]=BAD_PAGE, [N]=TEST
[   15.309127] Hardware name: linux,dummy-virt (DT)
[   15.309606] Call trace:
[   15.309674]  show_stack+0x20/0x38 (C)
[   15.310169]  dump_stack_lvl+0x8c/0xd0
[   15.310298]  print_report+0x118/0x5d0
[   15.310392]  kasan_report+0xdc/0x128
[   15.310445]  kasan_check_range+0x100/0x1a8
[   15.310777]  __asan_memset+0x34/0x78
[   15.310873]  kmalloc_oob_in_memset+0x144/0x2d0
[   15.311144]  kunit_try_run_case+0x170/0x3f0
[   15.311427]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.311523]  kthread+0x328/0x630
[   15.311742]  ret_from_fork+0x10/0x20
[   15.311941] 
[   15.311986] Allocated by task 171:
[   15.312081]  kasan_save_stack+0x3c/0x68
[   15.312180]  kasan_save_track+0x20/0x40
[   15.312218]  kasan_save_alloc_info+0x40/0x58
[   15.312563]  __kasan_kmalloc+0xd4/0xd8
[   15.312631]  __kmalloc_cache_noprof+0x16c/0x3c0
[   15.312733]  kmalloc_oob_in_memset+0xb0/0x2d0
[   15.312772]  kunit_try_run_case+0x170/0x3f0
[   15.312838]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.313184]  kthread+0x328/0x630
[   15.313255]  ret_from_fork+0x10/0x20
[   15.313351] 
[   15.313373] The buggy address belongs to the object at fff00000c5f9db00
[   15.313373]  which belongs to the cache kmalloc-128 of size 128
[   15.313842] The buggy address is located 0 bytes inside of
[   15.313842]  allocated 120-byte region [fff00000c5f9db00, fff00000c5f9db78)
[   15.314034] 
[   15.314057] The buggy address belongs to the physical page:
[   15.314088] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105f9d
[   15.314163] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   15.314569] page_type: f5(slab)
[   15.314679] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   15.314741] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   15.315110] page dumped because: kasan: bad access detected
[   15.315174] 
[   15.315262] Memory state around the buggy address:
[   15.315333]  fff00000c5f9da00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   15.315755]  fff00000c5f9da80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.315897] >fff00000c5f9db00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   15.316034]                                                                 ^
[   15.316102]  fff00000c5f9db80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.316326]  fff00000c5f9dc00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.316496] ==================================================================

[   12.147760] ==================================================================
[   12.148433] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_in_memset+0x15f/0x320
[   12.148746] Write of size 128 at addr ffff8881027e4100 by task kunit_try_catch/188
[   12.149046] 
[   12.149408] CPU: 0 UID: 0 PID: 188 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   12.149457] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.149468] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.149489] Call Trace:
[   12.149513]  <TASK>
[   12.149529]  dump_stack_lvl+0x73/0xb0
[   12.149559]  print_report+0xd1/0x610
[   12.149580]  ? __virt_addr_valid+0x1db/0x2d0
[   12.149602]  ? kmalloc_oob_in_memset+0x15f/0x320
[   12.149623]  ? kasan_complete_mode_report_info+0x2a/0x200
[   12.149645]  ? kmalloc_oob_in_memset+0x15f/0x320
[   12.149666]  kasan_report+0x141/0x180
[   12.149687]  ? kmalloc_oob_in_memset+0x15f/0x320
[   12.149713]  kasan_check_range+0x10c/0x1c0
[   12.149735]  __asan_memset+0x27/0x50
[   12.149753]  kmalloc_oob_in_memset+0x15f/0x320
[   12.149775]  ? __pfx_kmalloc_oob_in_memset+0x10/0x10
[   12.149797]  ? __schedule+0x10cc/0x2b60
[   12.149819]  ? __pfx_read_tsc+0x10/0x10
[   12.149839]  ? ktime_get_ts64+0x86/0x230
[   12.149862]  kunit_try_run_case+0x1a5/0x480
[   12.149887]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.149909]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.149932]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.149955]  ? __kthread_parkme+0x82/0x180
[   12.149974]  ? preempt_count_sub+0x50/0x80
[   12.149997]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.150020]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.150043]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.150066]  kthread+0x337/0x6f0
[   12.150092]  ? trace_preempt_on+0x20/0xc0
[   12.150115]  ? __pfx_kthread+0x10/0x10
[   12.150135]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.150155]  ? calculate_sigpending+0x7b/0xa0
[   12.150179]  ? __pfx_kthread+0x10/0x10
[   12.150205]  ret_from_fork+0x116/0x1d0
[   12.150223]  ? __pfx_kthread+0x10/0x10
[   12.150242]  ret_from_fork_asm+0x1a/0x30
[   12.150271]  </TASK>
[   12.150281] 
[   12.157607] Allocated by task 188:
[   12.157792]  kasan_save_stack+0x45/0x70
[   12.158028]  kasan_save_track+0x18/0x40
[   12.158165]  kasan_save_alloc_info+0x3b/0x50
[   12.158319]  __kasan_kmalloc+0xb7/0xc0
[   12.158449]  __kmalloc_cache_noprof+0x189/0x420
[   12.158683]  kmalloc_oob_in_memset+0xac/0x320
[   12.158891]  kunit_try_run_case+0x1a5/0x480
[   12.159090]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.159486]  kthread+0x337/0x6f0
[   12.159642]  ret_from_fork+0x116/0x1d0
[   12.159824]  ret_from_fork_asm+0x1a/0x30
[   12.159987] 
[   12.160257] The buggy address belongs to the object at ffff8881027e4100
[   12.160257]  which belongs to the cache kmalloc-128 of size 128
[   12.160688] The buggy address is located 0 bytes inside of
[   12.160688]  allocated 120-byte region [ffff8881027e4100, ffff8881027e4178)
[   12.161431] 
[   12.161542] The buggy address belongs to the physical page:
[   12.161763] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1027e4
[   12.162020] flags: 0x200000000000000(node=0|zone=2)
[   12.162345] page_type: f5(slab)
[   12.162480] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   12.162725] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   12.163050] page dumped because: kasan: bad access detected
[   12.163334] 
[   12.163402] Memory state around the buggy address:
[   12.163682]  ffff8881027e4000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   12.163998]  ffff8881027e4080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.164296] >ffff8881027e4100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   12.164779]                                                                 ^
[   12.165041]  ffff8881027e4180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.165447]  ffff8881027e4200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.165693] ==================================================================