nday
CVE-2023-52751

smb: client: fix use-after-free in smb2_query_info_compound()

Linux / Linux

披露于 。本站尚未获取修复依据,不能据此认为没有补丁。四个 PoC 来源都还没有收录。尚未列入 CISA KEV。

标签 漏洞类型use-after-free 攻击途径本地无需用户交互 产品Linux kernel 产品类型操作系统
这些标签的依据

这些标签由 nday 按固定规则从下列事实自动推导,不是 NVD、编号分配方或其他来源给出的。全部标签和规则见 ~/tags。

use-after-free
CWE-416(来源:NVD 分析人员)
本地
编号分配方 Linux 给出的 CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H(CVSS 3.1)中的 AV:L
无需用户交互
编号分配方 Linux 给出的 CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H(CVSS 3.1)中的 UI:N
Linux kernel
CVE 记录列出的受影响产品:Linux · LinuxNVD 分析人员标为易受攻击的 CPE 名称:o:linux:linux_kernel
操作系统
CVE 记录列出的受影响产品:Linux · LinuxNVD 分析人员标为易受攻击的 CPE 名称:o:linux:linux_kernelnday 产品登记表中 Linux kernel 的产品类型
当前阶段
DIS
披露
CVSS
7.8 HIGH v3.1

生命周期

横轴 UTC;点=精确到分钟,宽条=仅日期,空心=未知或推定。
时间未知
DIS披露
2024-05-21T15:30Z
PAT补丁
尚无记录
ANA分析
尚无记录
POCPoC
尚无记录
ITW在野
尚无记录
KEVKEV
尚无记录

摘要

In the Linux kernel, the following vulnerability has been resolved:

smb: client: fix use-after-free in smb2_query_info_compound()

The following UAF was triggered when running fstests generic/072 with KASAN enabled against Windows Server 2022 and mount options 'multichannel,max_channels=2,vers=3.1.1,mfsymlinks,noperm'

BUG: KASAN: slab-use-after-free in smb2_query_info_compound+0x423/0x6d0 [cifs]
Read of size 8 at addr ffff888014941048 by task xfs_io/27534

CPU: 0 PID: 27534 Comm: xfs_io Not tainted 6.6.0-rc7 #1
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS
rel-1.16.2-3-gd478f380-rebuilt.opensuse.org 04/01/2014
Call Trace:
 dump_stack_lvl+0x4a/0x80
 print_report+0xcf/0x650
 ? srso_alias_return_thunk+0x5/0x7f
 ? srso_alias_return_thunk+0x5/0x7f
 ? __phys_addr+0x46/0x90
 kasan_report+0xda/0x110
 ? smb2_query_info_compound+0x423/0x6d0 [cifs]
 ? smb2_query_info_compound+0x423/0x6d0 [cifs]
 smb2_query_info_compound+0x423/0x6d0 [cifs]
 ? __pfx_smb2_query_info_compound+0x10/0x10 [cifs]
 ? srso_alias_return_thunk+0x5/0x7f
 ? __stack_depot_save+0x39/0x480
 ? kasan_save_stack+0x33/0x60
 ? kasan_set_track+0x25/0x30
 ? ____kasan_slab_free+0x126/0x170
 smb2_queryfs+0xc2/0x2c0 [cifs]
 ? __pfx_smb2_queryfs+0x10/0x10 [cifs]
 ? __pfx___lock_acquire+0x10/0x10
 smb311_queryfs+0x210/0x220 [cifs]
 ? __pfx_smb311_queryfs+0x10/0x10 [cifs]
 ? srso_alias_return_thunk+0x5/0x7f
 ? __lock_acquire+0x480/0x26c0
 ? lock_release+0x1ed/0x640
 ? srso_alias_return_thunk+0x5/0x7f
 ? do_raw_spin_unlock+0x9b/0x100
 cifs_statfs+0x18c/0x4b0 [cifs]
 statfs_by_dentry+0x9b/0xf0
 fd_statfs+0x4e/0xb0
 __do_sys_fstatfs+0x7f/0xe0
 ? __pfx___do_sys_fstatfs+0x10/0x10
 ? srso_alias_return_thunk+0x5/0x7f
 ? lockdep_hardirqs_on_prepare+0x136/0x200
 ? srso_alias_return_thunk+0x5/0x7f
 do_syscall_64+0x3f/0x90
 entry_SYSCALL_64_after_hwframe+0x6e/0xd8

