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

Environment
qemu-arm64
qemu-x86_64

[   33.541316] ==================================================================
[   33.543724] BUG: KASAN: slab-use-after-free in strcmp+0xc0/0xc8
[   33.544992] Read of size 1 at addr fff00000c5921b90 by task kunit_try_catch/248
[   33.545867] 
[   33.546507] CPU: 0 UID: 0 PID: 248 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241203 #1
[   33.547844] Tainted: [B]=BAD_PAGE, [N]=TEST
[   33.548563] Hardware name: linux,dummy-virt (DT)
[   33.549245] Call trace:
[   33.549866]  show_stack+0x20/0x38 (C)
[   33.550573]  dump_stack_lvl+0x8c/0xd0
[   33.551791]  print_report+0x118/0x5e0
[   33.552571]  kasan_report+0xc8/0x118
[   33.553163]  __asan_report_load1_noabort+0x20/0x30
[   33.553897]  strcmp+0xc0/0xc8
[   33.554508]  kasan_strings+0x228/0x8d8
[   33.555186]  kunit_try_run_case+0x14c/0x3d0
[   33.556085]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.556933]  kthread+0x24c/0x2d0
[   33.557643]  ret_from_fork+0x10/0x20
[   33.558316] 
[   33.558684] Allocated by task 248:
[   33.559962]  kasan_save_stack+0x3c/0x68
[   33.561161]  kasan_save_track+0x20/0x40
[   33.561708]  kasan_save_alloc_info+0x40/0x58
[   33.562269]  __kasan_kmalloc+0xd4/0xd8
[   33.562883]  __kmalloc_cache_noprof+0x15c/0x3c0
[   33.563906]  kasan_strings+0xb0/0x8d8
[   33.564747]  kunit_try_run_case+0x14c/0x3d0
[   33.565361]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.566061]  kthread+0x24c/0x2d0
[   33.566552]  ret_from_fork+0x10/0x20
[   33.567046] 
[   33.567500] Freed by task 248:
[   33.568032]  kasan_save_stack+0x3c/0x68
[   33.568909]  kasan_save_track+0x20/0x40
[   33.569493]  kasan_save_free_info+0x4c/0x78
[   33.570170]  __kasan_slab_free+0x6c/0x98
[   33.570755]  kfree+0x114/0x3c8
[   33.571643]  kasan_strings+0x124/0x8d8
[   33.572160]  kunit_try_run_case+0x14c/0x3d0
[   33.572765]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.573584]  kthread+0x24c/0x2d0
[   33.574053]  ret_from_fork+0x10/0x20
[   33.574687] 
[   33.575298] The buggy address belongs to the object at fff00000c5921b80
[   33.575298]  which belongs to the cache kmalloc-32 of size 32
[   33.576699] The buggy address is located 16 bytes inside of
[   33.576699]  freed 32-byte region [fff00000c5921b80, fff00000c5921ba0)
[   33.578201] 
[   33.578525] The buggy address belongs to the physical page:
[   33.579974] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105921
[   33.580972] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   33.582360] page_type: f5(slab)
[   33.582885] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   33.584278] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   33.585271] page dumped because: kasan: bad access detected
[   33.585946] 
[   33.586286] Memory state around the buggy address:
[   33.586899]  fff00000c5921a80: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   33.588027]  fff00000c5921b00: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   33.588928] >fff00000c5921b80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   33.589783]                          ^
[   33.590311]  fff00000c5921c00: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   33.591852]  fff00000c5921c80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   33.592855] ==================================================================

