Hay
Date
Nov. 27, 2024, 3:37 a.m.

Environment
qemu-arm64
qemu-x86_64

[   46.568927] ==================================================================
[   46.570516] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_left+0x2ec/0x320
[   46.571658] Read of size 1 at addr fff00000c40dc77f by task kunit_try_catch/127
[   46.572403] 
[   46.572828] CPU: 1 UID: 0 PID: 127 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241127 #1
[   46.573855] Tainted: [B]=BAD_PAGE, [N]=TEST
[   46.574486] Hardware name: linux,dummy-virt (DT)
[   46.575008] Call trace:
[   46.575535]  show_stack+0x20/0x38 (C)
[   46.576112]  dump_stack_lvl+0x8c/0xd0
[   46.577137]  print_report+0x118/0x5e0
[   46.577876]  kasan_report+0xc8/0x118
[   46.578510]  __asan_report_load1_noabort+0x20/0x30
[   46.579252]  kmalloc_oob_left+0x2ec/0x320
[   46.579836]  kunit_try_run_case+0x14c/0x3d0
[   46.580380]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   46.581467]  kthread+0x24c/0x2d0
[   46.582069]  ret_from_fork+0x10/0x20
[   46.582786] 
[   46.583106] Allocated by task 28:
[   46.583590]  kasan_save_stack+0x3c/0x68
[   46.584093]  kasan_save_track+0x20/0x40
[   46.584686]  kasan_save_alloc_info+0x40/0x58
[   46.585424]  __kasan_kmalloc+0xd4/0xd8
[   46.586195]  __kmalloc_node_track_caller_noprof+0x184/0x4b8
[   46.587197]  kstrdup+0x54/0xc8
[   46.587671]  devtmpfs_work_loop+0x384/0x590
[   46.588236]  devtmpfsd+0x50/0x58
[   46.588812]  kthread+0x24c/0x2d0
[   46.589343]  ret_from_fork+0x10/0x20
[   46.589864] 
[   46.590318] Freed by task 28:
[   46.590732]  kasan_save_stack+0x3c/0x68
[   46.591418]  kasan_save_track+0x20/0x40
[   46.591958]  kasan_save_free_info+0x4c/0x78
[   46.592945]  __kasan_slab_free+0x6c/0x98
[   46.593628]  kfree+0x114/0x3c8
[   46.594056]  devtmpfs_work_loop+0x498/0x590
[   46.595717]  devtmpfsd+0x50/0x58
[   46.596217]  kthread+0x24c/0x2d0
[   46.596854]  ret_from_fork+0x10/0x20
[   46.597936] 
[   46.598255] The buggy address belongs to the object at fff00000c40dc760
[   46.598255]  which belongs to the cache kmalloc-16 of size 16
[   46.599850] The buggy address is located 15 bytes to the right of
[   46.599850]  allocated 16-byte region [fff00000c40dc760, fff00000c40dc770)
[   46.601895] 
[   46.602415] The buggy address belongs to the physical page:
[   46.603202] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1040dc
[   46.604223] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   46.605044] page_type: f5(slab)
[   46.605620] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   46.606821] raw: 0000000000000000 0000000080800080 00000001f5000000 0000000000000000
[   46.607644] page dumped because: kasan: bad access detected
[   46.608363] 
[   46.608736] Memory state around the buggy address:
[   46.609561]  fff00000c40dc600: 00 04 fc fc fa fb fc fc 00 02 fc fc 00 02 fc fc
[   46.610410]  fff00000c40dc680: 00 00 fc fc 00 06 fc fc 00 06 fc fc fa fb fc fc
[   46.611281] >fff00000c40dc700: 00 06 fc fc 00 06 fc fc fa fb fc fc fa fb fc fc
[   46.612215]                                                                 ^
[   46.613488]  fff00000c40dc780: 00 07 fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   46.614142]  fff00000c40dc800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   46.615210] ==================================================================

