Vulnerability · Published Mar 2, 2024 · Assigned by Linux
CVE-2023-52564Revert "tty: n_gsm: fix UAF in gsm_cleanup_mux"
Medium 5.5
In plain English
A medium-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.2% (higher than 16% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
In the Linux kernel, the following vulnerability has been resolved: Revert "tty: n_gsm: fix UAF in gsm_cleanup_mux" This reverts commit 9b9c8195f3f0d74a826077fc1c01b9ee74907239. The commit above is reverted as it did not solve the original issue. gsm_cleanup_mux() tries to free up the virtual ttys by calling gsm_dlci_release() for each available DLCI. There, dlci_put() is called to decrease the reference counter for the DLCI via tty_port_put() which finally calls gsm_dlci_free(). This already clears the pointer which is being checked in gsm_cleanup_mux() before calling gsm_dlci_release(). Therefore, it is not necessary to clear this pointer in gsm_cleanup_mux() as done in the reverted commit. The commit introduces a null pointer dereference: <TASK> ? __die+0x1f/0x70 ? page_fault_oops+0x156/0x420 ? search_exception_tables+0x37/0x50 ? fixup_exception+0x21/0x310 ? exc_page_fault+0x69/0x150 ? asm_exc_page_fault+0x26/0x30 ? tty_port_put+0x19/0xa0 gsmtty_cleanup+0x29/0x80 [n_gsm] release_one_tty+0x37/0xe0 process_one_work+0x1e6/0x3e0 worker_thread+0x4c/0x3d0 ? __pfx_worker_thread+0x10/0x10 kthread+0xe1/0x110 ? __pfx_kthread+0x10/0x10 ret_from_fork+0x2f/0x50 ? __pfx_kthread+0x10/0x10 ret_from_fork_asm+0x1b/0x30 </TASK> The actual issue is that nothing guards dlci_put() from being called multiple times while the tty driver was triggered but did not yet finished calling gsm_dlci_free().
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | linux | 6.1.64-1 | DEBIAN-CVE-2023-52564 |
| Debian:13 | linux | 6.5.6-1 | DEBIAN-CVE-2023-52564 |
| Debian:14 | linux | 6.5.6-1 | DEBIAN-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux | 5.15.0-94.104 | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-allwinner-5.19 | no fix listed | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-aws | 5.15.0-1053.58 | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-aws-5.19 | no fix listed | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-aws-6.2 | no fix listed | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-aws-6.5 | no fix listed | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-azure | 5.15.0-1056.64 | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-azure-5.19 | no fix listed | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-azure-6.2 | no fix listed | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-azure-6.5 | no fix listed | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-azure-fde | 5.15.0-1056.64.1 | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-azure-fde-5.19 | no fix listed | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-azure-fde-6.2 | no fix listed | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-gcp | 5.15.0-1051.59 | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-gcp-5.19 | no fix listed | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-gcp-6.2 | no fix listed | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-gcp-6.5 | 6.5.0-1013.13~22.04.1 | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-gke | 5.15.0-1050.55 | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-gkeop | 5.15.0-1036.42 | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-hwe-5.19 | no fix listed | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-hwe-6.2 | no fix listed | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-hwe-6.5 | 6.5.0-17.17~22.04.1 | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-ibm | 5.15.0-1046.49 | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-intel-iotg | 5.15.0-1047.53 | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-kvm | 5.15.0-1050.55 | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-lowlatency | 5.15.0-94.104 | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-5.19 | no fix listed | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.2 | no fix listed | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.5 | 6.5.0-17.17.1.1.1~22.04.1 | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-nvidia | 5.15.0-1044.44 | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-nvidia-6.2 | no fix listed | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-nvidia-6.5 | 6.5.0-1014.14 | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-nvidia-tegra | 5.15.0-1022.22 | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-nvidia-tegra-igx | 5.15.0-1009.9 | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-oem-5.17 | no fix listed | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-oem-6.0 | no fix listed | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-oem-6.1 | no fix listed | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-oem-6.5 | 6.5.0-1014.15 | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-oracle | 5.15.0-1051.57 | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-oracle-6.5 | 6.5.0-1015.15~22.04.1 | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-raspi | 5.15.0-1046.49 | UBUNTU-CVE-2023-52564 |
| Ubuntu:24.04:LTS | linux-raspi | 6.7.0-1001.1 | UBUNTU-CVE-2023-52564 |
| Ubuntu:24.04:LTS | linux-raspi-realtime | no fix listed | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-riscv-5.19 | no fix listed | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-starfive-5.19 | no fix listed | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-starfive-6.2 | no fix listed | UBUNTU-CVE-2023-52564 |
| Ubuntu:22.04:LTS | linux-xilinx-zynqmp | 5.15.0-1027.31 | UBUNTU-CVE-2023-52564 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | 8fc0eabaa73bbd9bd705577071564616da5c8c61 – before 6d5c8862932d31a810b6545f7d69ecc124402c6e5138c228311a863c3cf937b94a3ab4c87f1f70c4 – before a48d2bcd23f2c98d575bc2f9b7a3fbd16aeea9eb9615ca54bc138e35353a001e8b5d4824dce72188 – before c61d0b87a7028c2c10faffc524d748334c7b98279b9c8195f3f0d74a826077fc1c01b9ee74907239 – before 2bff660e0ff349dee84dc4f6f6d10da4497f5b289b9c8195f3f0d74a826077fc1c01b9ee74907239 – before 29346e217b8ab8a52889b88f00b268278d6b766874a8d6f50cc90ed0061997db51dfa81a62b0f8355.10.190 – before 5.10.1985.15.124 – before 5.15.134 |
| Linux | Linux | 6.5 |
References
- https://git.kernel.org/stable/c/6d5c8862932d31a810b6545f7d69ecc124402c6e
- https://git.kernel.org/stable/c/a48d2bcd23f2c98d575bc2f9b7a3fbd16aeea9eb
- https://git.kernel.org/stable/c/c61d0b87a7028c2c10faffc524d748334c7b9827
- https://git.kernel.org/stable/c/2bff660e0ff349dee84dc4f6f6d10da4497f5b28
- https://git.kernel.org/stable/c/29346e217b8ab8a52889b88f00b268278d6b7668