Hay
Date
July 4, 2025, 11:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   29.581505] ==================================================================
[   29.581644] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_in_memset+0x144/0x2d0
[   29.581732] Write of size 128 at addr fff00000c5a97a00 by task kunit_try_catch/203
[   29.581955] 
[   29.582090] CPU: 0 UID: 0 PID: 203 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4-next-20250704 #1 PREEMPT 
[   29.582436] Tainted: [B]=BAD_PAGE, [N]=TEST
[   29.582545] Hardware name: linux,dummy-virt (DT)
[   29.582620] Call trace:
[   29.582645]  show_stack+0x20/0x38 (C)
[   29.582742]  dump_stack_lvl+0x8c/0xd0
[   29.582788]  print_report+0x118/0x608
[   29.582835]  kasan_report+0xdc/0x128
[   29.582887]  kasan_check_range+0x100/0x1a8
[   29.582941]  __asan_memset+0x34/0x78
[   29.585721]  kmalloc_oob_in_memset+0x144/0x2d0
[   29.585824]  kunit_try_run_case+0x170/0x3f0
[   29.586159]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.586283]  kthread+0x328/0x630
[   29.588172]  ret_from_fork+0x10/0x20
[   29.588918] 
[   29.588947] Allocated by task 203:
[   29.588977]  kasan_save_stack+0x3c/0x68
[   29.589021]  kasan_save_track+0x20/0x40
[   29.589059]  kasan_save_alloc_info+0x40/0x58
[   29.589098]  __kasan_kmalloc+0xd4/0xd8
[   29.589136]  __kmalloc_cache_noprof+0x16c/0x3c0
[   29.589177]  kmalloc_oob_in_memset+0xb0/0x2d0
[   29.589215]  kunit_try_run_case+0x170/0x3f0
[   29.590681]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.592342]  kthread+0x328/0x630
[   29.592440]  ret_from_fork+0x10/0x20
[   29.592655] 
[   29.592728] The buggy address belongs to the object at fff00000c5a97a00
[   29.592728]  which belongs to the cache kmalloc-128 of size 128
[   29.592882] The buggy address is located 0 bytes inside of
[   29.592882]  allocated 120-byte region [fff00000c5a97a00, fff00000c5a97a78)
[   29.593032] 
[   29.593135] The buggy address belongs to the physical page:
[   29.593166] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105a97
[   29.593241] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   29.593498] page_type: f5(slab)
[   29.594088] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   29.594195] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   29.594316] page dumped because: kasan: bad access detected
[   29.594603] 
[   29.594623] Memory state around the buggy address:
[   29.594654]  fff00000c5a97900: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   29.594708]  fff00000c5a97980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.594749] >fff00000c5a97a00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   29.594925]                                                                 ^
[   29.594966]  fff00000c5a97a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.595007]  fff00000c5a97b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.595165] ==================================================================

[   24.942840] ==================================================================
[   24.943734] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_in_memset+0x15f/0x320
[   24.944781] Write of size 128 at addr ffff888103d62d00 by task kunit_try_catch/219
[   24.945498] 
[   24.945607] CPU: 1 UID: 0 PID: 219 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4-next-20250704 #1 PREEMPT(voluntary) 
[   24.945664] Tainted: [B]=BAD_PAGE, [N]=TEST
[   24.945679] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   24.945704] Call Trace:
[   24.945720]  <TASK>
[   24.945740]  dump_stack_lvl+0x73/0xb0
[   24.945771]  print_report+0xd1/0x650
[   24.945796]  ? __virt_addr_valid+0x1db/0x2d0
[   24.945823]  ? kmalloc_oob_in_memset+0x15f/0x320
[   24.945846]  ? kasan_complete_mode_report_info+0x2a/0x200
[   24.945874]  ? kmalloc_oob_in_memset+0x15f/0x320
[   24.945897]  kasan_report+0x141/0x180
[   24.945920]  ? kmalloc_oob_in_memset+0x15f/0x320
[   24.945949]  kasan_check_range+0x10c/0x1c0
[   24.945973]  __asan_memset+0x27/0x50
[   24.946028]  kmalloc_oob_in_memset+0x15f/0x320
[   24.946081]  ? __pfx_kmalloc_oob_in_memset+0x10/0x10
[   24.946110]  ? __schedule+0x10cc/0x2b60
[   24.946149]  ? __pfx_read_tsc+0x10/0x10
[   24.946173]  ? ktime_get_ts64+0x86/0x230
[   24.946199]  kunit_try_run_case+0x1a5/0x480
[   24.946227]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.946252]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   24.946277]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   24.946303]  ? __kthread_parkme+0x82/0x180
[   24.946338]  ? preempt_count_sub+0x50/0x80
[   24.946363]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.946400]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.946426]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   24.946452]  kthread+0x337/0x6f0
[   24.946472]  ? trace_preempt_on+0x20/0xc0
[   24.946498]  ? __pfx_kthread+0x10/0x10
[   24.946520]  ? _raw_spin_unlock_irq+0x47/0x80
[   24.946544]  ? calculate_sigpending+0x7b/0xa0
[   24.946569]  ? __pfx_kthread+0x10/0x10
[   24.946592]  ret_from_fork+0x116/0x1d0
[   24.946613]  ? __pfx_kthread+0x10/0x10
[   24.946634]  ret_from_fork_asm+0x1a/0x30
[   24.946668]  </TASK>
[   24.946682] 
[   24.959824] Allocated by task 219:
[   24.960106]  kasan_save_stack+0x45/0x70
[   24.960295]  kasan_save_track+0x18/0x40
[   24.960446]  kasan_save_alloc_info+0x3b/0x50
[   24.960672]  __kasan_kmalloc+0xb7/0xc0
[   24.961094]  __kmalloc_cache_noprof+0x189/0x420
[   24.961485]  kmalloc_oob_in_memset+0xac/0x320
[   24.962112]  kunit_try_run_case+0x1a5/0x480
[   24.962457]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.962646]  kthread+0x337/0x6f0
[   24.962782]  ret_from_fork+0x116/0x1d0
[   24.963051]  ret_from_fork_asm+0x1a/0x30
[   24.963258] 
[   24.963471] The buggy address belongs to the object at ffff888103d62d00
[   24.963471]  which belongs to the cache kmalloc-128 of size 128
[   24.964187] The buggy address is located 0 bytes inside of
[   24.964187]  allocated 120-byte region [ffff888103d62d00, ffff888103d62d78)
[   24.965298] 
[   24.965421] The buggy address belongs to the physical page:
[   24.965678] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103d62
[   24.966487] flags: 0x200000000000000(node=0|zone=2)
[   24.966781] page_type: f5(slab)
[   24.967263] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   24.967755] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   24.968657] page dumped because: kasan: bad access detected
[   24.969096] 
[   24.969226] Memory state around the buggy address:
[   24.969697]  ffff888103d62c00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   24.970348]  ffff888103d62c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.970682] >ffff888103d62d00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   24.971349]                                                                 ^
[   24.971837]  ffff888103d62d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.972507]  ffff888103d62e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.973010] ==================================================================