Hay
Date
June 7, 2025, 10:40 a.m.

Environment
qemu-arm64
qemu-x86_64

[   22.530469] ==================================================================
[   22.530647] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_2+0x150/0x2f8
[   22.530807] Write of size 2 at addr fff00000c76c5077 by task kunit_try_catch/176
[   22.530923] 
[   22.531568] CPU: 1 UID: 0 PID: 176 Comm: kunit_try_catch Tainted: G    B            N  6.15.2-rc1 #1 PREEMPT 
[   22.533418] Tainted: [B]=BAD_PAGE, [N]=TEST
[   22.533489] Hardware name: linux,dummy-virt (DT)
[   22.533547] Call trace:
[   22.533597]  show_stack+0x20/0x38 (C)
[   22.533734]  dump_stack_lvl+0x8c/0xd0
[   22.533963]  print_report+0x118/0x608
[   22.534574]  kasan_report+0xdc/0x128
[   22.535112]  kasan_check_range+0x100/0x1a8
[   22.535379]  __asan_memset+0x34/0x78
[   22.535522]  kmalloc_oob_memset_2+0x150/0x2f8
[   22.535766]  kunit_try_run_case+0x170/0x3f0
[   22.536040]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   22.536449]  kthread+0x328/0x630
[   22.536829]  ret_from_fork+0x10/0x20
[   22.537038] 
[   22.537084] Allocated by task 176:
[   22.537546]  kasan_save_stack+0x3c/0x68
[   22.537788]  kasan_save_track+0x20/0x40
[   22.538032]  kasan_save_alloc_info+0x40/0x58
[   22.538434]  __kasan_kmalloc+0xd4/0xd8
[   22.538528]  __kmalloc_cache_noprof+0x16c/0x3c0
[   22.538660]  kmalloc_oob_memset_2+0xb0/0x2f8
[   22.538862]  kunit_try_run_case+0x170/0x3f0
[   22.539208]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   22.539430]  kthread+0x328/0x630
[   22.539516]  ret_from_fork+0x10/0x20
[   22.539646] 
[   22.539726] The buggy address belongs to the object at fff00000c76c5000
[   22.539726]  which belongs to the cache kmalloc-128 of size 128
[   22.540026] The buggy address is located 119 bytes inside of
[   22.540026]  allocated 120-byte region [fff00000c76c5000, fff00000c76c5078)
[   22.540251] 
[   22.540309] The buggy address belongs to the physical page:
[   22.540393] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1076c5
[   22.540547] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   22.540676] page_type: f5(slab)
[   22.540776] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   22.540904] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   22.541569] page dumped because: kasan: bad access detected
[   22.541739] 
[   22.541881] Memory state around the buggy address:
[   22.542011]  fff00000c76c4f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   22.542236]  fff00000c76c4f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   22.542462] >fff00000c76c5000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   22.542826]                                                                 ^
[   22.543017]  fff00000c76c5080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.543222]  fff00000c76c5100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.543337] ==================================================================

[   13.781589] ==================================================================
[   13.782160] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_2+0x166/0x330
[   13.783197] Write of size 2 at addr ffff888102d90d77 by task kunit_try_catch/192
[   13.783664] 
[   13.783829] CPU: 1 UID: 0 PID: 192 Comm: kunit_try_catch Tainted: G    B            N  6.15.2-rc1 #1 PREEMPT(voluntary) 
[   13.784576] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.784593] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.784699] Call Trace:
[   13.784719]  <TASK>
[   13.784740]  dump_stack_lvl+0x73/0xb0
[   13.784781]  print_report+0xd1/0x650
[   13.784804]  ? __virt_addr_valid+0x1db/0x2d0
[   13.784828]  ? kmalloc_oob_memset_2+0x166/0x330
[   13.784848]  ? kasan_complete_mode_report_info+0x2a/0x200
[   13.784868]  ? kmalloc_oob_memset_2+0x166/0x330
[   13.784888]  kasan_report+0x141/0x180
[   13.784908]  ? kmalloc_oob_memset_2+0x166/0x330
[   13.784932]  kasan_check_range+0x10c/0x1c0
[   13.784951]  __asan_memset+0x27/0x50
[   13.784969]  kmalloc_oob_memset_2+0x166/0x330
[   13.784989]  ? __pfx_kmalloc_oob_memset_2+0x10/0x10
[   13.785010]  ? __schedule+0x10cc/0x2b30
[   13.785031]  ? __pfx_read_tsc+0x10/0x10
[   13.785050]  ? ktime_get_ts64+0x86/0x230
[   13.785075]  kunit_try_run_case+0x1a5/0x480
[   13.785098]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.785118]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.785139]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.785159]  ? __kthread_parkme+0x82/0x180
[   13.785180]  ? preempt_count_sub+0x50/0x80
[   13.785204]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.785225]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.785245]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.785265]  kthread+0x337/0x6f0
[   13.785281]  ? trace_preempt_on+0x20/0xc0
[   13.785304]  ? __pfx_kthread+0x10/0x10
[   13.785321]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.785340]  ? calculate_sigpending+0x7b/0xa0
[   13.785361]  ? __pfx_kthread+0x10/0x10
[   13.785378]  ret_from_fork+0x41/0x80
[   13.785397]  ? __pfx_kthread+0x10/0x10
[   13.785415]  ret_from_fork_asm+0x1a/0x30
[   13.785443]  </TASK>
[   13.785455] 
[   13.796438] Allocated by task 192:
[   13.796954]  kasan_save_stack+0x45/0x70
[   13.797291]  kasan_save_track+0x18/0x40
[   13.798427]  kasan_save_alloc_info+0x3b/0x50
[   13.798636]  __kasan_kmalloc+0xb7/0xc0
[   13.799181]  __kmalloc_cache_noprof+0x189/0x420
[   13.799357]  kmalloc_oob_memset_2+0xac/0x330
[   13.800120]  kunit_try_run_case+0x1a5/0x480
[   13.800487]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.800678]  kthread+0x337/0x6f0
[   13.800981]  ret_from_fork+0x41/0x80
[   13.801520]  ret_from_fork_asm+0x1a/0x30
[   13.801988] 
[   13.802182] The buggy address belongs to the object at ffff888102d90d00
[   13.802182]  which belongs to the cache kmalloc-128 of size 128
[   13.803064] The buggy address is located 119 bytes inside of
[   13.803064]  allocated 120-byte region [ffff888102d90d00, ffff888102d90d78)
[   13.804198] 
[   13.804323] The buggy address belongs to the physical page:
[   13.805281] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102d90
[   13.805784] flags: 0x200000000000000(node=0|zone=2)
[   13.806227] page_type: f5(slab)
[   13.806385] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   13.807326] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   13.807604] page dumped because: kasan: bad access detected
[   13.808248] 
[   13.808538] Memory state around the buggy address:
[   13.809117]  ffff888102d90c00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   13.809476]  ffff888102d90c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.810340] >ffff888102d90d00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   13.810605]                                                                 ^
[   13.811241]  ffff888102d90d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.811686]  ffff888102d90e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.812500] ==================================================================