Hay
Date
Dec. 6, 2024, 3:11 p.m.

Environment
qemu-arm64
qemu-x86_64

[   29.851125] ==================================================================
[   29.852499] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_left+0x2ec/0x320
[   29.853317] Read of size 1 at addr fff00000c5b517ff by task kunit_try_catch/127
[   29.854350] 
[   29.855077] CPU: 0 UID: 0 PID: 127 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241206 #1
[   29.856558] Tainted: [B]=BAD_PAGE, [N]=TEST
[   29.857235] Hardware name: linux,dummy-virt (DT)
[   29.857874] Call trace:
[   29.858692]  show_stack+0x20/0x38 (C)
[   29.859259]  dump_stack_lvl+0x8c/0xd0
[   29.859846]  print_report+0x118/0x5e0
[   29.860475]  kasan_report+0xc8/0x118
[   29.861057]  __asan_report_load1_noabort+0x20/0x30
[   29.861757]  kmalloc_oob_left+0x2ec/0x320
[   29.862598]  kunit_try_run_case+0x14c/0x3d0
[   29.863247]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.864037]  kthread+0x24c/0x2d0
[   29.864760]  ret_from_fork+0x10/0x20
[   29.865334] 
[   29.865693] Allocated by task 28:
[   29.866552]  kasan_save_stack+0x3c/0x68
[   29.867163]  kasan_save_track+0x20/0x40
[   29.867721]  kasan_save_alloc_info+0x40/0x58
[   29.868335]  __kasan_kmalloc+0xd4/0xd8
[   29.868908]  __kmalloc_node_track_caller_noprof+0x184/0x4b8
[   29.869576]  kstrdup+0x54/0xc8
[   29.870132]  devtmpfs_work_loop+0x384/0x590
[   29.871118]  devtmpfsd+0x50/0x58
[   29.871660]  kthread+0x24c/0x2d0
[   29.872158]  ret_from_fork+0x10/0x20
[   29.872728] 
[   29.873131] Freed by task 28:
[   29.873690]  kasan_save_stack+0x3c/0x68
[   29.874797]  kasan_save_track+0x20/0x40
[   29.875693]  kasan_save_free_info+0x4c/0x78
[   29.876256]  __kasan_slab_free+0x6c/0x98
[   29.876773]  kfree+0x114/0x3c8
[   29.877319]  devtmpfs_work_loop+0x498/0x590
[   29.878288]  devtmpfsd+0x50/0x58
[   29.878839]  kthread+0x24c/0x2d0
[   29.879371]  ret_from_fork+0x10/0x20
[   29.879981] 
[   29.880361] The buggy address belongs to the object at fff00000c5b517e0
[   29.880361]  which belongs to the cache kmalloc-16 of size 16
[   29.881656] The buggy address is located 15 bytes to the right of
[   29.881656]  allocated 16-byte region [fff00000c5b517e0, fff00000c5b517f0)
[   29.882957] 
[   29.883305] The buggy address belongs to the physical page:
[   29.884062] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105b51
[   29.884974] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   29.885856] page_type: f5(slab)
[   29.886422] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   29.887811] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   29.888659] page dumped because: kasan: bad access detected
[   29.889302] 
[   29.890003] Memory state around the buggy address:
[   29.890834]  fff00000c5b51680: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   29.891616]  fff00000c5b51700: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   29.892422] >fff00000c5b51780: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   29.893229]                                                                 ^
[   29.894049]  fff00000c5b51800: 00 07 fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.894788]  fff00000c5b51880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.895651] ==================================================================

