Hay
Date
Dec. 5, 2024, 2:07 p.m.

Environment
qemu-arm64
qemu-x86_64

[   28.842251] ==================================================================
[   28.843578] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_left+0x2ec/0x320
[   28.844666] Read of size 1 at addr fff00000c5f6079f by task kunit_try_catch/127
[   28.846255] 
[   28.846610] CPU: 1 UID: 0 PID: 127 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241205 #1
[   28.847942] Tainted: [B]=BAD_PAGE, [N]=TEST
[   28.848426] Hardware name: linux,dummy-virt (DT)
[   28.849038] Call trace:
[   28.849487]  show_stack+0x20/0x38 (C)
[   28.850102]  dump_stack_lvl+0x8c/0xd0
[   28.850612]  print_report+0x118/0x5e0
[   28.851273]  kasan_report+0xc8/0x118
[   28.851825]  __asan_report_load1_noabort+0x20/0x30
[   28.852515]  kmalloc_oob_left+0x2ec/0x320
[   28.853035]  kunit_try_run_case+0x14c/0x3d0
[   28.853715]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   28.854420]  kthread+0x24c/0x2d0
[   28.855033]  ret_from_fork+0x10/0x20
[   28.855670] 
[   28.855996] Allocated by task 28:
[   28.856517]  kasan_save_stack+0x3c/0x68
[   28.857066]  kasan_save_track+0x20/0x40
[   28.857546]  kasan_save_alloc_info+0x40/0x58
[   28.858265]  __kasan_kmalloc+0xd4/0xd8
[   28.858853]  __kmalloc_node_track_caller_noprof+0x184/0x4b8
[   28.859685]  kstrdup+0x54/0xc8
[   28.860224]  devtmpfs_work_loop+0x384/0x590
[   28.860892]  devtmpfsd+0x50/0x58
[   28.861372]  kthread+0x24c/0x2d0
[   28.861921]  ret_from_fork+0x10/0x20
[   28.862443] 
[   28.862773] Freed by task 28:
[   28.863366]  kasan_save_stack+0x3c/0x68
[   28.864013]  kasan_save_track+0x20/0x40
[   28.864636]  kasan_save_free_info+0x4c/0x78
[   28.865277]  __kasan_slab_free+0x6c/0x98
[   28.865739]  kfree+0x114/0x3c8
[   28.866340]  devtmpfs_work_loop+0x498/0x590
[   28.866988]  devtmpfsd+0x50/0x58
[   28.867467]  kthread+0x24c/0x2d0
[   28.867937]  ret_from_fork+0x10/0x20
[   28.868581] 
[   28.868964] The buggy address belongs to the object at fff00000c5f60780
[   28.868964]  which belongs to the cache kmalloc-16 of size 16
[   28.870401] The buggy address is located 15 bytes to the right of
[   28.870401]  allocated 16-byte region [fff00000c5f60780, fff00000c5f60790)
[   28.871841] 
[   28.872379] The buggy address belongs to the physical page:
[   28.873095] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105f60
[   28.874007] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   28.874817] page_type: f5(slab)
[   28.875317] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   28.876218] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   28.877061] page dumped because: kasan: bad access detected
[   28.877807] 
[   28.878267] Memory state around the buggy address:
[   28.878804]  fff00000c5f60680: fa fb fc fc fa fb fc fc 00 00 fc fc fa fb fc fc
[   28.879772]  fff00000c5f60700: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   28.880616] >fff00000c5f60780: fa fb fc fc 00 07 fc fc fc fc fc fc fc fc fc fc
[   28.881457]                             ^
[   28.881987]  fff00000c5f60800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   28.882808]  fff00000c5f60880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   28.883735] ==================================================================

