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

Environment
qemu-arm64
qemu-x86_64

[   31.158168] ==================================================================
[   31.158260] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_2+0x150/0x2f8
[   31.158317] Write of size 2 at addr fff00000c9a9c377 by task kunit_try_catch/203
[   31.158370] 
[   31.158400] CPU: 0 UID: 0 PID: 203 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5-next-20250708 #1 PREEMPT 
[   31.158489] Tainted: [B]=BAD_PAGE, [N]=TEST
[   31.158515] Hardware name: linux,dummy-virt (DT)
[   31.158544] Call trace:
[   31.158575]  show_stack+0x20/0x38 (C)
[   31.158630]  dump_stack_lvl+0x8c/0xd0
[   31.158677]  print_report+0x118/0x5d0
[   31.158723]  kasan_report+0xdc/0x128
[   31.158769]  kasan_check_range+0x100/0x1a8
[   31.158814]  __asan_memset+0x34/0x78
[   31.158856]  kmalloc_oob_memset_2+0x150/0x2f8
[   31.159084]  kunit_try_run_case+0x170/0x3f0
[   31.159142]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.159217]  kthread+0x328/0x630
[   31.159261]  ret_from_fork+0x10/0x20
[   31.159329] 
[   31.159358] Allocated by task 203:
[   31.159386]  kasan_save_stack+0x3c/0x68
[   31.159428]  kasan_save_track+0x20/0x40
[   31.159484]  kasan_save_alloc_info+0x40/0x58
[   31.159521]  __kasan_kmalloc+0xd4/0xd8
[   31.159574]  __kmalloc_cache_noprof+0x16c/0x3c0
[   31.159633]  kmalloc_oob_memset_2+0xb0/0x2f8
[   31.159671]  kunit_try_run_case+0x170/0x3f0
[   31.159719]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.159763]  kthread+0x328/0x630
[   31.159795]  ret_from_fork+0x10/0x20
[   31.159830] 
[   31.159848] The buggy address belongs to the object at fff00000c9a9c300
[   31.159848]  which belongs to the cache kmalloc-128 of size 128
[   31.159902] The buggy address is located 119 bytes inside of
[   31.159902]  allocated 120-byte region [fff00000c9a9c300, fff00000c9a9c378)
[   31.159963] 
[   31.159982] The buggy address belongs to the physical page:
[   31.160011] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109a9c
[   31.160083] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   31.160128] page_type: f5(slab)
[   31.160296] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   31.160376] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   31.160417] page dumped because: kasan: bad access detected
[   31.160449] 
[   31.160483] Memory state around the buggy address:
[   31.160521]  fff00000c9a9c200: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   31.160670]  fff00000c9a9c280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.160712] >fff00000c9a9c300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   31.160749]                                                                 ^
[   31.160788]  fff00000c9a9c380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.160842]  fff00000c9a9c400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.160904] ==================================================================

[   23.419011] ==================================================================
[   23.419558] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_2+0x166/0x330
[   23.420486] Write of size 2 at addr ffff8881059ac677 by task kunit_try_catch/220
[   23.420842] 
[   23.421224] CPU: 0 UID: 0 PID: 220 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5-next-20250708 #1 PREEMPT(voluntary) 
[   23.421296] Tainted: [B]=BAD_PAGE, [N]=TEST
[   23.421308] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   23.421331] Call Trace:
[   23.421345]  <TASK>
[   23.421364]  dump_stack_lvl+0x73/0xb0
[   23.421398]  print_report+0xd1/0x610
[   23.421421]  ? __virt_addr_valid+0x1db/0x2d0
[   23.421446]  ? kmalloc_oob_memset_2+0x166/0x330
[   23.421469]  ? kasan_complete_mode_report_info+0x2a/0x200
[   23.421499]  ? kmalloc_oob_memset_2+0x166/0x330
[   23.421521]  kasan_report+0x141/0x180
[   23.421545]  ? kmalloc_oob_memset_2+0x166/0x330
[   23.421571]  kasan_check_range+0x10c/0x1c0
[   23.421598]  __asan_memset+0x27/0x50
[   23.421625]  kmalloc_oob_memset_2+0x166/0x330
[   23.421648]  ? __pfx_kmalloc_oob_memset_2+0x10/0x10
[   23.421671]  ? __schedule+0x10cc/0x2b60
[   23.421700]  ? __pfx_read_tsc+0x10/0x10
[   23.421726]  ? ktime_get_ts64+0x86/0x230
[   23.421772]  kunit_try_run_case+0x1a5/0x480
[   23.421797]  ? __pfx_kunit_try_run_case+0x10/0x10
[   23.421826]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   23.421849]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   23.421880]  ? __kthread_parkme+0x82/0x180
[   23.421902]  ? preempt_count_sub+0x50/0x80
[   23.421927]  ? __pfx_kunit_try_run_case+0x10/0x10
[   23.421950]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   23.421977]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   23.422004]  kthread+0x337/0x6f0
[   23.422026]  ? trace_preempt_on+0x20/0xc0
[   23.422051]  ? __pfx_kthread+0x10/0x10
[   23.422074]  ? _raw_spin_unlock_irq+0x47/0x80
[   23.422101]  ? calculate_sigpending+0x7b/0xa0
[   23.422128]  ? __pfx_kthread+0x10/0x10
[   23.422152]  ret_from_fork+0x116/0x1d0
[   23.422172]  ? __pfx_kthread+0x10/0x10
[   23.422194]  ret_from_fork_asm+0x1a/0x30
[   23.422229]  </TASK>
[   23.422251] 
[   23.429819] Allocated by task 220:
[   23.430009]  kasan_save_stack+0x45/0x70
[   23.430208]  kasan_save_track+0x18/0x40
[   23.430362]  kasan_save_alloc_info+0x3b/0x50
[   23.430569]  __kasan_kmalloc+0xb7/0xc0
[   23.430703]  __kmalloc_cache_noprof+0x189/0x420
[   23.431071]  kmalloc_oob_memset_2+0xac/0x330
[   23.431284]  kunit_try_run_case+0x1a5/0x480
[   23.431435]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   23.431606]  kthread+0x337/0x6f0
[   23.431975]  ret_from_fork+0x116/0x1d0
[   23.432181]  ret_from_fork_asm+0x1a/0x30
[   23.432481] 
[   23.432573] The buggy address belongs to the object at ffff8881059ac600
[   23.432573]  which belongs to the cache kmalloc-128 of size 128
[   23.433153] The buggy address is located 119 bytes inside of
[   23.433153]  allocated 120-byte region [ffff8881059ac600, ffff8881059ac678)
[   23.433654] 
[   23.433747] The buggy address belongs to the physical page:
[   23.434041] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1059ac
[   23.434356] flags: 0x200000000000000(node=0|zone=2)
[   23.434516] page_type: f5(slab)
[   23.434634] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   23.434859] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   23.435145] page dumped because: kasan: bad access detected
[   23.435396] 
[   23.435482] Memory state around the buggy address:
[   23.435783]  ffff8881059ac500: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   23.436057]  ffff8881059ac580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.436279] >ffff8881059ac600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   23.436483]                                                                 ^
[   23.436705]  ffff8881059ac680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.437404]  ffff8881059ac700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.437721] ==================================================================