Lucene search

K
cve416baaa9-dc9f-4396-8d5f-8c081fb06d67CVE-2021-47527
HistoryMay 24, 2024 - 3:15 p.m.

CVE-2021-47527

2024-05-2415:15:15
416baaa9-dc9f-4396-8d5f-8c081fb06d67
web.nvd.nist.gov
23
linux kernel
serial core
vulnerability
transmit buffer
memory leak

6.9 Medium

AI Score

Confidence

High

0.0004 Low

EPSS

Percentile

10.3%

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 configurations

Vulners
Node
linuxlinux_kernelRange4.94.9.292
OR
linuxlinux_kernelRange4.10.04.14.257
OR
linuxlinux_kernelRange4.15.04.19.220
OR
linuxlinux_kernelRange4.20.05.4.164
OR
linuxlinux_kernelRange5.5.05.10.84
OR
linuxlinux_kernelRange5.11.05.15.7
OR
linuxlinux_kernelRange5.16.0

CNA Affected

[
  {
    "product": "Linux",
    "vendor": "Linux",
    "defaultStatus": "unaffected",
    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
    "programFiles": [
      "drivers/tty/serial/serial_core.c"
    ],
    "versions": [
      {
        "version": "761ed4a94582",
        "lessThan": "011f6c92b5bf",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "761ed4a94582",
        "lessThan": "e74d9663fd57",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "761ed4a94582",
        "lessThan": "1179b168fa3f",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "761ed4a94582",
        "lessThan": "c5da8aa44105",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "761ed4a94582",
        "lessThan": "e1722acf4f0d",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "761ed4a94582",
        "lessThan": "64e491c1634b",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "761ed4a94582",
        "lessThan": "00de977f9e0a",
        "status": "affected",
        "versionType": "git"
      }
    ]
  },
  {
    "product": "Linux",
    "vendor": "Linux",
    "defaultStatus": "affected",
    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
    "programFiles": [
      "drivers/tty/serial/serial_core.c"
    ],
    "versions": [
      {
        "version": "4.9",
        "status": "affected"
      },
      {
        "version": "0",
        "lessThan": "4.9",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "4.9.292",
        "lessThanOrEqual": "4.9.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "4.14.257",
        "lessThanOrEqual": "4.14.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "4.19.220",
        "lessThanOrEqual": "4.19.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "5.4.164",
        "lessThanOrEqual": "5.4.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "5.10.84",
        "lessThanOrEqual": "5.10.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "5.15.7",
        "lessThanOrEqual": "5.15.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "5.16",
        "lessThanOrEqual": "*",
        "status": "unaffected",
        "versionType": "original_commit_for_fix"
      }
    ]
  }
]

6.9 Medium

AI Score

Confidence

High

0.0004 Low

EPSS

Percentile

10.3%