Allocated by task 27534:
 kasan_save_stack+0x33/0x60
 kasan_set_track+0x25/0x30
 __kasan_kmalloc+0x8f/0xa0
 open_cached_dir+0x71b/0x1240 [cifs]
 smb2_query_info_compound+0x5c3/0x6d0 [cifs]
 smb2_queryfs+0xc2/0x2c0 [cifs]
 smb311_queryfs+0x210/0x220 [cifs]
 cifs_statfs+0x18c/0x4b0 [cifs]
 statfs_by_dentry+0x9b/0xf0
 fd_statfs+0x4e/0xb0
 __do_sys_fstatfs+0x7f/0xe0
 do_syscall_64+0x3f/0x90
 entry_SYSCALL_64_after_hwframe+0x6e/0xd8

Freed by task 27534:
 kasan_save_stack+0x33/0x60
 kasan_set_track+0x25/0x30
 kasan_save_free_info+0x2b/0x50
 ____kasan_slab_free+0x126/0x170
 slab_free_freelist_hook+0xd0/0x1e0
 __kmem_cache_free+0x9d/0x1b0
 open_cached_dir+0xff5/0x1240 [cifs]
 smb2_query_info_compound+0x5c3/0x6d0 [cifs]
 smb2_queryfs+0xc2/0x2c0 [cifs]

This is a race between open_cached_dir() and cached_dir_lease_break() where the cache entry for the open directory handle receives a lease break while creating it. And before returning from open_cached_dir(), we put the last reference of the new @cfid because of !@cfid->has_lease.

Besides the UAF, while running xfstests a lot of missed lease breaks have been noticed in tests that run several concurrent statfs(2) calls on those cached fids

CIFS: VFS: \\w22-root1.gandalf.test No task to wake, unknown frame... CIFS: VFS: \\w22-root1.gandalf.test Cmd: 18 Err: 0x0 Flags: 0x1... CIFS: VFS: \\w22-root1.gandalf.test smb buf 00000000715bfe83 len 108 CIFS: VFS: Dump pending requests: CIFS: VFS: \\w22-root1.gandalf.test No task to wake, unknown frame...

CIFS: VFS: \\w22-root1.gandalf.test Cmd: 18 Err: 0x0 Flags: 0x1...
CIFS: VFS: \\w22-root1.gandalf.test smb buf 000000005aa7316e len 108
...

To fix both, in open_cached_dir() ensure that @cfid->has_lease is set right before sending out compounded request so that any potential lease break will be get processed by demultiplex thread while we're still caching @cfid. And, if open failed for some reason, re-check @cfid->has_lease to decide whether or not put lease reference.

以上是 CVE 记录(cvelist)中的原文,未经改写。

利用条件

按 CVSS 向量说明攻击需要的条件。
攻击途径 AV:L
本地:需要本地或 SSH 会话,或诱使用户在本机上操作
攻击复杂度 AC:L
低:不依赖特殊条件,攻击者可预期重复成功
所需权限 PR:L
低:普通用户权限
用户交互 UI:N
无:除攻击者外不需要任何人配合

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

CVSS 3.1 向量,来自 CVE 记录,由 CNA Linux 评定。

事件记录

+DIS披露

CVE 记录发布,编号分配方是 Linux。CVSS 7.8,高危。

来源 cvelist · 本站 批量导入 · 原始记录
{
  "id": 309031,
  "type": "disclosed",
  "source": "cvelist",
  "url": "https://www.cve.org/CVERecord?id=CVE-2023-52751",
  "occurred_at": "2024-05-21T15:30:40.226Z",
  "observed_at": "2026-11-13T05:38:14.046808Z",
  "is_backfill": true,
  "dedupe_key": "",
  "detail": {
    "cvss": {
      "source": "cna",
      "vector": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
      "version": "3.1",
      "base_score": 7.8,
      "base_severity": "HIGH"
    },
    "ssvc": {
      "timestamp": "2024-09-10T15:37:15.794672Z",
      "automatable": "no",
      "exploitation": "none",
      "technical_impact": "partial"
    },
    "state": "PUBLISHED",
    "date_published": "2024-05-21T15:30:40.226Z",
    "assigner_short_name": "Linux"
  }
}

纠错

报告错误或缺失

页面有误或缺失?告诉编辑;采纳后在本页修订记录公开说明,上游数据不会被改动。

研究员讨论

近 7 天有 0 位研究员提到

研究员在 X 上提到此 CVE 的帖子,原文照录,nday 不核实。

尚未采集到名单内研究员在 X 上提到此 CVE 的帖子。

讨论

0 条评论

还没有评论。