Hay
Date
May 26, 2025, 9:10 a.m.

Environment
qemu-x86_64

[   10.343874] ==================================================================
[   10.344344] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_left+0x361/0x3c0
[   10.344594] Read of size 1 at addr ffff888101892cdf by task kunit_try_catch/156
[   10.344839] 
[   10.344929] CPU: 0 UID: 0 PID: 156 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc7-next-20250526 #1 PREEMPT(voluntary) 
[   10.344976] Tainted: [B]=BAD_PAGE, [N]=TEST
[   10.344988] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   10.345009] Call Trace:
[   10.345021]  <TASK>
[   10.345038]  dump_stack_lvl+0x73/0xb0
[   10.345108]  print_report+0xd1/0x650
[   10.345131]  ? __virt_addr_valid+0x1db/0x2d0
[   10.345167]  ? kmalloc_oob_left+0x361/0x3c0
[   10.345187]  ? kasan_complete_mode_report_info+0x2a/0x200
[   10.345209]  ? kmalloc_oob_left+0x361/0x3c0
[   10.345231]  kasan_report+0x141/0x180
[   10.345253]  ? kmalloc_oob_left+0x361/0x3c0
[   10.345278]  __asan_report_load1_noabort+0x18/0x20
[   10.345299]  kmalloc_oob_left+0x361/0x3c0
[   10.345320]  ? __pfx_kmalloc_oob_left+0x10/0x10
[   10.345342]  ? __schedule+0x10cc/0x2b60
[   10.345367]  ? __pfx_read_tsc+0x10/0x10
[   10.345397]  ? ktime_get_ts64+0x86/0x230
[   10.345422]  kunit_try_run_case+0x1a5/0x480
[   10.345444]  ? __pfx_kunit_try_run_case+0x10/0x10
[   10.345481]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   10.345506]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   10.345544]  ? __kthread_parkme+0x82/0x180
[   10.345564]  ? preempt_count_sub+0x50/0x80
[   10.345587]  ? __pfx_kunit_try_run_case+0x10/0x10
[   10.345617]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   10.345640]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   10.345664]  kthread+0x337/0x6f0
[   10.345693]  ? trace_preempt_on+0x20/0xc0
[   10.345719]  ? __pfx_kthread+0x10/0x10
[   10.345739]  ? _raw_spin_unlock_irq+0x47/0x80
[   10.345772]  ? calculate_sigpending+0x7b/0xa0
[   10.345796]  ? __pfx_kthread+0x10/0x10
[   10.345817]  ret_from_fork+0x116/0x1d0
[   10.345834]  ? __pfx_kthread+0x10/0x10
[   10.345855]  ret_from_fork_asm+0x1a/0x30
[   10.345885]  </TASK>
[   10.345895] 
[   10.353997] Allocated by task 1:
[   10.354212]  kasan_save_stack+0x45/0x70
[   10.354412]  kasan_save_track+0x18/0x40
[   10.354667]  kasan_save_alloc_info+0x3b/0x50
[   10.354918]  __kasan_kmalloc+0xb7/0xc0
[   10.355116]  __kmalloc_node_track_caller_noprof+0x1cb/0x500
[   10.355298]  kvasprintf+0xc5/0x150
[   10.355449]  __kthread_create_on_node+0x18b/0x3a0
[   10.355679]  kthread_create_on_node+0xab/0xe0
[   10.355895]  create_worker+0x3e5/0x7b0
[   10.356068]  alloc_unbound_pwq+0x8ea/0xdb0
[   10.356246]  apply_wqattrs_prepare+0x332/0xd20
[   10.356405]  apply_workqueue_attrs_locked+0x4d/0xa0
[   10.356564]  alloc_workqueue+0xcc7/0x1ad0
[   10.356710]  latency_fsnotify_init+0x1b/0x50
[   10.356933]  do_one_initcall+0xd8/0x370
[   10.357277]  kernel_init_freeable+0x420/0x6f0
[   10.357602]  kernel_init+0x23/0x1e0
[   10.357863]  ret_from_fork+0x116/0x1d0
[   10.358417]  ret_from_fork_asm+0x1a/0x30
[   10.358903] 
[   10.359409] The buggy address belongs to the object at ffff888101892cc0
[   10.359409]  which belongs to the cache kmalloc-16 of size 16
[   10.361005] The buggy address is located 18 bytes to the right of
[   10.361005]  allocated 13-byte region [ffff888101892cc0, ffff888101892ccd)
[   10.361405] 
[   10.361510] The buggy address belongs to the physical page:
[   10.362411] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101892
[   10.363134] flags: 0x200000000000000(node=0|zone=2)
[   10.363303] page_type: f5(slab)
[   10.363440] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   10.363667] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   10.364500] page dumped because: kasan: bad access detected
[   10.365105] 
[   10.365282] Memory state around the buggy address:
[   10.365731]  ffff888101892b80: fa fb fc fc 00 02 fc fc 00 05 fc fc 00 02 fc fc
[   10.366587]  ffff888101892c00: 00 02 fc fc 00 02 fc fc 00 02 fc fc fa fb fc fc
[   10.367160] >ffff888101892c80: fa fb fc fc fa fb fc fc 00 05 fc fc 00 07 fc fc
[   10.367392]                                                     ^
[   10.367581]  ffff888101892d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   10.367924]  ffff888101892d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   10.368674] ==================================================================