Hay
Date
June 23, 2025, 1:39 p.m.

Environment
qemu-arm64
qemu-x86_64

[   24.706512] ==================================================================
[   24.706983] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_2+0x150/0x2f8
[   24.707134] Write of size 2 at addr fff00000c63adf77 by task kunit_try_catch/174
[   24.707481] 
[   24.708557] CPU: 0 UID: 0 PID: 174 Comm: kunit_try_catch Tainted: G    B            N  6.15.4-rc1 #1 PREEMPT 
[   24.709448] Tainted: [B]=BAD_PAGE, [N]=TEST
[   24.709539] Hardware name: linux,dummy-virt (DT)
[   24.709884] Call trace:
[   24.710153]  show_stack+0x20/0x38 (C)
[   24.710299]  dump_stack_lvl+0x8c/0xd0
[   24.710441]  print_report+0x118/0x608
[   24.711311]  kasan_report+0xdc/0x128
[   24.711463]  kasan_check_range+0x100/0x1a8
[   24.711585]  __asan_memset+0x34/0x78
[   24.711731]  kmalloc_oob_memset_2+0x150/0x2f8
[   24.712009]  kunit_try_run_case+0x170/0x3f0
[   24.712202]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   24.712561]  kthread+0x328/0x630
[   24.712705]  ret_from_fork+0x10/0x20
[   24.712918] 
[   24.712964] Allocated by task 174:
[   24.713155]  kasan_save_stack+0x3c/0x68
[   24.713365]  kasan_save_track+0x20/0x40
[   24.713478]  kasan_save_alloc_info+0x40/0x58
[   24.713587]  __kasan_kmalloc+0xd4/0xd8
[   24.713761]  __kmalloc_cache_noprof+0x16c/0x3c0
[   24.713878]  kmalloc_oob_memset_2+0xb0/0x2f8
[   24.713976]  kunit_try_run_case+0x170/0x3f0
[   24.714084]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   24.714418]  kthread+0x328/0x630
[   24.714521]  ret_from_fork+0x10/0x20
[   24.714810] 
[   24.714867] The buggy address belongs to the object at fff00000c63adf00
[   24.714867]  which belongs to the cache kmalloc-128 of size 128
[   24.715024] The buggy address is located 119 bytes inside of
[   24.715024]  allocated 120-byte region [fff00000c63adf00, fff00000c63adf78)
[   24.715182] 
[   24.715233] The buggy address belongs to the physical page:
[   24.715362] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1063ad
[   24.715682] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   24.715870] page_type: f5(slab)
[   24.715963] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   24.716105] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   24.716201] page dumped because: kasan: bad access detected
[   24.716321] 
[   24.716427] Memory state around the buggy address:
[   24.716508]  fff00000c63ade00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   24.716660]  fff00000c63ade80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.716802] >fff00000c63adf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   24.716898]                                                                 ^
[   24.716994]  fff00000c63adf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.717104]  fff00000c63ae000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   24.717240] ==================================================================

[   17.264403] ==================================================================
[   17.265588] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_2+0x166/0x330
[   17.266737] Write of size 2 at addr ffff88810a06f577 by task kunit_try_catch/193
[   17.267933] 
[   17.268273] CPU: 1 UID: 0 PID: 193 Comm: kunit_try_catch Tainted: G    B            N  6.15.4-rc1 #1 PREEMPT(voluntary) 
[   17.268392] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.268429] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   17.268484] Call Trace:
[   17.268524]  <TASK>
[   17.268567]  dump_stack_lvl+0x73/0xb0
[   17.268663]  print_report+0xd1/0x650
[   17.268739]  ? __virt_addr_valid+0x1db/0x2d0
[   17.268893]  ? kmalloc_oob_memset_2+0x166/0x330
[   17.268977]  ? kasan_complete_mode_report_info+0x2a/0x200
[   17.269054]  ? kmalloc_oob_memset_2+0x166/0x330
[   17.269127]  kasan_report+0x141/0x180
[   17.269164]  ? kmalloc_oob_memset_2+0x166/0x330
[   17.269204]  kasan_check_range+0x10c/0x1c0
[   17.269273]  __asan_memset+0x27/0x50
[   17.269305]  kmalloc_oob_memset_2+0x166/0x330
[   17.269339]  ? __pfx_kmalloc_oob_memset_2+0x10/0x10
[   17.269373]  ? __schedule+0x10cc/0x2b60
[   17.269403]  ? __pfx_read_tsc+0x10/0x10
[   17.269432]  ? ktime_get_ts64+0x86/0x230
[   17.269466]  kunit_try_run_case+0x1a5/0x480
[   17.269500]  ? __pfx_kunit_try_run_case+0x10/0x10
[   17.269531]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   17.269564]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   17.269599]  ? __kthread_parkme+0x82/0x180
[   17.269692]  ? preempt_count_sub+0x50/0x80
[   17.269749]  ? __pfx_kunit_try_run_case+0x10/0x10
[   17.269797]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   17.269830]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   17.269863]  kthread+0x337/0x6f0
[   17.269886]  ? trace_preempt_on+0x20/0xc0
[   17.269917]  ? __pfx_kthread+0x10/0x10
[   17.269941]  ? _raw_spin_unlock_irq+0x47/0x80
[   17.269970]  ? calculate_sigpending+0x7b/0xa0
[   17.269998]  ? __pfx_kthread+0x10/0x10
[   17.270022]  ret_from_fork+0x41/0x80
[   17.270051]  ? __pfx_kthread+0x10/0x10
[   17.270074]  ret_from_fork_asm+0x1a/0x30
[   17.270115]  </TASK>
[   17.270129] 
[   17.290453] Allocated by task 193:
[   17.291457]  kasan_save_stack+0x45/0x70
[   17.292143]  kasan_save_track+0x18/0x40
[   17.292493]  kasan_save_alloc_info+0x3b/0x50
[   17.293297]  __kasan_kmalloc+0xb7/0xc0
[   17.293578]  __kmalloc_cache_noprof+0x189/0x420
[   17.293989]  kmalloc_oob_memset_2+0xac/0x330
[   17.294357]  kunit_try_run_case+0x1a5/0x480
[   17.295141]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   17.295795]  kthread+0x337/0x6f0
[   17.296139]  ret_from_fork+0x41/0x80
[   17.296538]  ret_from_fork_asm+0x1a/0x30
[   17.297028] 
[   17.297348] The buggy address belongs to the object at ffff88810a06f500
[   17.297348]  which belongs to the cache kmalloc-128 of size 128
[   17.298728] The buggy address is located 119 bytes inside of
[   17.298728]  allocated 120-byte region [ffff88810a06f500, ffff88810a06f578)
[   17.300102] 
[   17.300335] The buggy address belongs to the physical page:
[   17.301058] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10a06f
[   17.301814] flags: 0x200000000000000(node=0|zone=2)
[   17.302397] page_type: f5(slab)
[   17.302929] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   17.303592] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   17.304364] page dumped because: kasan: bad access detected
[   17.305266] 
[   17.305438] Memory state around the buggy address:
[   17.305955]  ffff88810a06f400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   17.306787]  ffff88810a06f480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.307498] >ffff88810a06f500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   17.308278]                                                                 ^
[   17.309026]  ffff88810a06f580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.309734]  ffff88810a06f600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.310331] ==================================================================