Vulnerability · Published May 19, 2024 · Assigned by Linux
CVE-2024-35910tcp: properly terminate timers for kernel sockets
High 7.8
In plain English
A high-severity security flaw 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.3% (higher than 18% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
In the Linux kernel, the following vulnerability has been resolved: tcp: properly terminate timers for kernel sockets We had various syzbot reports about tcp timers firing after the corresponding netns has been dismantled. Fortunately Josef Bacik could trigger the issue more often, and could test a patch I wrote two years ago. When TCP sockets are closed, we call inet_csk_clear_xmit_timers() to 'stop' the timers. inet_csk_clear_xmit_timers() can be called from any context, including when socket lock is held. This is the reason it uses sk_stop_timer(), aka del_timer(). This means that ongoing timers might finish much later. For user sockets, this is fine because each running timer holds a reference on the socket, and the user socket holds a reference on the netns. For kernel sockets, we risk that the netns is freed before timer can complete, because kernel sockets do not hold reference on the netns. This patch adds inet_csk_clear_xmit_timers_sync() function that using sk_stop_timer_sync() to make sure all timers are terminated before the kernel socket is released. Modules using kernel sockets close them in their netns exit() handler. Also add sock_not_owned_by_me() helper to get LOCKDEP support : inet_csk_clear_xmit_timers_sync() must not be called while socket lock is held. It is very possible we can revert in the future commit 3a58f13a881e ("net: rds: acquire refcount on TCP sockets") which attempted to solve the issue in rds only. (net/smc/af_smc.c and net/mptcp/subflow.c have similar code) We probably can remove the check_net() tests from tcp_out_of_resources() and __tcp_close() in the future.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | linux | 6.1.85-1 | DEBIAN-CVE-2024-35910 |
| Debian:13 | linux | 6.8.9-1 | DEBIAN-CVE-2024-35910 |
| Debian:14 | linux | 6.8.9-1 | DEBIAN-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux | 5.15.0-116.126 | UBUNTU-CVE-2024-35910 |
| Ubuntu:24.04:LTS | linux | 6.8.0-38.38 | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-allwinner-5.19 | no fix listed | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-aws | 5.15.0-1065.71 | UBUNTU-CVE-2024-35910 |
| Ubuntu:24.04:LTS | linux-aws | 6.8.0-1011.12 | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-aws-5.19 | no fix listed | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-aws-6.2 | no fix listed | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-aws-6.5 | no fix listed | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-aws-6.8 | 6.8.0-1011.12~22.04.1 | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-azure | 5.15.0-1068.77 | UBUNTU-CVE-2024-35910 |
| Ubuntu:24.04:LTS | linux-azure | 6.8.0-1010.10 | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-azure-5.19 | no fix listed | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-azure-6.2 | no fix listed | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-azure-6.5 | no fix listed | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-azure-6.8 | 6.8.0-1010.10~22.04.1 | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-azure-fde | 5.15.0-1068.77.1 | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-azure-fde-5.19 | no fix listed | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-azure-fde-6.2 | no fix listed | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-gcp | 5.15.0-1064.72 | UBUNTU-CVE-2024-35910 |
| Ubuntu:24.04:LTS | linux-gcp | 6.8.0-1010.11 | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-gcp-5.19 | no fix listed | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-gcp-6.2 | no fix listed | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-gcp-6.5 | no fix listed | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-gke | 5.15.0-1062.68 | UBUNTU-CVE-2024-35910 |
| Ubuntu:24.04:LTS | linux-gke | 6.8.0-1006.9 | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-gkeop | 5.15.0-1048.55 | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-hwe-5.19 | no fix listed | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-hwe-6.2 | no fix listed | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-hwe-6.5 | no fix listed | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-ibm | 5.15.0-1058.61 | UBUNTU-CVE-2024-35910 |
| Ubuntu:24.04:LTS | linux-ibm | 6.8.0-1008.8 | UBUNTU-CVE-2024-35910 |
| Ubuntu:24.04:LTS | linux-intel | 6.8.0-1007.14 | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-intel-iotg | 5.15.0-1060.66 | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-kvm | 5.15.0-1062.67 | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-lowlatency | 5.15.0-116.126 | UBUNTU-CVE-2024-35910 |
| Ubuntu:24.04:LTS | linux-lowlatency | 6.8.0-38.38.1 | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-5.19 | no fix listed | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.2 | no fix listed | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.5 | no fix listed | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-nvidia | 5.15.0-1060.61 | UBUNTU-CVE-2024-35910 |
| Ubuntu:24.04:LTS | linux-nvidia | 6.8.0-1009.9 | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-nvidia-6.2 | no fix listed | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-nvidia-6.5 | no fix listed | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-nvidia-6.8 | 6.8.0-1009.9~22.04.1 | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-nvidia-tegra | 5.15.0-1026.26 | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-nvidia-tegra-igx | 5.15.0-1015.15 | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-oem-5.17 | no fix listed | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-oem-6.0 | no fix listed | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-oem-6.1 | no fix listed | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-oem-6.5 | no fix listed | UBUNTU-CVE-2024-35910 |
| Ubuntu:24.04:LTS | linux-oem-6.8 | 6.8.0-1008.8 | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-oracle | 5.15.0-1063.69 | UBUNTU-CVE-2024-35910 |
| Ubuntu:24.04:LTS | linux-oracle | 6.8.0-1008.8 | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-oracle-6.5 | no fix listed | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-oracle-6.8 | 6.8.0-1008.8~22.04.1 | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-raspi | 5.15.0-1058.61 | UBUNTU-CVE-2024-35910 |
| Ubuntu:24.04:LTS | linux-raspi | 6.8.0-1007.7 | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2024-35910 |
| Ubuntu:24.04:LTS | linux-riscv | 6.8.0-38.38.1 | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-riscv-5.19 | no fix listed | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-riscv-6.5 | no fix listed | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-starfive-5.19 | no fix listed | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-starfive-6.2 | no fix listed | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-starfive-6.5 | no fix listed | UBUNTU-CVE-2024-35910 |
| Ubuntu:22.04:LTS | linux-xilinx-zynqmp | 5.15.0-1035.39 | UBUNTU-CVE-2024-35910 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | 26abe14379f8e2fa3fd1bcf97c9a7ad9364886fe – before 93f0133b9d589cc6e865f254ad9be3e9d8133f5026abe14379f8e2fa3fd1bcf97c9a7ad9364886fe – before 44e62f5d35678686734afd47c6a421ad30772e7f26abe14379f8e2fa3fd1bcf97c9a7ad9364886fe – before e3e27d2b446deb1f643758a0c4731f5c2249281026abe14379f8e2fa3fd1bcf97c9a7ad9364886fe – before 2e43d8eba6edd1cf05a3a20fdd77688fa7ec16a426abe14379f8e2fa3fd1bcf97c9a7ad9364886fe – before 91b243de910a9ac8476d40238ab3dbfeedd5b7de26abe14379f8e2fa3fd1bcf97c9a7ad9364886fe – before c1ae4d1e76eacddaacb958b67cd942082f800c8726abe14379f8e2fa3fd1bcf97c9a7ad9364886fe – before 899265c1389fe022802aae73dbf13ee08837a35a26abe14379f8e2fa3fd1bcf97c9a7ad9364886fe – before 151c9c724d05d5b0dd8acd3e11cb69ef1f2dbada |
| Linux | Linux | 4.2 |
References
- https://git.kernel.org/stable/c/93f0133b9d589cc6e865f254ad9be3e9d8133f50
- https://git.kernel.org/stable/c/44e62f5d35678686734afd47c6a421ad30772e7f
- https://git.kernel.org/stable/c/e3e27d2b446deb1f643758a0c4731f5c22492810
- https://git.kernel.org/stable/c/2e43d8eba6edd1cf05a3a20fdd77688fa7ec16a4
- https://git.kernel.org/stable/c/91b243de910a9ac8476d40238ab3dbfeedd5b7de
- https://git.kernel.org/stable/c/c1ae4d1e76eacddaacb958b67cd942082f800c87
- https://git.kernel.org/stable/c/899265c1389fe022802aae73dbf13ee08837a35a
- https://git.kernel.org/stable/c/151c9c724d05d5b0dd8acd3e11cb69ef1f2dbada
- https://lists.debian.org/debian-lts-announce/2024/06/msg00017.html x_transferred
- https://lists.debian.org/debian-lts-announce/2024/06/msg00020.html x_transferred
- https://cert-portal.siemens.com/productcert/html/ssa-398330.html
- https://cert-portal.siemens.com/productcert/html/ssa-265688.html