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

Environment
qemu-arm64
qemu-x86_64

[   15.368755] ==================================================================
[   15.368874] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_4+0x150/0x300
[   15.368999] Write of size 4 at addr fff00000c3fc2c75 by task kunit_try_catch/174
[   15.369052] 
[   15.369217] CPU: 0 UID: 0 PID: 174 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   15.369417] Tainted: [B]=BAD_PAGE, [N]=TEST
[   15.369466] Hardware name: linux,dummy-virt (DT)
[   15.369521] Call trace:
[   15.369554]  show_stack+0x20/0x38 (C)
[   15.369621]  dump_stack_lvl+0x8c/0xd0
[   15.369677]  print_report+0x118/0x5d0
[   15.369758]  kasan_report+0xdc/0x128
[   15.369803]  kasan_check_range+0x100/0x1a8
[   15.369849]  __asan_memset+0x34/0x78
[   15.369889]  kmalloc_oob_memset_4+0x150/0x300
[   15.370118]  kunit_try_run_case+0x170/0x3f0
[   15.370212]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.370263]  kthread+0x328/0x630
[   15.370303]  ret_from_fork+0x10/0x20
[   15.370356] 
[   15.370496] Allocated by task 174:
[   15.370609]  kasan_save_stack+0x3c/0x68
[   15.370656]  kasan_save_track+0x20/0x40
[   15.370704]  kasan_save_alloc_info+0x40/0x58
[   15.370769]  __kasan_kmalloc+0xd4/0xd8
[   15.370868]  __kmalloc_cache_noprof+0x16c/0x3c0
[   15.370926]  kmalloc_oob_memset_4+0xb0/0x300
[   15.370963]  kunit_try_run_case+0x170/0x3f0
[   15.371000]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.371053]  kthread+0x328/0x630
[   15.371086]  ret_from_fork+0x10/0x20
[   15.371123] 
[   15.371144] The buggy address belongs to the object at fff00000c3fc2c00
[   15.371144]  which belongs to the cache kmalloc-128 of size 128
[   15.371306] The buggy address is located 117 bytes inside of
[   15.371306]  allocated 120-byte region [fff00000c3fc2c00, fff00000c3fc2c78)
[   15.371486] 
[   15.371555] The buggy address belongs to the physical page:
[   15.371625] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103fc2
[   15.371749] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   15.371796] page_type: f5(slab)
[   15.371833] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   15.372003] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   15.372041] page dumped because: kasan: bad access detected
[   15.372071] 
[   15.372089] Memory state around the buggy address:
[   15.372119]  fff00000c3fc2b00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   15.372161]  fff00000c3fc2b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.372354] >fff00000c3fc2c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   15.372436]                                                                 ^
[   15.372553]  fff00000c3fc2c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.372673]  fff00000c3fc2d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.372753] ==================================================================

[   12.389853] ==================================================================
[   12.390307] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_4+0x166/0x330
[   12.391325] Write of size 4 at addr ffff888102ad4375 by task kunit_try_catch/191
[   12.392345] 
[   12.392691] CPU: 0 UID: 0 PID: 191 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   12.392750] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.392762] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.392782] Call Trace:
[   12.392794]  <TASK>
[   12.392810]  dump_stack_lvl+0x73/0xb0
[   12.392841]  print_report+0xd1/0x610
[   12.392862]  ? __virt_addr_valid+0x1db/0x2d0
[   12.392884]  ? kmalloc_oob_memset_4+0x166/0x330
[   12.392917]  ? kasan_complete_mode_report_info+0x2a/0x200
[   12.392939]  ? kmalloc_oob_memset_4+0x166/0x330
[   12.392960]  kasan_report+0x141/0x180
[   12.392981]  ? kmalloc_oob_memset_4+0x166/0x330
[   12.393006]  kasan_check_range+0x10c/0x1c0
[   12.393027]  __asan_memset+0x27/0x50
[   12.393045]  kmalloc_oob_memset_4+0x166/0x330
[   12.393066]  ? __pfx_kmalloc_oob_memset_4+0x10/0x10
[   12.393087]  ? __schedule+0x10cc/0x2b60
[   12.393109]  ? __pfx_read_tsc+0x10/0x10
[   12.393128]  ? ktime_get_ts64+0x86/0x230
[   12.393152]  kunit_try_run_case+0x1a5/0x480
[   12.393175]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.393196]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.393218]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.393240]  ? __kthread_parkme+0x82/0x180
[   12.393259]  ? preempt_count_sub+0x50/0x80
[   12.393282]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.393304]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.393325]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.393347]  kthread+0x337/0x6f0
[   12.393365]  ? trace_preempt_on+0x20/0xc0
[   12.393387]  ? __pfx_kthread+0x10/0x10
[   12.393406]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.393425]  ? calculate_sigpending+0x7b/0xa0
[   12.393448]  ? __pfx_kthread+0x10/0x10
[   12.393468]  ret_from_fork+0x116/0x1d0
[   12.393485]  ? __pfx_kthread+0x10/0x10
[   12.393504]  ret_from_fork_asm+0x1a/0x30
[   12.393534]  </TASK>
[   12.393545] 
[   12.406329] Allocated by task 191:
[   12.406755]  kasan_save_stack+0x45/0x70
[   12.407084]  kasan_save_track+0x18/0x40
[   12.407223]  kasan_save_alloc_info+0x3b/0x50
[   12.407472]  __kasan_kmalloc+0xb7/0xc0
[   12.407864]  __kmalloc_cache_noprof+0x189/0x420
[   12.408325]  kmalloc_oob_memset_4+0xac/0x330
[   12.408829]  kunit_try_run_case+0x1a5/0x480
[   12.409285]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.409597]  kthread+0x337/0x6f0
[   12.409748]  ret_from_fork+0x116/0x1d0
[   12.410114]  ret_from_fork_asm+0x1a/0x30
[   12.410533] 
[   12.410717] The buggy address belongs to the object at ffff888102ad4300
[   12.410717]  which belongs to the cache kmalloc-128 of size 128
[   12.411387] The buggy address is located 117 bytes inside of
[   12.411387]  allocated 120-byte region [ffff888102ad4300, ffff888102ad4378)
[   12.412660] 
[   12.412828] The buggy address belongs to the physical page:
[   12.413166] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102ad4
[   12.413597] flags: 0x200000000000000(node=0|zone=2)
[   12.414135] page_type: f5(slab)
[   12.414547] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   12.415236] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   12.415963] page dumped because: kasan: bad access detected
[   12.416142] 
[   12.416211] Memory state around the buggy address:
[   12.416438]  ffff888102ad4200: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   12.417120]  ffff888102ad4280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.418015] >ffff888102ad4300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   12.418789]                                                                 ^
[   12.419026]  ffff888102ad4380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.419245]  ffff888102ad4400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.419487] ==================================================================