Hay
Date
May 15, 2025, 10:38 a.m.

Environment
qemu-arm64
qemu-x86_64

[   18.052676] ==================================================================
[   18.052758] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_4+0x150/0x300
[   18.052888] Write of size 4 at addr fff00000c68f1475 by task kunit_try_catch/174
[   18.053040] 
[   18.053075] CPU: 1 UID: 0 PID: 174 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250515 #1 PREEMPT 
[   18.053171] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.053197] Hardware name: linux,dummy-virt (DT)
[   18.053225] Call trace:
[   18.053370]  show_stack+0x20/0x38 (C)
[   18.053430]  dump_stack_lvl+0x8c/0xd0
[   18.053476]  print_report+0x118/0x608
[   18.053529]  kasan_report+0xdc/0x128
[   18.053573]  kasan_check_range+0x100/0x1a8
[   18.053620]  __asan_memset+0x34/0x78
[   18.053664]  kmalloc_oob_memset_4+0x150/0x300
[   18.053708]  kunit_try_run_case+0x170/0x3f0
[   18.053759]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.053810]  kthread+0x328/0x630
[   18.054336]  ret_from_fork+0x10/0x20
[   18.054563] 
[   18.054634] Allocated by task 174:
[   18.054683]  kasan_save_stack+0x3c/0x68
[   18.054991]  kasan_save_track+0x20/0x40
[   18.055077]  kasan_save_alloc_info+0x40/0x58
[   18.055218]  __kasan_kmalloc+0xd4/0xd8
[   18.055346]  __kmalloc_cache_noprof+0x15c/0x3c0
[   18.055434]  kmalloc_oob_memset_4+0xb0/0x300
[   18.055586]  kunit_try_run_case+0x170/0x3f0
[   18.055625]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.055695]  kthread+0x328/0x630
[   18.056016]  ret_from_fork+0x10/0x20
[   18.056128] 
[   18.056205] The buggy address belongs to the object at fff00000c68f1400
[   18.056205]  which belongs to the cache kmalloc-128 of size 128
[   18.056364] The buggy address is located 117 bytes inside of
[   18.056364]  allocated 120-byte region [fff00000c68f1400, fff00000c68f1478)
[   18.056525] 
[   18.056548] The buggy address belongs to the physical page:
[   18.056607] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1068f1
[   18.056693] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.056868] page_type: f5(slab)
[   18.057195] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   18.057332] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   18.057413] page dumped because: kasan: bad access detected
[   18.057445] 
[   18.057470] Memory state around the buggy address:
[   18.057554]  fff00000c68f1300: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   18.057597]  fff00000c68f1380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.057671] >fff00000c68f1400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   18.057723]                                                                 ^
[   18.057768]  fff00000c68f1480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.057809]  fff00000c68f1500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.057854] ==================================================================


[   14.178086] ==================================================================
[   14.178539] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_4+0x166/0x330
[   14.179323] Write of size 4 at addr ffff8881022f9e75 by task kunit_try_catch/192
[   14.179874] 
[   14.180130] CPU: 1 UID: 0 PID: 192 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250515 #1 PREEMPT(voluntary) 
[   14.180236] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.180261] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.180300] Call Trace:
[   14.180355]  <TASK>
[   14.180391]  dump_stack_lvl+0x73/0xb0
[   14.180512]  print_report+0xd1/0x650
[   14.180562]  ? __virt_addr_valid+0x1db/0x2d0
[   14.180614]  ? kmalloc_oob_memset_4+0x166/0x330
[   14.180655]  ? kasan_complete_mode_report_info+0x2a/0x200
[   14.180687]  ? kmalloc_oob_memset_4+0x166/0x330
[   14.180709]  kasan_report+0x141/0x180
[   14.180732]  ? kmalloc_oob_memset_4+0x166/0x330
[   14.180758]  kasan_check_range+0x10c/0x1c0
[   14.180781]  __asan_memset+0x27/0x50
[   14.180800]  kmalloc_oob_memset_4+0x166/0x330
[   14.180822]  ? __pfx_kmalloc_oob_memset_4+0x10/0x10
[   14.180844]  ? __schedule+0x10cc/0x2b60
[   14.180867]  ? __pfx_read_tsc+0x10/0x10
[   14.180888]  ? ktime_get_ts64+0x86/0x230
[   14.180913]  kunit_try_run_case+0x1a5/0x480
[   14.180939]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.180960]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   14.180982]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.181003]  ? __kthread_parkme+0x82/0x180
[   14.181025]  ? preempt_count_sub+0x50/0x80
[   14.181050]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.181072]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.181095]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.181117]  kthread+0x337/0x6f0
[   14.181136]  ? trace_preempt_on+0x20/0xc0
[   14.181159]  ? __pfx_kthread+0x10/0x10
[   14.181179]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.181199]  ? calculate_sigpending+0x7b/0xa0
[   14.181242]  ? __pfx_kthread+0x10/0x10
[   14.181287]  ret_from_fork+0x116/0x1d0
[   14.181314]  ? __pfx_kthread+0x10/0x10
[   14.181362]  ret_from_fork_asm+0x1a/0x30
[   14.181407]  </TASK>
[   14.181421] 
[   14.191920] Allocated by task 192:
[   14.192062]  kasan_save_stack+0x45/0x70
[   14.192209]  kasan_save_track+0x18/0x40
[   14.192385]  kasan_save_alloc_info+0x3b/0x50
[   14.192785]  __kasan_kmalloc+0xb7/0xc0
[   14.193132]  __kmalloc_cache_noprof+0x189/0x420
[   14.193479]  kmalloc_oob_memset_4+0xac/0x330
[   14.193849]  kunit_try_run_case+0x1a5/0x480
[   14.194047]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.194259]  kthread+0x337/0x6f0
[   14.194547]  ret_from_fork+0x116/0x1d0
[   14.194857]  ret_from_fork_asm+0x1a/0x30
[   14.195173] 
[   14.196485] The buggy address belongs to the object at ffff8881022f9e00
[   14.196485]  which belongs to the cache kmalloc-128 of size 128
[   14.197351] The buggy address is located 117 bytes inside of
[   14.197351]  allocated 120-byte region [ffff8881022f9e00, ffff8881022f9e78)
[   14.198339] 
[   14.198516] The buggy address belongs to the physical page:
[   14.198721] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1022f9
[   14.198967] flags: 0x200000000000000(node=0|zone=2)
[   14.199364] page_type: f5(slab)
[   14.199655] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   14.200104] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   14.200805] page dumped because: kasan: bad access detected
[   14.201176] 
[   14.201279] Memory state around the buggy address:
[   14.201470]  ffff8881022f9d00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   14.202464]  ffff8881022f9d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.202987] >ffff8881022f9e00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   14.203300]                                                                 ^
[   14.203886]  ffff8881022f9e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.204243]  ffff8881022f9f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.204907] ==================================================================