Hay
Date
July 1, 2025, 11:08 a.m.

Environment
qemu-arm64
qemu-x86_64

[   18.113168] ==================================================================
[   18.113264] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_left+0x2ec/0x320
[   18.113778] Read of size 1 at addr fff00000c5d4d99f by task kunit_try_catch/139
[   18.113859] 
[   18.113906] CPU: 1 UID: 0 PID: 139 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   18.114428] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.114521] Hardware name: linux,dummy-virt (DT)
[   18.114672] Call trace:
[   18.114734]  show_stack+0x20/0x38 (C)
[   18.114799]  dump_stack_lvl+0x8c/0xd0
[   18.114898]  print_report+0x118/0x608
[   18.114968]  kasan_report+0xdc/0x128
[   18.115064]  __asan_report_load1_noabort+0x20/0x30
[   18.115237]  kmalloc_oob_left+0x2ec/0x320
[   18.115316]  kunit_try_run_case+0x170/0x3f0
[   18.115497]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.115730]  kthread+0x328/0x630
[   18.115875]  ret_from_fork+0x10/0x20
[   18.116006] 
[   18.116150] Allocated by task 24:
[   18.116186]  kasan_save_stack+0x3c/0x68
[   18.116232]  kasan_save_track+0x20/0x40
[   18.116271]  kasan_save_alloc_info+0x40/0x58
[   18.116338]  __kasan_kmalloc+0xd4/0xd8
[   18.116377]  __kmalloc_node_track_caller_noprof+0x194/0x4b8
[   18.116425]  kvasprintf+0xe0/0x180
[   18.116491]  __kthread_create_on_node+0x16c/0x350
[   18.116532]  kthread_create_on_node+0xe4/0x130
[   18.116571]  create_worker+0x380/0x6b8
[   18.116608]  worker_thread+0x808/0xf38
[   18.116644]  kthread+0x328/0x630
[   18.116677]  ret_from_fork+0x10/0x20
[   18.116871] 
[   18.116926] The buggy address belongs to the object at fff00000c5d4d980
[   18.116926]  which belongs to the cache kmalloc-16 of size 16
[   18.117044] The buggy address is located 19 bytes to the right of
[   18.117044]  allocated 12-byte region [fff00000c5d4d980, fff00000c5d4d98c)
[   18.117240] 
[   18.117365] The buggy address belongs to the physical page:
[   18.117500] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105d4d
[   18.117643] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.117790] page_type: f5(slab)
[   18.117991] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   18.118183] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   18.118263] page dumped because: kasan: bad access detected
[   18.118338] 
[   18.118486] Memory state around the buggy address:
[   18.118555]  fff00000c5d4d880: 00 05 fc fc fa fb fc fc 00 02 fc fc fa fb fc fc
[   18.118625]  fff00000c5d4d900: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   18.118685] >fff00000c5d4d980: 00 04 fc fc 00 07 fc fc fc fc fc fc fc fc fc fc
[   18.118792]                             ^
[   18.118837]  fff00000c5d4da00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.118912]  fff00000c5d4da80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.118984] ==================================================================