[   26.385489] ==================================================================
[   26.386523] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_left+0x363/0x3c0
[   26.387209] Read of size 1 at addr ffff888101a5bb9f by task kunit_try_catch/145
[   26.387602] 
[   26.387928] CPU: 0 UID: 0 PID: 145 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241205 #1
[   26.388962] Tainted: [B]=BAD_PAGE, [N]=TEST
[   26.389490] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   26.390360] Call Trace:
[   26.390844]  <TASK>
[   26.391076]  dump_stack_lvl+0x73/0xb0
[   26.391366]  print_report+0xd1/0x640
[   26.392040]  ? __virt_addr_valid+0x1db/0x2d0
[   26.392724]  ? kasan_complete_mode_report_info+0x2a/0x200
[   26.393360]  kasan_report+0x102/0x140
[   26.393958]  ? kmalloc_oob_left+0x363/0x3c0
[   26.394395]  ? kmalloc_oob_left+0x363/0x3c0
[   26.395005]  __asan_report_load1_noabort+0x18/0x20
[   26.395646]  kmalloc_oob_left+0x363/0x3c0
[   26.396380]  ? __pfx_kmalloc_oob_left+0x10/0x10
[   26.396921]  ? __schedule+0xc70/0x27e0
[   26.397410]  ? __pfx_read_tsc+0x10/0x10
[   26.397972]  ? ktime_get_ts64+0x86/0x230
[   26.398508]  kunit_try_run_case+0x1b3/0x490
[   26.398957]  ? __pfx_kunit_try_run_case+0x10/0x10
[   26.399598]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   26.400341]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   26.400873]  ? __kthread_parkme+0x82/0x160
[   26.401551]  ? preempt_count_sub+0x50/0x80
[   26.402111]  ? __pfx_kunit_try_run_case+0x10/0x10
[   26.402549]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   26.403368]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.404124]  kthread+0x257/0x310
[   26.404517]  ? __pfx_kthread+0x10/0x10
[   26.405120]  ret_from_fork+0x41/0x80
[   26.405463]  ? __pfx_kthread+0x10/0x10
[   26.405869]  ret_from_fork_asm+0x1a/0x30
[   26.406593]  </TASK>
[   26.406911] 
[   26.407238] Allocated by task 1:
[   26.407838]  kasan_save_stack+0x3d/0x60
[   26.408291]  kasan_save_track+0x18/0x40
[   26.408701]  kasan_save_alloc_info+0x3b/0x50
[   26.409338]  __kasan_kmalloc+0xb7/0xc0
[   26.409990]  __kmalloc_node_track_caller_noprof+0x1c6/0x500
[   26.410389]  kvasprintf+0xc6/0x150
[   26.411019]  __kthread_create_on_node+0x18c/0x3a0
[   26.411364]  kthread_create_on_node+0xa8/0xe0
[   26.411931]  create_worker+0x3c8/0x7a0
[   26.412294]  alloc_unbound_pwq+0x8ea/0xdb0
[   26.413038]  apply_wqattrs_prepare+0x332/0xd40
[   26.413320]  apply_workqueue_attrs_locked+0x4d/0xa0
[   26.413961]  alloc_workqueue+0xcc4/0x1ad0
[   26.414336]  latency_fsnotify_init+0x1b/0x50
[   26.414880]  do_one_initcall+0xb5/0x370
[   26.415268]  kernel_init_freeable+0x425/0x6f0
[   26.415932]  kernel_init+0x23/0x1e0
[   26.416364]  ret_from_fork+0x41/0x80
[   26.417062]  ret_from_fork_asm+0x1a/0x30
[   26.417591] 
[   26.417969] The buggy address belongs to the object at ffff888101a5bb80
[   26.417969]  which belongs to the cache kmalloc-16 of size 16
[   26.419033] The buggy address is located 18 bytes to the right of
[   26.419033]  allocated 13-byte region [ffff888101a5bb80, ffff888101a5bb8d)
[   26.420472] 
[   26.420637] The buggy address belongs to the physical page:
[   26.421312] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101a5b
[   26.422275] flags: 0x200000000000000(node=0|zone=2)
[   26.422941] page_type: f5(slab)
[   26.423397] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   26.424368] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   26.425353] page dumped because: kasan: bad access detected
[   26.426121] 
[   26.426392] Memory state around the buggy address:
[   26.427142]  ffff888101a5ba80: fa fb fc fc fa fb fc fc fa fb fc fc 00 01 fc fc
[   26.427885]  ffff888101a5bb00: fa fb fc fc 00 01 fc fc 00 01 fc fc fa fb fc fc
[   26.428567] >ffff888101a5bb80: 00 05 fc fc 00 07 fc fc fc fc fc fc fc fc fc fc
[   26.429424]                             ^
[   26.429891]  ffff888101a5bc00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.430807]  ffff888101a5bc80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.431633] ==================================================================