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.

Severity (CVSS NVD)5.5Medium
Exploit odds (30 days)0.3%top 83.5% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

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

EcosystemPackageFixed inAdvisory
AlmaLinux:8bpftool4.18.0-553.22.1.el8_10ALSA-2024:7000
AlmaLinux:8kernel4.18.0-553.22.1.el8_10ALSA-2024:7000
AlmaLinux:8kernel-abi-stablelists4.18.0-553.22.1.el8_10ALSA-2024:7000
AlmaLinux:8kernel-core4.18.0-553.22.1.el8_10ALSA-2024:7000
AlmaLinux:8kernel-cross-headers4.18.0-553.22.1.el8_10ALSA-2024:7000
AlmaLinux:8kernel-debug4.18.0-553.22.1.el8_10ALSA-2024:7000
AlmaLinux:8kernel-debug-core4.18.0-553.22.1.el8_10ALSA-2024:7000
AlmaLinux:8kernel-debug-devel4.18.0-553.22.1.el8_10ALSA-2024:7000
AlmaLinux:8kernel-debug-modules4.18.0-553.22.1.el8_10ALSA-2024:7000
AlmaLinux:8kernel-debug-modules-extra4.18.0-553.22.1.el8_10ALSA-2024:7000
AlmaLinux:8kernel-devel4.18.0-553.22.1.el8_10ALSA-2024:7000
AlmaLinux:8kernel-doc4.18.0-553.22.1.el8_10ALSA-2024:7000
AlmaLinux:8kernel-headers4.18.0-553.22.1.el8_10ALSA-2024:7000
AlmaLinux:8kernel-modules4.18.0-553.22.1.el8_10ALSA-2024:7000
AlmaLinux:8kernel-modules-extra4.18.0-553.22.1.el8_10ALSA-2024:7000
AlmaLinux:8kernel-rt4.18.0-553.22.1.rt7.363.el8_10ALSA-2024:7001
AlmaLinux:8kernel-rt-core4.18.0-553.22.1.rt7.363.el8_10ALSA-2024:7001
AlmaLinux:8kernel-rt-debug4.18.0-553.22.1.rt7.363.el8_10ALSA-2024:7001
AlmaLinux:8kernel-rt-debug-core4.18.0-553.22.1.rt7.363.el8_10ALSA-2024:7001
AlmaLinux:8kernel-rt-debug-devel4.18.0-553.22.1.rt7.363.el8_10ALSA-2024:7001
AlmaLinux:8kernel-rt-debug-kvm4.18.0-553.22.1.rt7.363.el8_10ALSA-2024:7001
AlmaLinux:8kernel-rt-debug-modules4.18.0-553.22.1.rt7.363.el8_10ALSA-2024:7001
AlmaLinux:8kernel-rt-debug-modules-extra4.18.0-553.22.1.rt7.363.el8_10ALSA-2024:7001
AlmaLinux:8kernel-rt-devel4.18.0-553.22.1.rt7.363.el8_10ALSA-2024:7001
AlmaLinux:8kernel-rt-kvm4.18.0-553.22.1.rt7.363.el8_10ALSA-2024:7001
AlmaLinux:8kernel-rt-modules4.18.0-553.22.1.rt7.363.el8_10ALSA-2024:7001
AlmaLinux:8kernel-rt-modules-extra4.18.0-553.22.1.rt7.363.el8_10ALSA-2024:7001
AlmaLinux:8kernel-tools4.18.0-553.22.1.el8_10ALSA-2024:7000
AlmaLinux:8kernel-tools-libs4.18.0-553.22.1.el8_10ALSA-2024:7000
AlmaLinux:8kernel-tools-libs-devel4.18.0-553.22.1.el8_10ALSA-2024:7000
AlmaLinux:8kernel-zfcpdump4.18.0-553.22.1.el8_10ALSA-2024:7000
AlmaLinux:8kernel-zfcpdump-core4.18.0-553.22.1.el8_10ALSA-2024:7000
AlmaLinux:8kernel-zfcpdump-devel4.18.0-553.22.1.el8_10ALSA-2024:7000
AlmaLinux:8kernel-zfcpdump-modules4.18.0-553.22.1.el8_10ALSA-2024:7000
AlmaLinux:8kernel-zfcpdump-modules-extra4.18.0-553.22.1.el8_10ALSA-2024:7000
AlmaLinux:8perf4.18.0-553.22.1.el8_10ALSA-2024:7000
AlmaLinux:8python3-perf4.18.0-553.22.1.el8_10ALSA-2024:7000
Debian:12linux5.15.15-1DEBIAN-CVE-2021-47527
Debian:13linux5.15.15-1DEBIAN-CVE-2021-47527
Debian:14linux5.15.15-1DEBIAN-CVE-2021-47527
Rocky Linux:8kernel0:4.18.0-553.22.1.el8_10RLSA-2024:7000
Rocky Linux:8kernel-rt0:4.18.0-553.22.1.rt7.363.el8_10RLSA-2024:7001
Ubuntu:22.04:LTSlinux-allwinner-5.19no fix listedUBUNTU-CVE-2021-47527
Ubuntu:22.04:LTSlinux-aws-5.19no fix listedUBUNTU-CVE-2021-47527
Ubuntu:22.04:LTSlinux-aws-6.2no fix listedUBUNTU-CVE-2021-47527
Ubuntu:22.04:LTSlinux-azure-5.19no fix listedUBUNTU-CVE-2021-47527
Ubuntu:22.04:LTSlinux-azure-6.2no fix listedUBUNTU-CVE-2021-47527
Ubuntu:22.04:LTSlinux-azure-fde-5.19no fix listedUBUNTU-CVE-2021-47527
Ubuntu:22.04:LTSlinux-azure-fde-6.2no fix listedUBUNTU-CVE-2021-47527
Ubuntu:22.04:LTSlinux-gcp-5.19no fix listedUBUNTU-CVE-2021-47527
Ubuntu:22.04:LTSlinux-gcp-6.2no fix listedUBUNTU-CVE-2021-47527
Ubuntu:22.04:LTSlinux-hwe-5.19no fix listedUBUNTU-CVE-2021-47527
Ubuntu:22.04:LTSlinux-hwe-6.2no fix listedUBUNTU-CVE-2021-47527
Ubuntu:22.04:LTSlinux-intel-iot-realtimeno fix listedUBUNTU-CVE-2021-47527
Ubuntu:22.04:LTSlinux-lowlatency-hwe-5.19no fix listedUBUNTU-CVE-2021-47527
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.2no fix listedUBUNTU-CVE-2021-47527
Ubuntu:22.04:LTSlinux-nvidia-6.2no fix listedUBUNTU-CVE-2021-47527
Ubuntu:22.04:LTSlinux-oem-5.17no fix listedUBUNTU-CVE-2021-47527
Ubuntu:22.04:LTSlinux-oem-6.0no fix listedUBUNTU-CVE-2021-47527
Ubuntu:22.04:LTSlinux-oem-6.1no fix listedUBUNTU-CVE-2021-47527
Ubuntu:24.04:LTSlinux-raspi-realtimeno fix listedUBUNTU-CVE-2021-47527
Ubuntu:22.04:LTSlinux-realtimeno fix listedUBUNTU-CVE-2021-47527
Ubuntu:22.04:LTSlinux-riscvno fix listedUBUNTU-CVE-2021-47527
Ubuntu:22.04:LTSlinux-riscv-5.19no fix listedUBUNTU-CVE-2021-47527
Ubuntu:22.04:LTSlinux-starfive-5.19no fix listedUBUNTU-CVE-2021-47527
Ubuntu:22.04:LTSlinux-starfive-6.2no fix listedUBUNTU-CVE-2021-47527

Affected products (as reported)

VendorProductVersions
Linux Linux 761ed4a94582ab291aa24dcbea4e01e8936488c8 – before 011f6c92b5bf6e1fbfdedc8b5232f64c1c493206761ed4a94582ab291aa24dcbea4e01e8936488c8 – before e74d9663fd57640fc3394abb5c76fa95b9cc2f2e761ed4a94582ab291aa24dcbea4e01e8936488c8 – before 1179b168fa3f3a6aae3bd140000455a0e58457db761ed4a94582ab291aa24dcbea4e01e8936488c8 – before c5da8aa441053958594f94254592bb41264bdfbf761ed4a94582ab291aa24dcbea4e01e8936488c8 – before e1722acf4f0d4d67b60f57e08ce16f8b66cd4b8f761ed4a94582ab291aa24dcbea4e01e8936488c8 – before 64e491c1634b73d3bddc081d08620bdc92ab2c12761ed4a94582ab291aa24dcbea4e01e8936488c8 – before 00de977f9e0aa9760d9a79d1e41ff780f74e3424
Linux Linux 4.9

References