Hay
Date
June 5, 2025, 7:08 a.m.

Environment
qemu-arm64
qemu-x86_64

[   25.181582] ==================================================================
[   25.181704] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_in_memset+0x144/0x2d0
[   25.181816] Write of size 128 at addr fff00000c6419200 by task kunit_try_catch/170
[   25.181934] 
[   25.182004] CPU: 0 UID: 0 PID: 170 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250605 #1 PREEMPT 
[   25.182202] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.182351] Hardware name: linux,dummy-virt (DT)
[   25.182450] Call trace:
[   25.182514]  show_stack+0x20/0x38 (C)
[   25.182652]  dump_stack_lvl+0x8c/0xd0
[   25.182881]  print_report+0x118/0x608
[   25.183046]  kasan_report+0xdc/0x128
[   25.183258]  kasan_check_range+0x100/0x1a8
[   25.183530]  __asan_memset+0x34/0x78
[   25.183784]  kmalloc_oob_in_memset+0x144/0x2d0
[   25.184152]  kunit_try_run_case+0x170/0x3f0
[   25.184314]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   25.184474]  kthread+0x328/0x630
[   25.184589]  ret_from_fork+0x10/0x20
[   25.184764] 
[   25.184906] Allocated by task 170:
[   25.185103]  kasan_save_stack+0x3c/0x68
[   25.185421]  kasan_save_track+0x20/0x40
[   25.185657]  kasan_save_alloc_info+0x40/0x58
[   25.185758]  __kasan_kmalloc+0xd4/0xd8
[   25.185846]  __kmalloc_cache_noprof+0x16c/0x3c0
[   25.185944]  kmalloc_oob_in_memset+0xb0/0x2d0
[   25.186075]  kunit_try_run_case+0x170/0x3f0
[   25.186206]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   25.186419]  kthread+0x328/0x630
[   25.186522]  ret_from_fork+0x10/0x20
[   25.186627] 
[   25.187080] The buggy address belongs to the object at fff00000c6419200
[   25.187080]  which belongs to the cache kmalloc-128 of size 128
[   25.187259] The buggy address is located 0 bytes inside of
[   25.187259]  allocated 120-byte region [fff00000c6419200, fff00000c6419278)
[   25.187448] 
[   25.187506] The buggy address belongs to the physical page:
[   25.187633] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106419
[   25.187834] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   25.187951] page_type: f5(slab)
[   25.188043] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   25.188282] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   25.188410] page dumped because: kasan: bad access detected
[   25.188486] 
[   25.188799] Memory state around the buggy address:
[   25.188881]  fff00000c6419100: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   25.189236]  fff00000c6419180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.189485] >fff00000c6419200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   25.189774]                                                                 ^
[   25.190131]  fff00000c6419280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.190347]  fff00000c6419300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.190442] ==================================================================


[   11.446369] ==================================================================
[   11.446812] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_in_memset+0x15f/0x320
[   11.447192] Write of size 128 at addr ffff888102b2d200 by task kunit_try_catch/187
[   11.447638] 
[   11.447734] CPU: 0 UID: 0 PID: 187 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250605 #1 PREEMPT(voluntary) 
[   11.447777] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.447787] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.447809] Call Trace:
[   11.447819]  <TASK>
[   11.447833]  dump_stack_lvl+0x73/0xb0
[   11.447859]  print_report+0xd1/0x650
[   11.447880]  ? __virt_addr_valid+0x1db/0x2d0
[   11.447913]  ? kmalloc_oob_in_memset+0x15f/0x320
[   11.447934]  ? kasan_complete_mode_report_info+0x2a/0x200
[   11.448011]  ? kmalloc_oob_in_memset+0x15f/0x320
[   11.448035]  kasan_report+0x141/0x180
[   11.448057]  ? kmalloc_oob_in_memset+0x15f/0x320
[   11.448083]  kasan_check_range+0x10c/0x1c0
[   11.448106]  __asan_memset+0x27/0x50
[   11.448125]  kmalloc_oob_in_memset+0x15f/0x320
[   11.448147]  ? __pfx_kmalloc_oob_in_memset+0x10/0x10
[   11.448169]  ? __schedule+0x10cc/0x2b60
[   11.448192]  ? __pfx_read_tsc+0x10/0x10
[   11.448213]  ? ktime_get_ts64+0x86/0x230
[   11.448236]  kunit_try_run_case+0x1a5/0x480
[   11.448257]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.448275]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.448300]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.448324]  ? __kthread_parkme+0x82/0x180
[   11.448343]  ? preempt_count_sub+0x50/0x80
[   11.448366]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.448386]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.448410]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.448433]  kthread+0x337/0x6f0
[   11.448451]  ? trace_preempt_on+0x20/0xc0
[   11.448474]  ? __pfx_kthread+0x10/0x10
[   11.448494]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.448515]  ? calculate_sigpending+0x7b/0xa0
[   11.448539]  ? __pfx_kthread+0x10/0x10
[   11.448560]  ret_from_fork+0x116/0x1d0
[   11.448577]  ? __pfx_kthread+0x10/0x10
[   11.448597]  ret_from_fork_asm+0x1a/0x30
[   11.448626]  </TASK>
[   11.448636] 
[   11.456307] Allocated by task 187:
[   11.456440]  kasan_save_stack+0x45/0x70
[   11.456583]  kasan_save_track+0x18/0x40
[   11.456972]  kasan_save_alloc_info+0x3b/0x50
[   11.457193]  __kasan_kmalloc+0xb7/0xc0
[   11.457381]  __kmalloc_cache_noprof+0x189/0x420
[   11.457601]  kmalloc_oob_in_memset+0xac/0x320
[   11.457815]  kunit_try_run_case+0x1a5/0x480
[   11.458043]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.458434]  kthread+0x337/0x6f0
[   11.458566]  ret_from_fork+0x116/0x1d0
[   11.458819]  ret_from_fork_asm+0x1a/0x30
[   11.459137] 
[   11.459216] The buggy address belongs to the object at ffff888102b2d200
[   11.459216]  which belongs to the cache kmalloc-128 of size 128
[   11.459695] The buggy address is located 0 bytes inside of
[   11.459695]  allocated 120-byte region [ffff888102b2d200, ffff888102b2d278)
[   11.460391] 
[   11.460494] The buggy address belongs to the physical page:
[   11.460741] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102b2d
[   11.461706] flags: 0x200000000000000(node=0|zone=2)
[   11.461870] page_type: f5(slab)
[   11.461998] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   11.462226] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   11.462555] page dumped because: kasan: bad access detected
[   11.462880] 
[   11.462980] Memory state around the buggy address:
[   11.463200]  ffff888102b2d100: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   11.463496]  ffff888102b2d180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.464051] >ffff888102b2d200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   11.464337]                                                                 ^
[   11.464604]  ffff888102b2d280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.465062]  ffff888102b2d300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.465280] ==================================================================