[   23.645363] ==================================================================
[   23.646556] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_left+0x363/0x3c0
[   23.647373] Read of size 1 at addr ffff888102699cff by task kunit_try_catch/146
[   23.648884] 
[   23.649251] CPU: 0 UID: 0 PID: 146 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241127 #1
[   23.650753] Tainted: [B]=BAD_PAGE, [N]=TEST
[   23.651147] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   23.651775] Call Trace:
[   23.652263]  <TASK>
[   23.652645]  dump_stack_lvl+0x73/0xb0
[   23.653032]  print_report+0xd1/0x640
[   23.653581]  ? __virt_addr_valid+0x1db/0x2d0
[   23.654341]  ? kasan_complete_mode_report_info+0x2a/0x200
[   23.654855]  kasan_report+0x102/0x140
[   23.655431]  ? kmalloc_oob_left+0x363/0x3c0
[   23.656002]  ? kmalloc_oob_left+0x363/0x3c0
[   23.656629]  __asan_report_load1_noabort+0x18/0x20
[   23.657299]  kmalloc_oob_left+0x363/0x3c0
[   23.657916]  ? __pfx_kmalloc_oob_left+0x10/0x10
[   23.658672]  ? __schedule+0xc3e/0x2790
[   23.659314]  ? __pfx_read_tsc+0x10/0x10
[   23.659701]  ? ktime_get_ts64+0x84/0x230
[   23.660279]  kunit_try_run_case+0x1b3/0x490
[   23.660797]  ? __pfx_kunit_try_run_case+0x10/0x10
[   23.661379]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   23.662064]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   23.662572]  ? __kthread_parkme+0x82/0x160
[   23.663313]  ? preempt_count_sub+0x50/0x80
[   23.663934]  ? __pfx_kunit_try_run_case+0x10/0x10
[   23.664499]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   23.664896]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   23.665518]  kthread+0x257/0x310
[   23.665870]  ? __pfx_kthread+0x10/0x10
[   23.666579]  ret_from_fork+0x41/0x80
[   23.667090]  ? __pfx_kthread+0x10/0x10
[   23.667544]  ret_from_fork_asm+0x1a/0x30
[   23.668262]  </TASK>
[   23.668517] 
[   23.668670] Allocated by task 10:
[   23.669315]  kasan_save_stack+0x3d/0x60
[   23.669855]  kasan_save_track+0x18/0x40
[   23.670294]  kasan_save_alloc_info+0x3b/0x50
[   23.670872]  __kasan_kmalloc+0xb7/0xc0
[   23.671425]  __kmalloc_node_track_caller_noprof+0x1c6/0x500
[   23.672035]  kvasprintf+0xc6/0x150
[   23.672300]  __kthread_create_on_node+0x18c/0x3a0
[   23.673252]  kthread_create_on_node+0xa8/0xe0
[   23.673682]  create_worker+0x3c8/0x7a0
[   23.674118]  worker_thread+0x97d/0x1300
[   23.674587]  kthread+0x257/0x310
[   23.675269]  ret_from_fork+0x41/0x80
[   23.675685]  ret_from_fork_asm+0x1a/0x30
[   23.676296] 
[   23.676451] The buggy address belongs to the object at ffff888102699ce0
[   23.676451]  which belongs to the cache kmalloc-16 of size 16
[   23.677834] The buggy address is located 19 bytes to the right of
[   23.677834]  allocated 12-byte region [ffff888102699ce0, ffff888102699cec)
[   23.679130] 
[   23.679440] The buggy address belongs to the physical page:
[   23.679841] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102699
[   23.680703] flags: 0x200000000000000(node=0|zone=2)
[   23.681325] page_type: f5(slab)
[   23.681798] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   23.682550] raw: 0000000000000000 0000000080800080 00000001f5000000 0000000000000000
[   23.683662] page dumped because: kasan: bad access detected
[   23.684260] 
[   23.684523] Memory state around the buggy address:
[   23.685016]  ffff888102699b80: fa fb fc fc 00 02 fc fc 00 05 fc fc 00 02 fc fc
[   23.685567]  ffff888102699c00: 00 02 fc fc 00 02 fc fc 00 02 fc fc fa fb fc fc
[   23.686426] >ffff888102699c80: fa fb fc fc fa fb fc fc 00 05 fc fc 00 04 fc fc
[   23.687322]                                                                 ^
[   23.687939]  ffff888102699d00: 00 07 fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.688856]  ffff888102699d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.689539] ==================================================================