Hay
Date
May 29, 2025, 7:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   21.509548] ==================================================================
[   21.509743] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_in_memset+0x144/0x2d0
[   21.510636] Write of size 128 at addr fff00000c5d6ea00 by task kunit_try_catch/170
[   21.510937] 
[   21.511409] CPU: 1 UID: 0 PID: 170 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250529 #1 PREEMPT 
[   21.511714] Tainted: [B]=BAD_PAGE, [N]=TEST
[   21.511783] Hardware name: linux,dummy-virt (DT)
[   21.511948] Call trace:
[   21.512413]  show_stack+0x20/0x38 (C)
[   21.512811]  dump_stack_lvl+0x8c/0xd0
[   21.512961]  print_report+0x118/0x608
[   21.513076]  kasan_report+0xdc/0x128
[   21.513190]  kasan_check_range+0x100/0x1a8
[   21.513524]  __asan_memset+0x34/0x78
[   21.513645]  kmalloc_oob_in_memset+0x144/0x2d0
[   21.513783]  kunit_try_run_case+0x170/0x3f0
[   21.513908]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.514034]  kthread+0x328/0x630
[   21.514143]  ret_from_fork+0x10/0x20
[   21.514265] 
[   21.514327] Allocated by task 170:
[   21.514792]  kasan_save_stack+0x3c/0x68
[   21.515493]  kasan_save_track+0x20/0x40
[   21.515849]  kasan_save_alloc_info+0x40/0x58
[   21.515972]  __kasan_kmalloc+0xd4/0xd8
[   21.516067]  __kmalloc_cache_noprof+0x15c/0x3c0
[   21.516164]  kmalloc_oob_in_memset+0xb0/0x2d0
[   21.516493]  kunit_try_run_case+0x170/0x3f0
[   21.516608]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.516980]  kthread+0x328/0x630
[   21.517091]  ret_from_fork+0x10/0x20
[   21.517179] 
[   21.517760] The buggy address belongs to the object at fff00000c5d6ea00
[   21.517760]  which belongs to the cache kmalloc-128 of size 128
[   21.518123] The buggy address is located 0 bytes inside of
[   21.518123]  allocated 120-byte region [fff00000c5d6ea00, fff00000c5d6ea78)
[   21.518453] 
[   21.518528] The buggy address belongs to the physical page:
[   21.518674] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105d6e
[   21.518785] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   21.519414] page_type: f5(slab)
[   21.519543] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   21.520039] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   21.520223] page dumped because: kasan: bad access detected
[   21.520316] 
[   21.520363] Memory state around the buggy address:
[   21.520529]  fff00000c5d6e900: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   21.520646]  fff00000c5d6e980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.520934] >fff00000c5d6ea00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   21.521061]                                                                 ^
[   21.521577]  fff00000c5d6ea80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.521856]  fff00000c5d6eb00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.521951] ==================================================================


[   10.931042] ==================================================================
[   10.931415] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_in_memset+0x15f/0x320
[   10.931732] Write of size 128 at addr ffff888102896a00 by task kunit_try_catch/187
[   10.932196] 
[   10.932376] CPU: 1 UID: 0 PID: 187 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250529 #1 PREEMPT(voluntary) 
[   10.932421] Tainted: [B]=BAD_PAGE, [N]=TEST
[   10.932434] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   10.932455] Call Trace:
[   10.932465]  <TASK>
[   10.932480]  dump_stack_lvl+0x73/0xb0
[   10.932823]  print_report+0xd1/0x650
[   10.932855]  ? __virt_addr_valid+0x1db/0x2d0
[   10.932879]  ? kmalloc_oob_in_memset+0x15f/0x320
[   10.932901]  ? kasan_complete_mode_report_info+0x2a/0x200
[   10.932925]  ? kmalloc_oob_in_memset+0x15f/0x320
[   10.932947]  kasan_report+0x141/0x180
[   10.932969]  ? kmalloc_oob_in_memset+0x15f/0x320
[   10.932996]  kasan_check_range+0x10c/0x1c0
[   10.933021]  __asan_memset+0x27/0x50
[   10.933041]  kmalloc_oob_in_memset+0x15f/0x320
[   10.933063]  ? __pfx_kmalloc_oob_in_memset+0x10/0x10
[   10.933089]  ? __pfx_read_tsc+0x10/0x10
[   10.933110]  ? ktime_get_ts64+0x86/0x230
[   10.933134]  kunit_try_run_case+0x1a5/0x480
[   10.933155]  ? __pfx_kunit_try_run_case+0x10/0x10
[   10.933174]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   10.933198]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   10.933222]  ? __kthread_parkme+0x82/0x180
[   10.933242]  ? preempt_count_sub+0x50/0x80
[   10.933265]  ? __pfx_kunit_try_run_case+0x10/0x10
[   10.933285]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   10.933309]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   10.933333]  kthread+0x337/0x6f0
[   10.933352]  ? trace_preempt_on+0x20/0xc0
[   10.933375]  ? __pfx_kthread+0x10/0x10
[   10.933395]  ? _raw_spin_unlock_irq+0x47/0x80
[   10.933417]  ? calculate_sigpending+0x7b/0xa0
[   10.933440]  ? __pfx_kthread+0x10/0x10
[   10.933461]  ret_from_fork+0x116/0x1d0
[   10.933480]  ? __pfx_kthread+0x10/0x10
[   10.933502]  ret_from_fork_asm+0x1a/0x30
[   10.933532]  </TASK>
[   10.933542] 
[   10.943915] Allocated by task 187:
[   10.944209]  kasan_save_stack+0x45/0x70
[   10.945132]  kasan_save_track+0x18/0x40
[   10.945319]  kasan_save_alloc_info+0x3b/0x50
[   10.945549]  __kasan_kmalloc+0xb7/0xc0
[   10.946036]  __kmalloc_cache_noprof+0x189/0x420
[   10.946378]  kmalloc_oob_in_memset+0xac/0x320
[   10.946686]  kunit_try_run_case+0x1a5/0x480
[   10.947106]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   10.947456]  kthread+0x337/0x6f0
[   10.947724]  ret_from_fork+0x116/0x1d0
[   10.948094]  ret_from_fork_asm+0x1a/0x30
[   10.948255] 
[   10.948529] The buggy address belongs to the object at ffff888102896a00
[   10.948529]  which belongs to the cache kmalloc-128 of size 128
[   10.949275] The buggy address is located 0 bytes inside of
[   10.949275]  allocated 120-byte region [ffff888102896a00, ffff888102896a78)
[   10.949904] 
[   10.950032] The buggy address belongs to the physical page:
[   10.950255] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102896
[   10.950592] flags: 0x200000000000000(node=0|zone=2)
[   10.950794] page_type: f5(slab)
[   10.951044] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   10.951345] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   10.951749] page dumped because: kasan: bad access detected
[   10.952012] 
[   10.952234] Memory state around the buggy address:
[   10.952539]  ffff888102896900: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   10.953099]  ffff888102896980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   10.953671] >ffff888102896a00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   10.954199]                                                                 ^
[   10.954595]  ffff888102896a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   10.955090]  ffff888102896b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   10.955497] ==================================================================