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

Environment
qemu-arm64
qemu-x86_64

[   31.165833] ==================================================================
[   31.165890] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_4+0x150/0x300
[   31.165944] Write of size 4 at addr fff00000c9a9c475 by task kunit_try_catch/205
[   31.166001] 
[   31.166040] CPU: 0 UID: 0 PID: 205 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5-next-20250708 #1 PREEMPT 
[   31.166129] Tainted: [B]=BAD_PAGE, [N]=TEST
[   31.166155] Hardware name: linux,dummy-virt (DT)
[   31.166185] Call trace:
[   31.166220]  show_stack+0x20/0x38 (C)
[   31.166267]  dump_stack_lvl+0x8c/0xd0
[   31.166314]  print_report+0x118/0x5d0
[   31.166366]  kasan_report+0xdc/0x128
[   31.166411]  kasan_check_range+0x100/0x1a8
[   31.166456]  __asan_memset+0x34/0x78
[   31.166502]  kmalloc_oob_memset_4+0x150/0x300
[   31.166741]  kunit_try_run_case+0x170/0x3f0
[   31.166799]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.166854]  kthread+0x328/0x630
[   31.166909]  ret_from_fork+0x10/0x20
[   31.166957] 
[   31.166975] Allocated by task 205:
[   31.167002]  kasan_save_stack+0x3c/0x68
[   31.167052]  kasan_save_track+0x20/0x40
[   31.167090]  kasan_save_alloc_info+0x40/0x58
[   31.167127]  __kasan_kmalloc+0xd4/0xd8
[   31.167165]  __kmalloc_cache_noprof+0x16c/0x3c0
[   31.167203]  kmalloc_oob_memset_4+0xb0/0x300
[   31.167334]  kunit_try_run_case+0x170/0x3f0
[   31.167374]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.167531]  kthread+0x328/0x630
[   31.167576]  ret_from_fork+0x10/0x20
[   31.167629] 
[   31.167658] The buggy address belongs to the object at fff00000c9a9c400
[   31.167658]  which belongs to the cache kmalloc-128 of size 128
[   31.167740] The buggy address is located 117 bytes inside of
[   31.167740]  allocated 120-byte region [fff00000c9a9c400, fff00000c9a9c478)
[   31.167809] 
[   31.167838] The buggy address belongs to the physical page:
[   31.167876] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109a9c
[   31.167927] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   31.167973] page_type: f5(slab)
[   31.168009] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   31.168056] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   31.168094] page dumped because: kasan: bad access detected
[   31.168132] 
[   31.168150] Memory state around the buggy address:
[   31.168224]  fff00000c9a9c300: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   31.168272]  fff00000c9a9c380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.168328] >fff00000c9a9c400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   31.168365]                                                                 ^
[   31.168410]  fff00000c9a9c480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.168581]  fff00000c9a9c500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.168807] ==================================================================

[   23.443647] ==================================================================
[   23.444185] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_4+0x166/0x330
[   23.444525] Write of size 4 at addr ffff88810595dd75 by task kunit_try_catch/222
[   23.445114] 
[   23.445221] CPU: 1 UID: 0 PID: 222 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5-next-20250708 #1 PREEMPT(voluntary) 
[   23.445287] Tainted: [B]=BAD_PAGE, [N]=TEST
[   23.445300] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   23.445323] Call Trace:
[   23.445337]  <TASK>
[   23.445360]  dump_stack_lvl+0x73/0xb0
[   23.445395]  print_report+0xd1/0x610
[   23.445419]  ? __virt_addr_valid+0x1db/0x2d0
[   23.445447]  ? kmalloc_oob_memset_4+0x166/0x330
[   23.445469]  ? kasan_complete_mode_report_info+0x2a/0x200
[   23.445497]  ? kmalloc_oob_memset_4+0x166/0x330
[   23.445519]  kasan_report+0x141/0x180
[   23.445542]  ? kmalloc_oob_memset_4+0x166/0x330
[   23.445568]  kasan_check_range+0x10c/0x1c0
[   23.445593]  __asan_memset+0x27/0x50
[   23.445619]  kmalloc_oob_memset_4+0x166/0x330
[   23.445642]  ? __pfx_kmalloc_oob_memset_4+0x10/0x10
[   23.445664]  ? __schedule+0x10cc/0x2b60
[   23.445694]  ? __pfx_read_tsc+0x10/0x10
[   23.445719]  ? ktime_get_ts64+0x86/0x230
[   23.445747]  kunit_try_run_case+0x1a5/0x480
[   23.445771]  ? __pfx_kunit_try_run_case+0x10/0x10
[   23.445791]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   23.445813]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   23.445870]  ? __kthread_parkme+0x82/0x180
[   23.445960]  ? preempt_count_sub+0x50/0x80
[   23.445986]  ? __pfx_kunit_try_run_case+0x10/0x10
[   23.446008]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   23.446037]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   23.446064]  kthread+0x337/0x6f0
[   23.446085]  ? trace_preempt_on+0x20/0xc0
[   23.446111]  ? __pfx_kthread+0x10/0x10
[   23.446133]  ? _raw_spin_unlock_irq+0x47/0x80
[   23.446160]  ? calculate_sigpending+0x7b/0xa0
[   23.446188]  ? __pfx_kthread+0x10/0x10
[   23.446211]  ret_from_fork+0x116/0x1d0
[   23.446231]  ? __pfx_kthread+0x10/0x10
[   23.446263]  ret_from_fork_asm+0x1a/0x30
[   23.446298]  </TASK>
[   23.446309] 
[   23.456735] Allocated by task 222:
[   23.457445]  kasan_save_stack+0x45/0x70
[   23.457735]  kasan_save_track+0x18/0x40
[   23.458336]  kasan_save_alloc_info+0x3b/0x50
[   23.458664]  __kasan_kmalloc+0xb7/0xc0
[   23.459267]  __kmalloc_cache_noprof+0x189/0x420
[   23.459495]  kmalloc_oob_memset_4+0xac/0x330
[   23.459689]  kunit_try_run_case+0x1a5/0x480
[   23.460216]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   23.460548]  kthread+0x337/0x6f0
[   23.460993]  ret_from_fork+0x116/0x1d0
[   23.461353]  ret_from_fork_asm+0x1a/0x30
[   23.461555] 
[   23.461641] The buggy address belongs to the object at ffff88810595dd00
[   23.461641]  which belongs to the cache kmalloc-128 of size 128
[   23.462840] The buggy address is located 117 bytes inside of
[   23.462840]  allocated 120-byte region [ffff88810595dd00, ffff88810595dd78)
[   23.463951] 
[   23.464054] The buggy address belongs to the physical page:
[   23.464470] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10595d
[   23.465166] flags: 0x200000000000000(node=0|zone=2)
[   23.465541] page_type: f5(slab)
[   23.465710] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   23.466504] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   23.467152] page dumped because: kasan: bad access detected
[   23.467400] 
[   23.467487] Memory state around the buggy address:
[   23.467687]  ffff88810595dc00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   23.468589]  ffff88810595dc80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.469182] >ffff88810595dd00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   23.469630]                                                                 ^
[   23.470154]  ffff88810595dd80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.470456]  ffff88810595de00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.471034] ==================================================================