Hay
Date
June 5, 2025, 7:08 a.m.

Environment
qemu-arm64
qemu-x86_64

[   25.236037] ==================================================================
[   25.236480] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_4+0x150/0x300
[   25.236644] Write of size 4 at addr fff00000c6419475 by task kunit_try_catch/174
[   25.236848] 
[   25.238001] CPU: 0 UID: 0 PID: 174 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250605 #1 PREEMPT 
[   25.238280] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.238428] Hardware name: linux,dummy-virt (DT)
[   25.238672] Call trace:
[   25.238732]  show_stack+0x20/0x38 (C)
[   25.238848]  dump_stack_lvl+0x8c/0xd0
[   25.238961]  print_report+0x118/0x608
[   25.239110]  kasan_report+0xdc/0x128
[   25.239382]  kasan_check_range+0x100/0x1a8
[   25.239519]  __asan_memset+0x34/0x78
[   25.239648]  kmalloc_oob_memset_4+0x150/0x300
[   25.239868]  kunit_try_run_case+0x170/0x3f0
[   25.240867]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   25.241245]  kthread+0x328/0x630
[   25.243379]  ret_from_fork+0x10/0x20
[   25.243459] 
[   25.243483] Allocated by task 174:
[   25.243518]  kasan_save_stack+0x3c/0x68
[   25.243615]  kasan_save_track+0x20/0x40
[   25.243671]  kasan_save_alloc_info+0x40/0x58
[   25.243723]  __kasan_kmalloc+0xd4/0xd8
[   25.243769]  __kmalloc_cache_noprof+0x16c/0x3c0
[   25.243821]  kmalloc_oob_memset_4+0xb0/0x300
[   25.243897]  kunit_try_run_case+0x170/0x3f0
[   25.243951]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   25.244008]  kthread+0x328/0x630
[   25.244048]  ret_from_fork+0x10/0x20
[   25.244093] 
[   25.244118] The buggy address belongs to the object at fff00000c6419400
[   25.244118]  which belongs to the cache kmalloc-128 of size 128
[   25.244188] The buggy address is located 117 bytes inside of
[   25.244188]  allocated 120-byte region [fff00000c6419400, fff00000c6419478)
[   25.244263] 
[   25.244287] The buggy address belongs to the physical page:
[   25.244324] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106419
[   25.244510] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   25.245008] page_type: f5(slab)
[   25.245110] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   25.245593] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   25.245700] page dumped because: kasan: bad access detected
[   25.245775] 
[   25.245817] Memory state around the buggy address:
[   25.245899]  fff00000c6419300: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   25.246009]  fff00000c6419380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.246153] >fff00000c6419400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   25.246260]                                                                 ^
[   25.246576]  fff00000c6419480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.246745]  fff00000c6419500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.247002] ==================================================================


[   11.487265] ==================================================================
[   11.487757] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_4+0x166/0x330
[   11.488161] Write of size 4 at addr ffff888102b2d375 by task kunit_try_catch/191
[   11.488459] 
[   11.488571] CPU: 0 UID: 0 PID: 191 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250605 #1 PREEMPT(voluntary) 
[   11.488615] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.488626] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.488647] Call Trace:
[   11.488660]  <TASK>
[   11.488675]  dump_stack_lvl+0x73/0xb0
[   11.488702]  print_report+0xd1/0x650
[   11.488724]  ? __virt_addr_valid+0x1db/0x2d0
[   11.488748]  ? kmalloc_oob_memset_4+0x166/0x330
[   11.488782]  ? kasan_complete_mode_report_info+0x2a/0x200
[   11.488804]  ? kmalloc_oob_memset_4+0x166/0x330
[   11.488826]  kasan_report+0x141/0x180
[   11.488847]  ? kmalloc_oob_memset_4+0x166/0x330
[   11.488873]  kasan_check_range+0x10c/0x1c0
[   11.488907]  __asan_memset+0x27/0x50
[   11.488927]  kmalloc_oob_memset_4+0x166/0x330
[   11.488993]  ? __kasan_check_write+0x18/0x20
[   11.489015]  ? __pfx_kmalloc_oob_memset_4+0x10/0x10
[   11.489036]  ? sysvec_apic_timer_interrupt+0x50/0x90
[   11.489067]  ? trace_hardirqs_on+0x37/0xe0
[   11.489090]  ? __pfx_read_tsc+0x10/0x10
[   11.489112]  ? ktime_get_ts64+0x86/0x230
[   11.489135]  kunit_try_run_case+0x1a5/0x480
[   11.489157]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.489178]  ? queued_spin_lock_slowpath+0x116/0xb40
[   11.489203]  ? __kthread_parkme+0x82/0x180
[   11.489223]  ? preempt_count_sub+0x50/0x80
[   11.489246]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.489267]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.489292]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.489315]  kthread+0x337/0x6f0
[   11.489334]  ? trace_preempt_on+0x20/0xc0
[   11.489355]  ? __pfx_kthread+0x10/0x10
[   11.489375]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.489397]  ? calculate_sigpending+0x7b/0xa0
[   11.489420]  ? __pfx_kthread+0x10/0x10
[   11.489440]  ret_from_fork+0x116/0x1d0
[   11.489458]  ? __pfx_kthread+0x10/0x10
[   11.489478]  ret_from_fork_asm+0x1a/0x30
[   11.489508]  </TASK>
[   11.489519] 
[   11.497306] Allocated by task 191:
[   11.497441]  kasan_save_stack+0x45/0x70
[   11.497587]  kasan_save_track+0x18/0x40
[   11.497723]  kasan_save_alloc_info+0x3b/0x50
[   11.497965]  __kasan_kmalloc+0xb7/0xc0
[   11.498155]  __kmalloc_cache_noprof+0x189/0x420
[   11.498377]  kmalloc_oob_memset_4+0xac/0x330
[   11.498596]  kunit_try_run_case+0x1a5/0x480
[   11.498819]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.499433]  kthread+0x337/0x6f0
[   11.499610]  ret_from_fork+0x116/0x1d0
[   11.499810]  ret_from_fork_asm+0x1a/0x30
[   11.500068] 
[   11.500164] The buggy address belongs to the object at ffff888102b2d300
[   11.500164]  which belongs to the cache kmalloc-128 of size 128
[   11.500677] The buggy address is located 117 bytes inside of
[   11.500677]  allocated 120-byte region [ffff888102b2d300, ffff888102b2d378)
[   11.501205] 
[   11.501304] The buggy address belongs to the physical page:
[   11.501565] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102b2d
[   11.501866] flags: 0x200000000000000(node=0|zone=2)
[   11.502040] page_type: f5(slab)
[   11.502162] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   11.502392] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   11.502723] page dumped because: kasan: bad access detected
[   11.503327] 
[   11.503436] Memory state around the buggy address:
[   11.503680]  ffff888102b2d200: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   11.503917]  ffff888102b2d280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.504523] >ffff888102b2d300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   11.504800]                                                                 ^
[   11.505180]  ffff888102b2d380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.505638]  ffff888102b2d400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.505922] ==================================================================