Vulnerability · Published May 24, 2024 · Assigned by Linux
CVE-2021-47527serial: core: fix transmit-buffer reset and memleak
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.3% (higher than 17% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
In the Linux kernel, the following vulnerability has been resolved: serial: core: fix transmit-buffer reset and memleak Commit 761ed4a94582 ("tty: serial_core: convert uart_close to use tty_port_close") converted serial core to use tty_port_close() but failed to notice that the transmit buffer still needs to be freed on final close. Not freeing the transmit buffer means that the buffer is no longer cleared on next open so that any ioctl() waiting for the buffer to drain might wait indefinitely (e.g. on termios changes) or that stale data can end up being transmitted in case tx is restarted. Furthermore, the buffer of any port that has been opened would leak on driver unbind. Note that the port lock is held when clearing the buffer pointer due to the ldisc race worked around by commit a5ba1d95e46e ("uart: fix race between uart_put_char() and uart_shutdown()"). Also note that the tty-port shutdown() callback is not called for console ports so it is not strictly necessary to free the buffer page after releasing the lock (cf. d72402145ace ("tty/serial: do not free trasnmit buffer page under port lock")).
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| AlmaLinux:8 | bpftool | 4.18.0-553.22.1.el8_10 | ALSA-2024:7000 |
| AlmaLinux:8 | kernel | 4.18.0-553.22.1.el8_10 | ALSA-2024:7000 |
| AlmaLinux:8 | kernel-abi-stablelists | 4.18.0-553.22.1.el8_10 | ALSA-2024:7000 |
| AlmaLinux:8 | kernel-core | 4.18.0-553.22.1.el8_10 | ALSA-2024:7000 |
| AlmaLinux:8 | kernel-cross-headers | 4.18.0-553.22.1.el8_10 | ALSA-2024:7000 |
| AlmaLinux:8 | kernel-debug | 4.18.0-553.22.1.el8_10 | ALSA-2024:7000 |
| AlmaLinux:8 | kernel-debug-core | 4.18.0-553.22.1.el8_10 | ALSA-2024:7000 |
| AlmaLinux:8 | kernel-debug-devel | 4.18.0-553.22.1.el8_10 | ALSA-2024:7000 |
| AlmaLinux:8 | kernel-debug-modules | 4.18.0-553.22.1.el8_10 | ALSA-2024:7000 |
| AlmaLinux:8 | kernel-debug-modules-extra | 4.18.0-553.22.1.el8_10 | ALSA-2024:7000 |
| AlmaLinux:8 | kernel-devel | 4.18.0-553.22.1.el8_10 | ALSA-2024:7000 |
| AlmaLinux:8 | kernel-doc | 4.18.0-553.22.1.el8_10 | ALSA-2024:7000 |
| AlmaLinux:8 | kernel-headers | 4.18.0-553.22.1.el8_10 | ALSA-2024:7000 |
| AlmaLinux:8 | kernel-modules | 4.18.0-553.22.1.el8_10 | ALSA-2024:7000 |
| AlmaLinux:8 | kernel-modules-extra | 4.18.0-553.22.1.el8_10 | ALSA-2024:7000 |
| AlmaLinux:8 | kernel-rt | 4.18.0-553.22.1.rt7.363.el8_10 | ALSA-2024:7001 |
| AlmaLinux:8 | kernel-rt-core | 4.18.0-553.22.1.rt7.363.el8_10 | ALSA-2024:7001 |
| AlmaLinux:8 | kernel-rt-debug | 4.18.0-553.22.1.rt7.363.el8_10 | ALSA-2024:7001 |
| AlmaLinux:8 | kernel-rt-debug-core | 4.18.0-553.22.1.rt7.363.el8_10 | ALSA-2024:7001 |
| AlmaLinux:8 | kernel-rt-debug-devel | 4.18.0-553.22.1.rt7.363.el8_10 | ALSA-2024:7001 |
| AlmaLinux:8 | kernel-rt-debug-kvm | 4.18.0-553.22.1.rt7.363.el8_10 | ALSA-2024:7001 |
| AlmaLinux:8 | kernel-rt-debug-modules | 4.18.0-553.22.1.rt7.363.el8_10 | ALSA-2024:7001 |
| AlmaLinux:8 | kernel-rt-debug-modules-extra | 4.18.0-553.22.1.rt7.363.el8_10 | ALSA-2024:7001 |
| AlmaLinux:8 | kernel-rt-devel | 4.18.0-553.22.1.rt7.363.el8_10 | ALSA-2024:7001 |
| AlmaLinux:8 | kernel-rt-kvm | 4.18.0-553.22.1.rt7.363.el8_10 | ALSA-2024:7001 |
| AlmaLinux:8 | kernel-rt-modules | 4.18.0-553.22.1.rt7.363.el8_10 | ALSA-2024:7001 |
| AlmaLinux:8 | kernel-rt-modules-extra | 4.18.0-553.22.1.rt7.363.el8_10 | ALSA-2024:7001 |
| AlmaLinux:8 | kernel-tools | 4.18.0-553.22.1.el8_10 | ALSA-2024:7000 |
| AlmaLinux:8 | kernel-tools-libs | 4.18.0-553.22.1.el8_10 | ALSA-2024:7000 |
| AlmaLinux:8 | kernel-tools-libs-devel | 4.18.0-553.22.1.el8_10 | ALSA-2024:7000 |
| AlmaLinux:8 | kernel-zfcpdump | 4.18.0-553.22.1.el8_10 | ALSA-2024:7000 |
| AlmaLinux:8 | kernel-zfcpdump-core | 4.18.0-553.22.1.el8_10 | ALSA-2024:7000 |
| AlmaLinux:8 | kernel-zfcpdump-devel | 4.18.0-553.22.1.el8_10 | ALSA-2024:7000 |
| AlmaLinux:8 | kernel-zfcpdump-modules | 4.18.0-553.22.1.el8_10 | ALSA-2024:7000 |
| AlmaLinux:8 | kernel-zfcpdump-modules-extra | 4.18.0-553.22.1.el8_10 | ALSA-2024:7000 |
| AlmaLinux:8 | perf | 4.18.0-553.22.1.el8_10 | ALSA-2024:7000 |
| AlmaLinux:8 | python3-perf | 4.18.0-553.22.1.el8_10 | ALSA-2024:7000 |
| Debian:12 | linux | 5.15.15-1 | DEBIAN-CVE-2021-47527 |
| Debian:13 | linux | 5.15.15-1 | DEBIAN-CVE-2021-47527 |
| Debian:14 | linux | 5.15.15-1 | DEBIAN-CVE-2021-47527 |
| Rocky Linux:8 | kernel | 0:4.18.0-553.22.1.el8_10 | RLSA-2024:7000 |
| Rocky Linux:8 | kernel-rt | 0:4.18.0-553.22.1.rt7.363.el8_10 | RLSA-2024:7001 |
| Ubuntu:22.04:LTS | linux-allwinner-5.19 | no fix listed | UBUNTU-CVE-2021-47527 |
| Ubuntu:22.04:LTS | linux-aws-5.19 | no fix listed | UBUNTU-CVE-2021-47527 |
| Ubuntu:22.04:LTS | linux-aws-6.2 | no fix listed | UBUNTU-CVE-2021-47527 |
| Ubuntu:22.04:LTS | linux-azure-5.19 | no fix listed | UBUNTU-CVE-2021-47527 |
| Ubuntu:22.04:LTS | linux-azure-6.2 | no fix listed | UBUNTU-CVE-2021-47527 |
| Ubuntu:22.04:LTS | linux-azure-fde-5.19 | no fix listed | UBUNTU-CVE-2021-47527 |
| Ubuntu:22.04:LTS | linux-azure-fde-6.2 | no fix listed | UBUNTU-CVE-2021-47527 |
| Ubuntu:22.04:LTS | linux-gcp-5.19 | no fix listed | UBUNTU-CVE-2021-47527 |
| Ubuntu:22.04:LTS | linux-gcp-6.2 | no fix listed | UBUNTU-CVE-2021-47527 |
| Ubuntu:22.04:LTS | linux-hwe-5.19 | no fix listed | UBUNTU-CVE-2021-47527 |
| Ubuntu:22.04:LTS | linux-hwe-6.2 | no fix listed | UBUNTU-CVE-2021-47527 |
| Ubuntu:22.04:LTS | linux-intel-iot-realtime | no fix listed | UBUNTU-CVE-2021-47527 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-5.19 | no fix listed | UBUNTU-CVE-2021-47527 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.2 | no fix listed | UBUNTU-CVE-2021-47527 |
| Ubuntu:22.04:LTS | linux-nvidia-6.2 | no fix listed | UBUNTU-CVE-2021-47527 |
| Ubuntu:22.04:LTS | linux-oem-5.17 | no fix listed | UBUNTU-CVE-2021-47527 |
| Ubuntu:22.04:LTS | linux-oem-6.0 | no fix listed | UBUNTU-CVE-2021-47527 |
| Ubuntu:22.04:LTS | linux-oem-6.1 | no fix listed | UBUNTU-CVE-2021-47527 |
| Ubuntu:24.04:LTS | linux-raspi-realtime | no fix listed | UBUNTU-CVE-2021-47527 |
| Ubuntu:22.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2021-47527 |
| Ubuntu:22.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2021-47527 |
| Ubuntu:22.04:LTS | linux-riscv-5.19 | no fix listed | UBUNTU-CVE-2021-47527 |
| Ubuntu:22.04:LTS | linux-starfive-5.19 | no fix listed | UBUNTU-CVE-2021-47527 |
| Ubuntu:22.04:LTS | linux-starfive-6.2 | no fix listed | UBUNTU-CVE-2021-47527 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | 761ed4a94582ab291aa24dcbea4e01e8936488c8 – before 011f6c92b5bf6e1fbfdedc8b5232f64c1c493206761ed4a94582ab291aa24dcbea4e01e8936488c8 – before e74d9663fd57640fc3394abb5c76fa95b9cc2f2e761ed4a94582ab291aa24dcbea4e01e8936488c8 – before 1179b168fa3f3a6aae3bd140000455a0e58457db761ed4a94582ab291aa24dcbea4e01e8936488c8 – before c5da8aa441053958594f94254592bb41264bdfbf761ed4a94582ab291aa24dcbea4e01e8936488c8 – before e1722acf4f0d4d67b60f57e08ce16f8b66cd4b8f761ed4a94582ab291aa24dcbea4e01e8936488c8 – before 64e491c1634b73d3bddc081d08620bdc92ab2c12761ed4a94582ab291aa24dcbea4e01e8936488c8 – before 00de977f9e0aa9760d9a79d1e41ff780f74e3424 |
| Linux | Linux | 4.9 |
References
- https://git.kernel.org/stable/c/011f6c92b5bf6e1fbfdedc8b5232f64c1c493206
- https://git.kernel.org/stable/c/e74d9663fd57640fc3394abb5c76fa95b9cc2f2e
- https://git.kernel.org/stable/c/1179b168fa3f3a6aae3bd140000455a0e58457db
- https://git.kernel.org/stable/c/c5da8aa441053958594f94254592bb41264bdfbf
- https://git.kernel.org/stable/c/e1722acf4f0d4d67b60f57e08ce16f8b66cd4b8f
- https://git.kernel.org/stable/c/64e491c1634b73d3bddc081d08620bdc92ab2c12
- https://git.kernel.org/stable/c/00de977f9e0aa9760d9a79d1e41ff780f74e3424