Vulnerability · Published May 19, 2024 · Assigned by Linux
CVE-2024-35870smb: client: fix UAF in smb2_reconnect_server()
Critical 9.8
In plain English
A critical-severity use-after-free in Linux from Linux. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.6% (higher than 50% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
In the Linux kernel, the following vulnerability has been resolved: smb: client: fix UAF in smb2_reconnect_server() The UAF bug is due to smb2_reconnect_server() accessing a session that is already being teared down by another thread that is executing __cifs_put_smb_ses(). This can happen when (a) the client has connection to the server but no session or (b) another thread ends up setting @ses->ses_status again to something different than SES_EXITING. To fix this, we need to make sure to unconditionally set @ses->ses_status to SES_EXITING and prevent any other threads from setting a new status while we're still tearing it down. The following can be reproduced by adding some delay to right after the ipc is freed in __cifs_put_smb_ses() - which will give smb2_reconnect_server() worker a chance to run and then accessing @ses->ipc: kinit ... mount.cifs //srv/share /mnt/1 -o sec=krb5,nohandlecache,echo_interval=10 [disconnect srv] ls /mnt/1 &>/dev/null sleep 30 kdestroy [reconnect srv] sleep 10 umount /mnt/1 ... CIFS: VFS: Verify user has a krb5 ticket and keyutils is installed CIFS: VFS: \\srv Send error in SessSetup = -126 CIFS: VFS: Verify user has a krb5 ticket and keyutils is installed CIFS: VFS: \\srv Send error in SessSetup = -126 general protection fault, probably for non-canonical address 0x6b6b6b6b6b6b6b6b: 0000 [#1] PREEMPT SMP NOPTI CPU: 3 PID: 50 Comm: kworker/3:1 Not tainted 6.9.0-rc2 #1 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-1.fc39 04/01/2014 Workqueue: cifsiod smb2_reconnect_server [cifs] RIP: 0010:__list_del_entry_valid_or_report+0x33/0xf0 Code: 4f 08 48 85 d2 74 42 48 85 c9 74 59 48 b8 00 01 00 00 00 00 ad de 48 39 c2 74 61 48 b8 22 01 00 00 00 00 74 69 <48> 8b 01 48 39 f8 75 7b 48 8b 72 08 48 39 c6 0f 85 88 00 00 00 b8 RSP: 0018:ffffc900001bfd70 EFLAGS: 00010a83 RAX: dead000000000122 RBX: ffff88810da53838 RCX: 6b6b6b6b6b6b6b6b RDX: 6b6b6b6b6b6b6b6b RSI: ffffffffc02f6878 RDI: ffff88810da53800 RBP: ffff88810da53800 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000001 R12: ffff88810c064000 R13: 0000000000000001 R14: ffff88810c064000 R15: ffff8881039cc000 FS: 0000000000000000(0000) GS:ffff888157c00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fe3728b1000 CR3: 000000010caa4000 CR4: 0000000000750ef0 PKRU: 55555554 Call Trace: <TASK> ? die_addr+0x36/0x90 ? exc_general_protection+0x1c1/0x3f0 ? asm_exc_general_protection+0x26/0x30 ? __list_del_entry_valid_or_report+0x33/0xf0 __cifs_put_smb_ses+0x1ae/0x500 [cifs] smb2_reconnect_server+0x4ed/0x710 [cifs] process_one_work+0x205/0x6b0 worker_thread+0x191/0x360 ? __pfx_worker_thread+0x10/0x10 kthread+0xe2/0x110 ? __pfx_kthread+0x10/0x10 ret_from_fork+0x34/0x50 ? __pfx_kthread+0x10/0x10 ret_from_fork_asm+0x1a/0x30 </TASK>
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| AlmaLinux:9 | bpftool | 7.3.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-64k | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-64k-core | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-64k-debug | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-64k-debug-core | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-64k-debug-devel | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-64k-debug-devel-matched | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-64k-debug-modules | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-64k-debug-modules-core | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-64k-debug-modules-extra | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-64k-devel | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-64k-devel-matched | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-64k-modules | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-64k-modules-core | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-64k-modules-extra | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-abi-stablelists | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-core | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-cross-headers | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-debug | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-debug-core | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-debug-devel | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-debug-devel-matched | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-debug-modules | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-debug-modules-core | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-debug-modules-extra | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-debug-uki-virt | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-devel | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-devel-matched | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-doc | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-headers | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-modules | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-modules-core | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-modules-extra | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-rt | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-rt-core | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-rt-debug | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-rt-debug-core | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-rt-debug-devel | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-rt-debug-modules | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-rt-debug-modules-core | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-rt-debug-modules-extra | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-rt-devel | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-rt-modules | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-rt-modules-core | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-rt-modules-extra | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-tools | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-tools-libs | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-tools-libs-devel | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-uki-virt | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-zfcpdump | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-zfcpdump-core | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-zfcpdump-devel | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-zfcpdump-devel-matched | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-zfcpdump-modules | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-zfcpdump-modules-core | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | kernel-zfcpdump-modules-extra | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | libperf | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | perf | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | python3-perf | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | rtla | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| AlmaLinux:9 | rv | 5.14.0-427.24.1.el9_4 | ALSA-2024:4349 |
| Debian:12 | linux | 6.1.123-1 | DEBIAN-CVE-2024-35870 |
| Debian:13 | linux | 6.8.9-1 | DEBIAN-CVE-2024-35870 |
| Debian:14 | linux | 6.8.9-1 | DEBIAN-CVE-2024-35870 |
| Rocky Linux:9 | kernel | 0:5.14.0-427.24.1.el9_4.cloud.3.0 | RXSA-2024:4349 |
| Rocky Linux:9 | kernel | 0:5.14.0-427.24.1.el9_4 | RLSA-2024:4349 |
| Ubuntu:22.04:LTS | linux | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:24.04:LTS | linux | 6.8.0-38.38 | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-allwinner-5.19 | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-aws | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:24.04:LTS | linux-aws | 6.8.0-1011.12 | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-aws-5.19 | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-aws-6.2 | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-aws-6.5 | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-aws-6.8 | 6.8.0-1011.12~22.04.1 | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-azure | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:24.04:LTS | linux-azure | 6.8.0-1010.10 | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-azure-5.19 | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-azure-6.2 | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-azure-6.5 | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-azure-6.8 | 6.8.0-1010.10~22.04.1 | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-azure-fde | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-azure-fde-5.19 | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-azure-fde-6.2 | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-gcp | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:24.04:LTS | linux-gcp | 6.8.0-1010.11 | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-gcp-5.19 | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-gcp-6.2 | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-gcp-6.5 | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-gke | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:24.04:LTS | linux-gke | 6.8.0-1006.9 | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-gkeop | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-hwe-5.19 | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-hwe-6.2 | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-hwe-6.5 | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-ibm | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:24.04:LTS | linux-ibm | 6.8.0-1008.8 | UBUNTU-CVE-2024-35870 |
| Ubuntu:24.04:LTS | linux-intel | 6.8.0-1007.14 | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-intel-iot-realtime | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-intel-iotg | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-kvm | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-lowlatency | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:24.04:LTS | linux-lowlatency | 6.8.0-38.38.1 | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-5.19 | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.2 | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.5 | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-nvidia | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:24.04:LTS | linux-nvidia | 6.8.0-1009.9 | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-nvidia-6.2 | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-nvidia-6.5 | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-nvidia-6.8 | 6.8.0-1009.9~22.04.1 | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-nvidia-tegra | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-nvidia-tegra-igx | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-oem-5.17 | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-oem-6.0 | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-oem-6.1 | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-oem-6.5 | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:24.04:LTS | linux-oem-6.8 | 6.8.0-1008.8 | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-oracle | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:24.04:LTS | linux-oracle | 6.8.0-1008.8 | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-oracle-6.5 | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-oracle-6.8 | 6.8.0-1008.8~22.04.1 | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-raspi | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:24.04:LTS | linux-raspi | 6.8.0-1007.7 | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:24.04:LTS | linux-riscv | 6.8.0-38.38.1 | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-riscv-5.19 | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-riscv-6.5 | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-starfive-5.19 | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-starfive-6.2 | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-starfive-6.5 | no fix listed | UBUNTU-CVE-2024-35870 |
| Ubuntu:22.04:LTS | linux-xilinx-zynqmp | no fix listed | UBUNTU-CVE-2024-35870 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | b327a717e506980399464e304e363f94f95eb7a1 – before 755fe68cd4b59e1d2a2dd3286177fd4404f57fedb327a717e506980399464e304e363f94f95eb7a1 – before 6202996a1c1887e83d0b3b0fcd86d0e5e6910ea0b327a717e506980399464e304e363f94f95eb7a1 – before 45f2beda1f1bc3d962ec07db1ccc3197c25499a5b327a717e506980399464e304e363f94f95eb7a1 – before 24a9799aa8efecd0eb55a75e35f9d8e6400063aa |
| Linux | Linux | 4.16 |
Weakness: CWE-416 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
References
- https://git.kernel.org/stable/c/755fe68cd4b59e1d2a2dd3286177fd4404f57fed
- https://git.kernel.org/stable/c/6202996a1c1887e83d0b3b0fcd86d0e5e6910ea0
- https://git.kernel.org/stable/c/45f2beda1f1bc3d962ec07db1ccc3197c25499a5
- https://git.kernel.org/stable/c/24a9799aa8efecd0eb55a75e35f9d8e6400063aa
- https://lists.debian.org/debian-lts-announce/2025/03/msg00001.html