Hay
Date
July 9, 2025, 1:08 p.m.

Environment
qemu-arm64
qemu-x86_64

[   29.353079] ==================================================================
[   29.353144] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_2+0x150/0x2f8
[   29.353201] Write of size 2 at addr fff00000c57d4d77 by task kunit_try_catch/204
[   29.354412] 
[   29.355009] CPU: 0 UID: 0 PID: 204 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5-next-20250709 #1 PREEMPT 
[   29.355237] Tainted: [B]=BAD_PAGE, [N]=TEST
[   29.355315] Hardware name: linux,dummy-virt (DT)
[   29.355529] Call trace:
[   29.355556]  show_stack+0x20/0x38 (C)
[   29.355611]  dump_stack_lvl+0x8c/0xd0
[   29.356324]  print_report+0x118/0x5d0
[   29.356562]  kasan_report+0xdc/0x128
[   29.357100]  kasan_check_range+0x100/0x1a8
[   29.357299]  __asan_memset+0x34/0x78
[   29.357357]  kmalloc_oob_memset_2+0x150/0x2f8
[   29.358035]  kunit_try_run_case+0x170/0x3f0
[   29.358113]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.358632]  kthread+0x328/0x630
[   29.358684]  ret_from_fork+0x10/0x20
[   29.358734] 
[   29.358753] Allocated by task 204:
[   29.358783]  kasan_save_stack+0x3c/0x68
[   29.359709]  kasan_save_track+0x20/0x40
[   29.360038]  kasan_save_alloc_info+0x40/0x58
[   29.360300]  __kasan_kmalloc+0xd4/0xd8
[   29.360801]  __kmalloc_cache_noprof+0x16c/0x3c0
[   29.361122]  kmalloc_oob_memset_2+0xb0/0x2f8
[   29.361164]  kunit_try_run_case+0x170/0x3f0
[   29.361203]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.361246]  kthread+0x328/0x630
[   29.361279]  ret_from_fork+0x10/0x20
[   29.361315] 
[   29.361335] The buggy address belongs to the object at fff00000c57d4d00
[   29.361335]  which belongs to the cache kmalloc-128 of size 128
[   29.362617] The buggy address is located 119 bytes inside of
[   29.362617]  allocated 120-byte region [fff00000c57d4d00, fff00000c57d4d78)
[   29.363050] 
[   29.363409] The buggy address belongs to the physical page:
[   29.363590] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1057d4
[   29.363812] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   29.363862] page_type: f5(slab)
[   29.364117] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   29.364167] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   29.364206] page dumped because: kasan: bad access detected
[   29.364492] 
[   29.364894] Memory state around the buggy address:
[   29.365238]  fff00000c57d4c00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   29.365514]  fff00000c57d4c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.365782] >fff00000c57d4d00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   29.365923]                                                                 ^
[   29.366074]  fff00000c57d4d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.366121]  fff00000c57d4e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.366158] ==================================================================

[   24.186655] ==================================================================
[   24.187471] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_2+0x166/0x330
[   24.187840] Write of size 2 at addr ffff8881058c1577 by task kunit_try_catch/222
[   24.188363] 
[   24.188464] CPU: 0 UID: 0 PID: 222 Comm: kunit_try_catch Tainted: G    B   W        N  6.16.0-rc5-next-20250709 #1 PREEMPT(voluntary) 
[   24.188580] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   24.188594] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   24.188615] Call Trace:
[   24.188628]  <TASK>
[   24.188648]  dump_stack_lvl+0x73/0xb0
[   24.188688]  print_report+0xd1/0x610
[   24.188735]  ? __virt_addr_valid+0x1db/0x2d0
[   24.188760]  ? kmalloc_oob_memset_2+0x166/0x330
[   24.188790]  ? kasan_complete_mode_report_info+0x2a/0x200
[   24.188815]  ? kmalloc_oob_memset_2+0x166/0x330
[   24.188836]  kasan_report+0x141/0x180
[   24.188857]  ? kmalloc_oob_memset_2+0x166/0x330
[   24.188927]  kasan_check_range+0x10c/0x1c0
[   24.188953]  __asan_memset+0x27/0x50
[   24.188976]  kmalloc_oob_memset_2+0x166/0x330
[   24.188996]  ? __kasan_check_write+0x18/0x20
[   24.189019]  ? __pfx_kmalloc_oob_memset_2+0x10/0x10
[   24.189054]  ? __pfx_queued_spin_lock_slowpath+0x10/0x10
[   24.189080]  ? __pfx_read_tsc+0x10/0x10
[   24.189101]  ? ktime_get_ts64+0x86/0x230
[   24.189137]  kunit_try_run_case+0x1a5/0x480
[   24.189159]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.189179]  ? _raw_spin_lock_irqsave+0xf9/0x100
[   24.189201]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   24.189224]  ? __kthread_parkme+0x82/0x180
[   24.189245]  ? preempt_count_sub+0x50/0x80
[   24.189268]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.189289]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.189313]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   24.189337]  kthread+0x337/0x6f0
[   24.189356]  ? trace_preempt_on+0x20/0xc0
[   24.189379]  ? __pfx_kthread+0x10/0x10
[   24.189399]  ? _raw_spin_unlock_irq+0x47/0x80
[   24.189421]  ? calculate_sigpending+0x7b/0xa0
[   24.189445]  ? __pfx_kthread+0x10/0x10
[   24.189466]  ret_from_fork+0x116/0x1d0
[   24.189485]  ? __pfx_kthread+0x10/0x10
[   24.189505]  ret_from_fork_asm+0x1a/0x30
[   24.189535]  </TASK>
[   24.189546] 
[   24.197260] Allocated by task 222:
[   24.197437]  kasan_save_stack+0x45/0x70
[   24.197862]  kasan_save_track+0x18/0x40
[   24.198099]  kasan_save_alloc_info+0x3b/0x50
[   24.198244]  __kasan_kmalloc+0xb7/0xc0
[   24.198409]  __kmalloc_cache_noprof+0x189/0x420
[   24.198641]  kmalloc_oob_memset_2+0xac/0x330
[   24.198992]  kunit_try_run_case+0x1a5/0x480
[   24.199164]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.199408]  kthread+0x337/0x6f0
[   24.199573]  ret_from_fork+0x116/0x1d0
[   24.199740]  ret_from_fork_asm+0x1a/0x30
[   24.200088] 
[   24.200181] The buggy address belongs to the object at ffff8881058c1500
[   24.200181]  which belongs to the cache kmalloc-128 of size 128
[   24.200635] The buggy address is located 119 bytes inside of
[   24.200635]  allocated 120-byte region [ffff8881058c1500, ffff8881058c1578)
[   24.201253] 
[   24.201342] The buggy address belongs to the physical page:
[   24.201556] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1058c1
[   24.201905] flags: 0x200000000000000(node=0|zone=2)
[   24.202062] page_type: f5(slab)
[   24.202177] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   24.202399] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   24.202912] page dumped because: kasan: bad access detected
[   24.203360] 
[   24.203458] Memory state around the buggy address:
[   24.203679]  ffff8881058c1400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   24.204073]  ffff8881058c1480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.204308] >ffff8881058c1500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   24.204609]                                                                 ^
[   24.205042]  ffff8881058c1580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.205254]  ffff8881058c1600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.205460] ==================================================================