[   28.831303] ==================================================================
[   28.834323] BUG: KASAN: slab-use-after-free in strcmp+0xb0/0xc0
[   28.834690] Read of size 1 at addr ffff888102a07b90 by task kunit_try_catch/268
[   28.835763] 
[   28.836189] CPU: 1 UID: 0 PID: 268 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241203 #1
[   28.837287] Tainted: [B]=BAD_PAGE, [N]=TEST
[   28.837874] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   28.838256] Call Trace:
[   28.838426]  <TASK>
[   28.839477]  dump_stack_lvl+0x73/0xb0
[   28.840177]  print_report+0xd1/0x640
[   28.840572]  ? __virt_addr_valid+0x1db/0x2d0
[   28.841033]  ? kasan_complete_mode_report_info+0x64/0x200
[   28.841646]  kasan_report+0x102/0x140
[   28.842121]  ? strcmp+0xb0/0xc0
[   28.842312]  ? strcmp+0xb0/0xc0
[   28.842460]  __asan_report_load1_noabort+0x18/0x20
[   28.843036]  strcmp+0xb0/0xc0
[   28.843535]  kasan_strings+0x2d3/0xb60
[   28.844208]  ? __pfx_kasan_strings+0x10/0x10
[   28.844620]  ? __schedule+0xc3e/0x2790
[   28.845023]  ? __pfx_read_tsc+0x10/0x10
[   28.845268]  ? ktime_get_ts64+0x86/0x230
[   28.845541]  kunit_try_run_case+0x1b3/0x490
[   28.846091]  ? __pfx_kunit_try_run_case+0x10/0x10
[   28.846980]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   28.847303]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   28.848029]  ? __kthread_parkme+0x82/0x160
[   28.848732]  ? preempt_count_sub+0x50/0x80
[   28.849288]  ? __pfx_kunit_try_run_case+0x10/0x10
[   28.850361]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   28.851128]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   28.851676]  kthread+0x257/0x310
[   28.851922]  ? __pfx_kthread+0x10/0x10
[   28.852349]  ret_from_fork+0x41/0x80
[   28.852781]  ? __pfx_kthread+0x10/0x10
[   28.853268]  ret_from_fork_asm+0x1a/0x30
[   28.854009]  </TASK>
[   28.854221] 
[   28.854371] Allocated by task 268:
[   28.854835]  kasan_save_stack+0x3d/0x60
[   28.855815]  kasan_save_track+0x18/0x40
[   28.857097]  kasan_save_alloc_info+0x3b/0x50
[   28.857496]  __kasan_kmalloc+0xb7/0xc0
[   28.857827]  __kmalloc_cache_noprof+0x184/0x410
[   28.858294]  kasan_strings+0xb9/0xb60
[   28.858775]  kunit_try_run_case+0x1b3/0x490
[   28.859198]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   28.859768]  kthread+0x257/0x310
[   28.860120]  ret_from_fork+0x41/0x80
[   28.860662]  ret_from_fork_asm+0x1a/0x30
[   28.861773] 
[   28.862074] Freed by task 268:
[   28.862490]  kasan_save_stack+0x3d/0x60
[   28.862996]  kasan_save_track+0x18/0x40
[   28.863278]  kasan_save_free_info+0x3f/0x60
[   28.863920]  __kasan_slab_free+0x56/0x70
[   28.864429]  kfree+0x123/0x3f0
[   28.864763]  kasan_strings+0x13c/0xb60
[   28.865371]  kunit_try_run_case+0x1b3/0x490
[   28.866027]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   28.866449]  kthread+0x257/0x310
[   28.866688]  ret_from_fork+0x41/0x80
[   28.867077]  ret_from_fork_asm+0x1a/0x30
[   28.868376] 
[   28.868633] The buggy address belongs to the object at ffff888102a07b80
[   28.868633]  which belongs to the cache kmalloc-32 of size 32
[   28.870106] The buggy address is located 16 bytes inside of
[   28.870106]  freed 32-byte region [ffff888102a07b80, ffff888102a07ba0)
[   28.870683] 
[   28.870838] The buggy address belongs to the physical page:
[   28.871583] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102a07
[   28.872571] flags: 0x200000000000000(node=0|zone=2)
[   28.873758] page_type: f5(slab)
[   28.874423] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   28.875196] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   28.875729] page dumped because: kasan: bad access detected
[   28.876509] 
[   28.876887] Memory state around the buggy address:
[   28.877286]  ffff888102a07a80: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   28.878154]  ffff888102a07b00: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   28.878699] >ffff888102a07b80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   28.879834]                          ^
[   28.880224]  ffff888102a07c00: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   28.880807]  ffff888102a07c80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   28.881739] ==================================================================