Hay
Date
Nov. 20, 2024, 6:35 a.m.

Environment
qemu-arm64
qemu-x86_64

[   35.492967] ==================================================================
[   35.494287] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_left+0x2ec/0x320
[   35.495897] Read of size 1 at addr fff00000c1bb3b5f by task kunit_try_catch/127
[   35.496753] 
[   35.497272] CPU: 0 UID: 0 PID: 127 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241120 #1
[   35.498653] Tainted: [B]=BAD_PAGE, [N]=TEST
[   35.499152] Hardware name: linux,dummy-virt (DT)
[   35.499763] Call trace:
[   35.500283]  show_stack+0x20/0x38 (C)
[   35.500893]  dump_stack_lvl+0x8c/0xd0
[   35.501428]  print_report+0x118/0x5e0
[   35.502026]  kasan_report+0xc8/0x118
[   35.502772]  __asan_report_load1_noabort+0x20/0x30
[   35.503243]  kmalloc_oob_left+0x2ec/0x320
[   35.503671]  kunit_try_run_case+0x14c/0x3d0
[   35.504184]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   35.504891]  kthread+0x24c/0x2d0
[   35.506031]  ret_from_fork+0x10/0x20
[   35.506613] 
[   35.506956] Allocated by task 28:
[   35.507470]  kasan_save_stack+0x3c/0x68
[   35.508066]  kasan_save_track+0x20/0x40
[   35.508657]  kasan_save_alloc_info+0x40/0x58
[   35.510230]  __kasan_kmalloc+0xd4/0xd8
[   35.510779]  __kmalloc_node_track_caller_noprof+0x184/0x4b8
[   35.511502]  kstrdup+0x54/0xc8
[   35.511942]  devtmpfs_work_loop+0x384/0x590
[   35.512520]  devtmpfsd+0x50/0x58
[   35.513017]  kthread+0x24c/0x2d0
[   35.513590]  ret_from_fork+0x10/0x20
[   35.514428] 
[   35.514805] Freed by task 28:
[   35.515312]  kasan_save_stack+0x3c/0x68
[   35.515860]  kasan_save_track+0x20/0x40
[   35.516776]  kasan_save_free_info+0x4c/0x78
[   35.517582]  __kasan_slab_free+0x6c/0x98
[   35.518159]  kfree+0x114/0x3d0
[   35.518647]  devtmpfs_work_loop+0x498/0x590
[   35.519165]  devtmpfsd+0x50/0x58
[   35.520371]  kthread+0x24c/0x2d0
[   35.521109]  ret_from_fork+0x10/0x20
[   35.522163] 
[   35.522606] The buggy address belongs to the object at fff00000c1bb3b40
[   35.522606]  which belongs to the cache kmalloc-16 of size 16
[   35.523802] The buggy address is located 15 bytes to the right of
[   35.523802]  allocated 16-byte region [fff00000c1bb3b40, fff00000c1bb3b50)
[   35.524946] 
[   35.525291] The buggy address belongs to the physical page:
[   35.526867] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101bb3
[   35.528143] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   35.528676] page_type: f5(slab)
[   35.529176] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   35.530395] raw: 0000000000000000 0000000080800080 00000001f5000000 0000000000000000
[   35.531235] page dumped because: kasan: bad access detected
[   35.531809] 
[   35.532119] Memory state around the buggy address:
[   35.532642]  fff00000c1bb3a00: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   35.533501]  fff00000c1bb3a80: fa fb fc fc fa fb fc fc fa fb fc fc 00 02 fc fc
[   35.534268] >fff00000c1bb3b00: 00 02 fc fc fa fb fc fc fa fb fc fc 00 07 fc fc
[   35.535018]                                                     ^
[   35.535955]  fff00000c1bb3b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   35.537161]  fff00000c1bb3c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   35.538261] ==================================================================

