Hay
Date
July 22, 2025, 5:13 a.m.

Environment
qemu-x86_64

[   25.150925] ==================================================================
[   25.151411] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_in_memset+0x15f/0x320
[   25.151756] Write of size 128 at addr ffff8881058a9200 by task kunit_try_catch/218
[   25.152104] 
[   25.152226] CPU: 1 UID: 0 PID: 218 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7-next-20250722 #1 PREEMPT(voluntary) 
[   25.152274] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.152287] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   25.152307] Call Trace:
[   25.152320]  <TASK>
[   25.152335]  dump_stack_lvl+0x73/0xb0
[   25.152364]  print_report+0xd1/0x640
[   25.152407]  ? __virt_addr_valid+0x1db/0x2d0
[   25.152430]  ? kmalloc_oob_in_memset+0x15f/0x320
[   25.152466]  ? kasan_complete_mode_report_info+0x2a/0x200
[   25.152493]  ? kmalloc_oob_in_memset+0x15f/0x320
[   25.152515]  kasan_report+0x141/0x180
[   25.152551]  ? kmalloc_oob_in_memset+0x15f/0x320
[   25.152592]  kasan_check_range+0x10c/0x1c0
[   25.152669]  __asan_memset+0x27/0x50
[   25.152697]  kmalloc_oob_in_memset+0x15f/0x320
[   25.152720]  ? __pfx_kmalloc_oob_in_memset+0x10/0x10
[   25.152743]  ? __schedule+0x10da/0x2b60
[   25.152768]  ? __pfx_read_tsc+0x10/0x10
[   25.152790]  ? ktime_get_ts64+0x86/0x230
[   25.152815]  kunit_try_run_case+0x1a5/0x480
[   25.152852]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.152881]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   25.152906]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   25.152930]  ? __kthread_parkme+0x82/0x180
[   25.152950]  ? preempt_count_sub+0x50/0x80
[   25.152973]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.152997]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.153021]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   25.153044]  kthread+0x337/0x6f0
[   25.153064]  ? trace_preempt_on+0x20/0xc0
[   25.153087]  ? __pfx_kthread+0x10/0x10
[   25.153107]  ? _raw_spin_unlock_irq+0x47/0x80
[   25.153132]  ? calculate_sigpending+0x7b/0xa0
[   25.153155]  ? __pfx_kthread+0x10/0x10
[   25.153190]  ret_from_fork+0x116/0x1d0
[   25.153211]  ? __pfx_kthread+0x10/0x10
[   25.153232]  ret_from_fork_asm+0x1a/0x30
[   25.153263]  </TASK>
[   25.153274] 
[   25.165135] Allocated by task 218:
[   25.165458]  kasan_save_stack+0x45/0x70
[   25.165822]  kasan_save_track+0x18/0x40
[   25.166253]  kasan_save_alloc_info+0x3b/0x50
[   25.166868]  __kasan_kmalloc+0xb7/0xc0
[   25.167265]  __kmalloc_cache_noprof+0x189/0x420
[   25.167745]  kmalloc_oob_in_memset+0xac/0x320
[   25.168151]  kunit_try_run_case+0x1a5/0x480
[   25.168585]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.169113]  kthread+0x337/0x6f0
[   25.169418]  ret_from_fork+0x116/0x1d0
[   25.169564]  ret_from_fork_asm+0x1a/0x30
[   25.169930] 
[   25.170102] The buggy address belongs to the object at ffff8881058a9200
[   25.170102]  which belongs to the cache kmalloc-128 of size 128
[   25.170900] The buggy address is located 0 bytes inside of
[   25.170900]  allocated 120-byte region [ffff8881058a9200, ffff8881058a9278)
[   25.171489] 
[   25.171648] The buggy address belongs to the physical page:
[   25.172243] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1058a9
[   25.173152] flags: 0x200000000000000(node=0|zone=2)
[   25.173800] page_type: f5(slab)
[   25.174138] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   25.174638] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   25.175303] page dumped because: kasan: bad access detected
[   25.175627] 
[   25.175697] Memory state around the buggy address:
[   25.175859]  ffff8881058a9100: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   25.176071]  ffff8881058a9180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.176725] >ffff8881058a9200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   25.177396]                                                                 ^
[   25.178174]  ffff8881058a9280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.178962]  ffff8881058a9300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.179685] ==================================================================