CVE-2021-47527

serial: core: fix transmit-buffer reset and memleak

MEDIUM
5.5
CVSS Score
Published: May 24, 2024 at 03:09 PM UTC
Updated: June 17, 2026 at 04:17 AM UTC
1 product affected across 1 vendorLinux Kernel

Using Linux by Linux?

Get instant alerts when new vulnerabilities affect Linux - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM5.5
Exploit prediction
EPSS 0.3%
SSVC
No known exploit

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

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

4.10 ≤ v < 4.14.2574.15 ≤ v < 4.19.2204.20 ≤ v < 5.4.1644.9 ≤ v < 4.14.2574.9 ≤ v < 4.19.2204.9 ≤ v < 4.9.2924.9 ≤ v < 5.10.844.9 ≤ v < 5.15.74.9 ≤ v < 5.164.9 ≤ v < 5.4.1645.11 ≤ v < 5.15.75.5 ≤ v < 5.10.844.95.16 rc15.16 rc25.16 rc3761ed4a94582ab291aa24dcbea4e01e8936488c8
Vendor states this is fixed in 00de977f9e0aa9760d9a79d1e41ff780f74e3424 (fixed)
Vendor states this is fixed in 011f6c92b5bf6e1fbfdedc8b5232f64c1c493206 (fixed)
Vendor states this is fixed in 1179b168fa3f3a6aae3bd140000455a0e58457db (fixed)
Vendor states this is fixed in 64e491c1634b73d3bddc081d08620bdc92ab2c12 (fixed)
Vendor states this is fixed in c5da8aa441053958594f94254592bb41264bdfbf (fixed)
Vendor states this is fixed in e1722acf4f0d4d67b60f57e08ce16f8b66cd4b8f (fixed)
Vendor states this is fixed in e74d9663fd57640fc3394abb5c76fa95b9cc2f2e (fixed)
Vendor states this is fixed in 4.14.257 (unaffected)
Vendor states this is fixed in 4.19.220 (unaffected)
Vendor states this is fixed in 4.9 (unaffected)
Vendor states this is fixed in 4.9.292 (unaffected)
Vendor states this is fixed in 5.10.84 (unaffected)
Vendor states this is fixed in 5.15.7 (unaffected)
Vendor states this is fixed in 5.16 (unaffected)
Vendor states this is fixed in 5.4.164 (unaffected)

References (7)

Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/00de977f9e0aa9760d9a79d1e41ff780f74e3424
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/011f6c92b5bf6e1fbfdedc8b5232f64c1c493206
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/1179b168fa3f3a6aae3bd140000455a0e58457db
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/64e491c1634b73d3bddc081d08620bdc92ab2c12
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/c5da8aa441053958594f94254592bb41264bdfbf
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/e1722acf4f0d4d67b60f57e08ce16f8b66cd4b8f
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/e74d9663fd57640fc3394abb5c76fa95b9cc2f2e

SSVC — Action Prioritization

SSVCNo known exploitNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

Attack Vector
LOCAL
Complexity
LOW
Privileges
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
NONE
Integrity
NONE
Availability
HIGH
Vector?

Quick Info

StatusANALYZED
CWE
CWE-401

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card