[   26.703439] ==================================================================
[   26.704342] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_left+0x363/0x3c0
[   26.705306] Read of size 1 at addr ffff8881025fedbf by task kunit_try_catch/145
[   26.705913] 
[   26.706119] CPU: 1 UID: 0 PID: 145 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241120 #1
[   26.707564] Tainted: [B]=BAD_PAGE, [N]=TEST
[   26.708113] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   26.708899] Call Trace:
[   26.709356]  <TASK>
[   26.709584]  dump_stack_lvl+0x73/0xb0
[   26.710077]  print_report+0xd1/0x640
[   26.710487]  ? __virt_addr_valid+0x1db/0x2d0
[   26.710978]  ? kasan_complete_mode_report_info+0x2a/0x200
[   26.711895]  kasan_report+0x102/0x140
[   26.712428]  ? kmalloc_oob_left+0x363/0x3c0
[   26.712819]  ? kmalloc_oob_left+0x363/0x3c0
[   26.713327]  __asan_report_load1_noabort+0x18/0x20
[   26.713848]  kmalloc_oob_left+0x363/0x3c0
[   26.714157]  ? __pfx_kmalloc_oob_left+0x10/0x10
[   26.714646]  ? __schedule+0xc3e/0x2790
[   26.715049]  ? __pfx_read_tsc+0x10/0x10
[   26.715759]  ? ktime_get_ts64+0x84/0x230
[   26.716414]  kunit_try_run_case+0x1b3/0x490
[   26.716983]  ? __pfx_kunit_try_run_case+0x10/0x10
[   26.717540]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   26.717913]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   26.718257]  ? __kthread_parkme+0x82/0x160
[   26.718904]  ? preempt_count_sub+0x50/0x80
[   26.719384]  ? __pfx_kunit_try_run_case+0x10/0x10
[   26.719890]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   26.720380]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.721410]  kthread+0x257/0x310
[   26.721712]  ? __pfx_kthread+0x10/0x10
[   26.722175]  ret_from_fork+0x41/0x80
[   26.722466]  ? __pfx_kthread+0x10/0x10
[   26.722930]  ret_from_fork_asm+0x1a/0x30
[   26.723553]  </TASK>
[   26.723820] 
[   26.724006] Allocated by task 1:
[   26.724241]  kasan_save_stack+0x3d/0x60
[   26.724517]  kasan_save_track+0x18/0x40
[   26.724905]  kasan_save_alloc_info+0x3b/0x50
[   26.725448]  __kasan_kmalloc+0xb7/0xc0
[   26.726406]  __kmalloc_node_track_caller_noprof+0x1c6/0x500
[   26.727035]  kvasprintf+0xc6/0x150
[   26.727472]  __kthread_create_on_node+0x18c/0x3a0
[   26.728223]  kthread_create_on_node+0xa8/0xe0
[   26.728632]  create_worker+0x3c8/0x7a0
[   26.728967]  alloc_unbound_pwq+0x8ea/0xdb0
[   26.729360]  apply_wqattrs_prepare+0x332/0xd40
[   26.729802]  apply_workqueue_attrs_locked+0x4d/0xa0
[   26.730593]  alloc_workqueue+0xcc4/0x1ad0
[   26.731002]  latency_fsnotify_init+0x1b/0x50
[   26.731305]  do_one_initcall+0xb5/0x370
[   26.731583]  kernel_init_freeable+0x425/0x6f0
[   26.732098]  kernel_init+0x23/0x1e0
[   26.732571]  ret_from_fork+0x41/0x80
[   26.733379]  ret_from_fork_asm+0x1a/0x30
[   26.734089] 
[   26.734516] The buggy address belongs to the object at ffff8881025feda0
[   26.734516]  which belongs to the cache kmalloc-16 of size 16
[   26.735767] The buggy address is located 18 bytes to the right of
[   26.735767]  allocated 13-byte region [ffff8881025feda0, ffff8881025fedad)
[   26.736431] 
[   26.736680] The buggy address belongs to the physical page:
[   26.737321] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1025fe
[   26.738159] flags: 0x200000000000000(node=0|zone=2)
[   26.739025] page_type: f5(slab)
[   26.739427] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   26.740355] raw: 0000000000000000 0000000080800080 00000001f5000000 0000000000000000
[   26.740812] page dumped because: kasan: bad access detected
[   26.741138] 
[   26.741289] Memory state around the buggy address:
[   26.741587]  ffff8881025fec80: 00 02 fc fc 00 05 fc fc 00 02 fc fc 00 02 fc fc
[   26.742379]  ffff8881025fed00: 00 02 fc fc 00 02 fc fc fa fb fc fc fa fb fc fc
[   26.743175] >ffff8881025fed80: fa fb fc fc 00 05 fc fc 00 07 fc fc fc fc fc fc
[   26.744246]                                         ^
[   26.744656]  ffff8881025fee00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.745527]  ffff8881025fee80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.746207] ==================================================================