Hay
Date
July 20, 2025, 11:12 a.m.

Environment
qemu-arm64
qemu-x86_64

[   15.359685] ==================================================================
[   15.359831] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_2+0x150/0x2f8
[   15.359937] Write of size 2 at addr fff00000c3fc2b77 by task kunit_try_catch/172
[   15.359988] 
[   15.360018] CPU: 0 UID: 0 PID: 172 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   15.360096] Tainted: [B]=BAD_PAGE, [N]=TEST
[   15.360122] Hardware name: linux,dummy-virt (DT)
[   15.360151] Call trace:
[   15.360200]  show_stack+0x20/0x38 (C)
[   15.360247]  dump_stack_lvl+0x8c/0xd0
[   15.360290]  print_report+0x118/0x5d0
[   15.360335]  kasan_report+0xdc/0x128
[   15.360383]  kasan_check_range+0x100/0x1a8
[   15.360467]  __asan_memset+0x34/0x78
[   15.360525]  kmalloc_oob_memset_2+0x150/0x2f8
[   15.360571]  kunit_try_run_case+0x170/0x3f0
[   15.360617]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.360677]  kthread+0x328/0x630
[   15.360716]  ret_from_fork+0x10/0x20
[   15.360761] 
[   15.360828] Allocated by task 172:
[   15.360857]  kasan_save_stack+0x3c/0x68
[   15.360897]  kasan_save_track+0x20/0x40
[   15.360933]  kasan_save_alloc_info+0x40/0x58
[   15.360972]  __kasan_kmalloc+0xd4/0xd8
[   15.361087]  __kmalloc_cache_noprof+0x16c/0x3c0
[   15.361135]  kmalloc_oob_memset_2+0xb0/0x2f8
[   15.361171]  kunit_try_run_case+0x170/0x3f0
[   15.361207]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.361249]  kthread+0x328/0x630
[   15.361280]  ret_from_fork+0x10/0x20
[   15.361330] 
[   15.361378] The buggy address belongs to the object at fff00000c3fc2b00
[   15.361378]  which belongs to the cache kmalloc-128 of size 128
[   15.361459] The buggy address is located 119 bytes inside of
[   15.361459]  allocated 120-byte region [fff00000c3fc2b00, fff00000c3fc2b78)
[   15.361520] 
[   15.361539] The buggy address belongs to the physical page:
[   15.361832] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103fc2
[   15.361917] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   15.362004] page_type: f5(slab)
[   15.362045] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   15.362116] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   15.362155] page dumped because: kasan: bad access detected
[   15.362185] 
[   15.362202] Memory state around the buggy address:
[   15.362233]  fff00000c3fc2a00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   15.362273]  fff00000c3fc2a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.362313] >fff00000c3fc2b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   15.362349]                                                                 ^
[   15.362387]  fff00000c3fc2b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.362426]  fff00000c3fc2c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.362462] ==================================================================

[   12.358873] ==================================================================
[   12.359324] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_2+0x166/0x330
[   12.359571] Write of size 2 at addr ffff88810272b777 by task kunit_try_catch/189
[   12.359796] 
[   12.359880] CPU: 1 UID: 0 PID: 189 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   12.359932] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.359943] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.359962] Call Trace:
[   12.359973]  <TASK>
[   12.359986]  dump_stack_lvl+0x73/0xb0
[   12.360012]  print_report+0xd1/0x610
[   12.360033]  ? __virt_addr_valid+0x1db/0x2d0
[   12.360053]  ? kmalloc_oob_memset_2+0x166/0x330
[   12.360073]  ? kasan_complete_mode_report_info+0x2a/0x200
[   12.360093]  ? kmalloc_oob_memset_2+0x166/0x330
[   12.360114]  kasan_report+0x141/0x180
[   12.360134]  ? kmalloc_oob_memset_2+0x166/0x330
[   12.360158]  kasan_check_range+0x10c/0x1c0
[   12.360180]  __asan_memset+0x27/0x50
[   12.360197]  kmalloc_oob_memset_2+0x166/0x330
[   12.360218]  ? __pfx_kmalloc_oob_memset_2+0x10/0x10
[   12.360239]  ? __schedule+0x10cc/0x2b60
[   12.360259]  ? __pfx_read_tsc+0x10/0x10
[   12.360278]  ? ktime_get_ts64+0x86/0x230
[   12.360301]  kunit_try_run_case+0x1a5/0x480
[   12.360323]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.360344]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.360365]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.360387]  ? __kthread_parkme+0x82/0x180
[   12.360405]  ? preempt_count_sub+0x50/0x80
[   12.360426]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.360448]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.360469]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.360491]  kthread+0x337/0x6f0
[   12.360508]  ? trace_preempt_on+0x20/0xc0
[   12.360529]  ? __pfx_kthread+0x10/0x10
[   12.360548]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.360567]  ? calculate_sigpending+0x7b/0xa0
[   12.360589]  ? __pfx_kthread+0x10/0x10
[   12.360608]  ret_from_fork+0x116/0x1d0
[   12.360625]  ? __pfx_kthread+0x10/0x10
[   12.360643]  ret_from_fork_asm+0x1a/0x30
[   12.360672]  </TASK>
[   12.360681] 
[   12.374976] Allocated by task 189:
[   12.375124]  kasan_save_stack+0x45/0x70
[   12.375270]  kasan_save_track+0x18/0x40
[   12.375552]  kasan_save_alloc_info+0x3b/0x50
[   12.375958]  __kasan_kmalloc+0xb7/0xc0
[   12.376385]  __kmalloc_cache_noprof+0x189/0x420
[   12.376757]  kmalloc_oob_memset_2+0xac/0x330
[   12.376944]  kunit_try_run_case+0x1a5/0x480
[   12.377094]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.377264]  kthread+0x337/0x6f0
[   12.377446]  ret_from_fork+0x116/0x1d0
[   12.377739]  ret_from_fork_asm+0x1a/0x30
[   12.378043] 
[   12.378181] The buggy address belongs to the object at ffff88810272b700
[   12.378181]  which belongs to the cache kmalloc-128 of size 128
[   12.378919] The buggy address is located 119 bytes inside of
[   12.378919]  allocated 120-byte region [ffff88810272b700, ffff88810272b778)
[   12.379585] 
[   12.379810] The buggy address belongs to the physical page:
[   12.380073] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10272b
[   12.380458] flags: 0x200000000000000(node=0|zone=2)
[   12.380775] page_type: f5(slab)
[   12.380970] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   12.381332] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   12.381796] page dumped because: kasan: bad access detected
[   12.382083] 
[   12.382190] Memory state around the buggy address:
[   12.382535]  ffff88810272b600: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   12.382887]  ffff88810272b680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.383224] >ffff88810272b700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   12.383743]                                                                 ^
[   12.384060]  ffff88810272b780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.384469]  ffff88810272b800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.384870] ==================================================================