[   21.921404] ==================================================================
[   21.923519] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_left+0x363/0x3c0
[   21.925867] Read of size 1 at addr ffff888101b3cc5f by task kunit_try_catch/146
[   21.927555] 
[   21.927791] CPU: 0 UID: 0 PID: 146 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241206 #1
[   21.929216] Tainted: [B]=BAD_PAGE, [N]=TEST
[   21.930179] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   21.932130] Call Trace:
[   21.932737]  <TASK>
[   21.933590]  dump_stack_lvl+0x73/0xb0
[   21.934531]  print_report+0xd1/0x640
[   21.934994]  ? __virt_addr_valid+0x1db/0x2d0
[   21.936190]  ? kasan_complete_mode_report_info+0x2a/0x200
[   21.936686]  kasan_report+0x102/0x140
[   21.937216]  ? kmalloc_oob_left+0x363/0x3c0
[   21.937628]  ? kmalloc_oob_left+0x363/0x3c0
[   21.939030]  __asan_report_load1_noabort+0x18/0x20
[   21.940371]  kmalloc_oob_left+0x363/0x3c0
[   21.941135]  ? __pfx_kmalloc_oob_left+0x10/0x10
[   21.942724]  ? __schedule+0xc70/0x27e0
[   21.943479]  ? __pfx_read_tsc+0x10/0x10
[   21.943969]  ? ktime_get_ts64+0x86/0x230
[   21.945066]  kunit_try_run_case+0x1b3/0x490
[   21.945609]  ? __pfx_kunit_try_run_case+0x10/0x10
[   21.946133]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   21.946606]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   21.948319]  ? __kthread_parkme+0x82/0x160
[   21.949034]  ? preempt_count_sub+0x50/0x80
[   21.949446]  ? __pfx_kunit_try_run_case+0x10/0x10
[   21.950162]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   21.951054]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   21.951962]  kthread+0x257/0x310
[   21.952895]  ? __pfx_kthread+0x10/0x10
[   21.953516]  ret_from_fork+0x41/0x80
[   21.953846]  ? __pfx_kthread+0x10/0x10
[   21.955057]  ret_from_fork_asm+0x1a/0x30
[   21.955393]  </TASK>
[   21.956305] 
[   21.956553] Allocated by task 1:
[   21.957528]  kasan_save_stack+0x3d/0x60
[   21.958233]  kasan_save_track+0x18/0x40
[   21.959160]  kasan_save_alloc_info+0x3b/0x50
[   21.959869]  __kasan_kmalloc+0xb7/0xc0
[   21.960671]  __kmalloc_node_track_caller_noprof+0x1c6/0x500
[   21.961196]  kvasprintf+0xc6/0x150
[   21.961671]  __kthread_create_on_node+0x18c/0x3a0
[   21.963098]  kthread_create_on_node+0xa8/0xe0
[   21.963688]  create_worker+0x3c8/0x7a0
[   21.964645]  alloc_unbound_pwq+0x8ea/0xdb0
[   21.965064]  apply_wqattrs_prepare+0x332/0xd40
[   21.966026]  apply_workqueue_attrs_locked+0x4d/0xa0
[   21.967266]  alloc_workqueue+0xcc4/0x1ad0
[   21.967587]  latency_fsnotify_init+0x1b/0x50
[   21.967878]  do_one_initcall+0xb5/0x370
[   21.968171]  kernel_init_freeable+0x425/0x6f0
[   21.968455]  kernel_init+0x23/0x1e0
[   21.968717]  ret_from_fork+0x41/0x80
[   21.971011]  ret_from_fork_asm+0x1a/0x30
[   21.971488] 
[   21.971876] The buggy address belongs to the object at ffff888101b3cc40
[   21.971876]  which belongs to the cache kmalloc-16 of size 16
[   21.973757] The buggy address is located 18 bytes to the right of
[   21.973757]  allocated 13-byte region [ffff888101b3cc40, ffff888101b3cc4d)
[   21.976217] 
[   21.976899] The buggy address belongs to the physical page:
[   21.977381] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101b3c
[   21.978567] flags: 0x200000000000000(node=0|zone=2)
[   21.979245] page_type: f5(slab)
[   21.979578] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   21.980012] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   21.980391] page dumped because: kasan: bad access detected
[   21.981538] 
[   21.982576] Memory state around the buggy address:
[   21.983441]  ffff888101b3cb00: 00 05 fc fc 00 02 fc fc 00 03 fc fc fa fb fc fc
[   21.984919]  ffff888101b3cb80: 00 02 fc fc 00 05 fc fc 00 02 fc fc 00 02 fc fc
[   21.985657] >ffff888101b3cc00: 00 02 fc fc 00 02 fc fc 00 05 fc fc 00 07 fc fc
[   21.986325]                                                     ^
[   21.987723]  ffff888101b3cc80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.988483]  ffff888101b3cd00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.989292] ==================================================================