[   10.870926] ==================================================================
[   10.871399] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_left+0x361/0x3c0
[   10.872145] Read of size 1 at addr ffff88810228a7df by task kunit_try_catch/155
[   10.872951] 
[   10.873223] CPU: 1 UID: 0 PID: 155 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   10.873271] Tainted: [B]=BAD_PAGE, [N]=TEST
[   10.873282] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   10.873303] Call Trace:
[   10.873317]  <TASK>
[   10.873336]  dump_stack_lvl+0x73/0xb0
[   10.873413]  print_report+0xd1/0x650
[   10.873436]  ? __virt_addr_valid+0x1db/0x2d0
[   10.873470]  ? kmalloc_oob_left+0x361/0x3c0
[   10.873490]  ? kasan_complete_mode_report_info+0x2a/0x200
[   10.873511]  ? kmalloc_oob_left+0x361/0x3c0
[   10.873531]  kasan_report+0x141/0x180
[   10.873551]  ? kmalloc_oob_left+0x361/0x3c0
[   10.873589]  __asan_report_load1_noabort+0x18/0x20
[   10.873611]  kmalloc_oob_left+0x361/0x3c0
[   10.873632]  ? __pfx_kmalloc_oob_left+0x10/0x10
[   10.873653]  ? __schedule+0x10cc/0x2b60
[   10.873674]  ? __pfx_read_tsc+0x10/0x10
[   10.873694]  ? ktime_get_ts64+0x86/0x230
[   10.873717]  kunit_try_run_case+0x1a5/0x480
[   10.873741]  ? __pfx_kunit_try_run_case+0x10/0x10
[   10.873762]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   10.873783]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   10.873804]  ? __kthread_parkme+0x82/0x180
[   10.873824]  ? preempt_count_sub+0x50/0x80
[   10.873846]  ? __pfx_kunit_try_run_case+0x10/0x10
[   10.873868]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   10.873889]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   10.873911]  kthread+0x337/0x6f0
[   10.873929]  ? trace_preempt_on+0x20/0xc0
[   10.873952]  ? __pfx_kthread+0x10/0x10
[   10.873971]  ? _raw_spin_unlock_irq+0x47/0x80
[   10.873990]  ? calculate_sigpending+0x7b/0xa0
[   10.874012]  ? __pfx_kthread+0x10/0x10
[   10.874032]  ret_from_fork+0x116/0x1d0
[   10.874049]  ? __pfx_kthread+0x10/0x10
[   10.874068]  ret_from_fork_asm+0x1a/0x30
[   10.874098]  </TASK>
[   10.874109] 
[   10.884570] Allocated by task 1:
[   10.884771]  kasan_save_stack+0x45/0x70
[   10.884993]  kasan_save_track+0x18/0x40
[   10.885170]  kasan_save_alloc_info+0x3b/0x50
[   10.885314]  __kasan_kmalloc+0xb7/0xc0
[   10.885450]  __kmalloc_node_track_caller_noprof+0x1cb/0x500
[   10.885864]  kstrdup+0x3e/0xa0
[   10.886043]  kstrdup_const+0x2c/0x40
[   10.886235]  __kernfs_new_node+0xa7/0x6d0
[   10.886401]  kernfs_new_node+0x140/0x1e0
[   10.886533]  __kernfs_create_file+0x2d/0x290
[   10.886718]  sysfs_add_bin_file_mode_ns+0x13f/0x4f0
[   10.886959]  sysfs_create_bin_file+0x150/0x200
[   10.887171]  pci_create_attr+0x1e2/0x460
[   10.887435]  pci_create_resource_files+0xb0/0x160
[   10.887657]  pci_sysfs_init+0x32/0x90
[   10.887850]  do_one_initcall+0xd8/0x370
[   10.888065]  kernel_init_freeable+0x420/0x6f0
[   10.888269]  kernel_init+0x23/0x1e0
[   10.888403]  ret_from_fork+0x116/0x1d0
[   10.888543]  ret_from_fork_asm+0x1a/0x30
[   10.888773] 
[   10.888881] The buggy address belongs to the object at ffff88810228a7c0
[   10.888881]  which belongs to the cache kmalloc-16 of size 16
[   10.889364] The buggy address is located 21 bytes to the right of
[   10.889364]  allocated 10-byte region [ffff88810228a7c0, ffff88810228a7ca)
[   10.889971] 
[   10.890075] The buggy address belongs to the physical page:
[   10.890321] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10228a
[   10.890680] flags: 0x200000000000000(node=0|zone=2)
[   10.890921] page_type: f5(slab)
[   10.891087] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   10.891423] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   10.891798] page dumped because: kasan: bad access detected
[   10.892045] 
[   10.892140] Memory state around the buggy address:
[   10.892353]  ffff88810228a680: 00 05 fc fc 00 05 fc fc 00 02 fc fc 00 03 fc fc
[   10.892703]  ffff88810228a700: fa fb fc fc 00 02 fc fc 00 05 fc fc 00 02 fc fc
[   10.893024] >ffff88810228a780: 00 02 fc fc 00 02 fc fc 00 02 fc fc 00 07 fc fc
[   10.893331]                                                     ^
[   10.893528]  ffff88810228a800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   10.893739]  ffff88810228a880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   10.893954] ==================================================================