CVE-2021-47527 (GCVE-0-2021-47527)
Vulnerability from cvelistv5
Published
2024-05-24 15:09
Modified
2025-05-04 07:12
Severity ?
Summary
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")).
Impacted products
Vendor Product Version
Linux Linux Version: 761ed4a94582ab291aa24dcbea4e01e8936488c8
Version: 761ed4a94582ab291aa24dcbea4e01e8936488c8
Version: 761ed4a94582ab291aa24dcbea4e01e8936488c8
Version: 761ed4a94582ab291aa24dcbea4e01e8936488c8
Version: 761ed4a94582ab291aa24dcbea4e01e8936488c8
Version: 761ed4a94582ab291aa24dcbea4e01e8936488c8
Version: 761ed4a94582ab291aa24dcbea4e01e8936488c8
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "adp": [
      {
        "metrics": [
          {
            "other": {
              "content": {
                "id": "CVE-2021-47527",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2024-06-10T18:53:22.735670Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2024-06-10T18:53:36.137Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      },
      {
        "providerMetadata": {
          "dateUpdated": "2024-08-04T05:39:59.783Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "references": [
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/011f6c92b5bf6e1fbfdedc8b5232f64c1c493206"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/e74d9663fd57640fc3394abb5c76fa95b9cc2f2e"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/1179b168fa3f3a6aae3bd140000455a0e58457db"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/c5da8aa441053958594f94254592bb41264bdfbf"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/e1722acf4f0d4d67b60f57e08ce16f8b66cd4b8f"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/64e491c1634b73d3bddc081d08620bdc92ab2c12"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/00de977f9e0aa9760d9a79d1e41ff780f74e3424"
          }
        ],
        "title": "CVE Program Container"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/tty/serial/serial_core.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "011f6c92b5bf6e1fbfdedc8b5232f64c1c493206",
              "status": "affected",
              "version": "761ed4a94582ab291aa24dcbea4e01e8936488c8",
              "versionType": "git"
            },
            {
              "lessThan": "e74d9663fd57640fc3394abb5c76fa95b9cc2f2e",
              "status": "affected",
              "version": "761ed4a94582ab291aa24dcbea4e01e8936488c8",
              "versionType": "git"
            },
            {
              "lessThan": "1179b168fa3f3a6aae3bd140000455a0e58457db",
              "status": "affected",
              "version": "761ed4a94582ab291aa24dcbea4e01e8936488c8",
              "versionType": "git"
            },
            {
              "lessThan": "c5da8aa441053958594f94254592bb41264bdfbf",
              "status": "affected",
              "version": "761ed4a94582ab291aa24dcbea4e01e8936488c8",
              "versionType": "git"
            },
            {
              "lessThan": "e1722acf4f0d4d67b60f57e08ce16f8b66cd4b8f",
              "status": "affected",
              "version": "761ed4a94582ab291aa24dcbea4e01e8936488c8",
              "versionType": "git"
            },
            {
              "lessThan": "64e491c1634b73d3bddc081d08620bdc92ab2c12",
              "status": "affected",
              "version": "761ed4a94582ab291aa24dcbea4e01e8936488c8",
              "versionType": "git"
            },
            {
              "lessThan": "00de977f9e0aa9760d9a79d1e41ff780f74e3424",
              "status": "affected",
              "version": "761ed4a94582ab291aa24dcbea4e01e8936488c8",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/tty/serial/serial_core.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "4.9"
            },
            {
              "lessThan": "4.9",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "4.9.*",
              "status": "unaffected",
              "version": "4.9.292",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "4.14.*",
              "status": "unaffected",
              "version": "4.14.257",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "4.19.*",
              "status": "unaffected",
              "version": "4.19.220",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.4.*",
              "status": "unaffected",
              "version": "5.4.164",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.10.*",
              "status": "unaffected",
              "version": "5.10.84",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.15.*",
              "status": "unaffected",
              "version": "5.15.7",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "5.16",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "4.9.292",
                  "versionStartIncluding": "4.9",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "4.14.257",
                  "versionStartIncluding": "4.9",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "4.19.220",
                  "versionStartIncluding": "4.9",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.4.164",
                  "versionStartIncluding": "4.9",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.10.84",
                  "versionStartIncluding": "4.9",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.15.7",
                  "versionStartIncluding": "4.9",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.16",
                  "versionStartIncluding": "4.9",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nserial: core: fix transmit-buffer reset and memleak\n\nCommit 761ed4a94582 (\"tty: serial_core: convert uart_close to use\ntty_port_close\") converted serial core to use tty_port_close() but\nfailed to notice that the transmit buffer still needs to be freed on\nfinal close.\n\nNot freeing the transmit buffer means that the buffer is no longer\ncleared on next open so that any ioctl() waiting for the buffer to drain\nmight wait indefinitely (e.g. on termios changes) or that stale data can\nend up being transmitted in case tx is restarted.\n\nFurthermore, the buffer of any port that has been opened would leak on\ndriver unbind.\n\nNote that the port lock is held when clearing the buffer pointer due to\nthe ldisc race worked around by commit a5ba1d95e46e (\"uart: fix race\nbetween uart_put_char() and uart_shutdown()\").\n\nAlso note that the tty-port shutdown() callback is not called for\nconsole ports so it is not strictly necessary to free the buffer page\nafter releasing the lock (cf. d72402145ace (\"tty/serial: do not free\ntrasnmit buffer page under port lock\"))."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2025-05-04T07:12:53.351Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/011f6c92b5bf6e1fbfdedc8b5232f64c1c493206"
        },
        {
          "url": "https://git.kernel.org/stable/c/e74d9663fd57640fc3394abb5c76fa95b9cc2f2e"
        },
        {
          "url": "https://git.kernel.org/stable/c/1179b168fa3f3a6aae3bd140000455a0e58457db"
        },
        {
          "url": "https://git.kernel.org/stable/c/c5da8aa441053958594f94254592bb41264bdfbf"
        },
        {
          "url": "https://git.kernel.org/stable/c/e1722acf4f0d4d67b60f57e08ce16f8b66cd4b8f"
        },
        {
          "url": "https://git.kernel.org/stable/c/64e491c1634b73d3bddc081d08620bdc92ab2c12"
        },
        {
          "url": "https://git.kernel.org/stable/c/00de977f9e0aa9760d9a79d1e41ff780f74e3424"
        }
      ],
      "title": "serial: core: fix transmit-buffer reset and memleak",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2021-47527",
    "datePublished": "2024-05-24T15:09:38.690Z",
    "dateReserved": "2024-05-24T15:02:54.825Z",
    "dateUpdated": "2025-05-04T07:12:53.351Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "vulnerability-lookup:meta": {
    "vulnrichment": {
      "containers": "{\"adp\": [{\"title\": \"CVE Program Container\", \"references\": [{\"url\": \"https://git.kernel.org/stable/c/011f6c92b5bf6e1fbfdedc8b5232f64c1c493206\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://git.kernel.org/stable/c/e74d9663fd57640fc3394abb5c76fa95b9cc2f2e\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://git.kernel.org/stable/c/1179b168fa3f3a6aae3bd140000455a0e58457db\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://git.kernel.org/stable/c/c5da8aa441053958594f94254592bb41264bdfbf\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://git.kernel.org/stable/c/e1722acf4f0d4d67b60f57e08ce16f8b66cd4b8f\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://git.kernel.org/stable/c/64e491c1634b73d3bddc081d08620bdc92ab2c12\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://git.kernel.org/stable/c/00de977f9e0aa9760d9a79d1e41ff780f74e3424\", \"tags\": [\"x_transferred\"]}], \"providerMetadata\": {\"orgId\": \"af854a3a-2127-422b-91ae-364da2661108\", \"shortName\": \"CVE\", \"dateUpdated\": \"2024-08-04T05:39:59.783Z\"}}, {\"title\": \"CISA ADP Vulnrichment\", \"metrics\": [{\"other\": {\"type\": \"ssvc\", \"content\": {\"id\": \"CVE-2021-47527\", \"role\": \"CISA Coordinator\", \"options\": [{\"Exploitation\": \"none\"}, {\"Automatable\": \"no\"}, {\"Technical Impact\": \"partial\"}], \"version\": \"2.0.3\", \"timestamp\": \"2024-06-10T18:53:22.735670Z\"}}}], \"providerMetadata\": {\"orgId\": \"134c704f-9b21-4f2e-91b3-4a467353bcc0\", \"shortName\": \"CISA-ADP\", \"dateUpdated\": \"2024-06-10T18:53:33.561Z\"}}], \"cna\": {\"title\": \"serial: core: fix transmit-buffer reset and memleak\", \"affected\": [{\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"761ed4a94582ab291aa24dcbea4e01e8936488c8\", \"lessThan\": \"011f6c92b5bf6e1fbfdedc8b5232f64c1c493206\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"761ed4a94582ab291aa24dcbea4e01e8936488c8\", \"lessThan\": \"e74d9663fd57640fc3394abb5c76fa95b9cc2f2e\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"761ed4a94582ab291aa24dcbea4e01e8936488c8\", \"lessThan\": \"1179b168fa3f3a6aae3bd140000455a0e58457db\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"761ed4a94582ab291aa24dcbea4e01e8936488c8\", \"lessThan\": \"c5da8aa441053958594f94254592bb41264bdfbf\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"761ed4a94582ab291aa24dcbea4e01e8936488c8\", \"lessThan\": \"e1722acf4f0d4d67b60f57e08ce16f8b66cd4b8f\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"761ed4a94582ab291aa24dcbea4e01e8936488c8\", \"lessThan\": \"64e491c1634b73d3bddc081d08620bdc92ab2c12\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"761ed4a94582ab291aa24dcbea4e01e8936488c8\", \"lessThan\": \"00de977f9e0aa9760d9a79d1e41ff780f74e3424\", \"versionType\": \"git\"}], \"programFiles\": [\"drivers/tty/serial/serial_core.c\"], \"defaultStatus\": \"unaffected\"}, {\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"4.9\"}, {\"status\": \"unaffected\", \"version\": \"0\", \"lessThan\": \"4.9\", \"versionType\": \"semver\"}, {\"status\": \"unaffected\", \"version\": \"4.9.292\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"4.9.*\"}, {\"status\": \"unaffected\", \"version\": \"4.14.257\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"4.14.*\"}, {\"status\": \"unaffected\", \"version\": \"4.19.220\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"4.19.*\"}, {\"status\": \"unaffected\", \"version\": \"5.4.164\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"5.4.*\"}, {\"status\": \"unaffected\", \"version\": \"5.10.84\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"5.10.*\"}, {\"status\": \"unaffected\", \"version\": \"5.15.7\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"5.15.*\"}, {\"status\": \"unaffected\", \"version\": \"5.16\", \"versionType\": \"original_commit_for_fix\", \"lessThanOrEqual\": \"*\"}], \"programFiles\": [\"drivers/tty/serial/serial_core.c\"], \"defaultStatus\": \"affected\"}], \"references\": [{\"url\": \"https://git.kernel.org/stable/c/011f6c92b5bf6e1fbfdedc8b5232f64c1c493206\"}, {\"url\": \"https://git.kernel.org/stable/c/e74d9663fd57640fc3394abb5c76fa95b9cc2f2e\"}, {\"url\": \"https://git.kernel.org/stable/c/1179b168fa3f3a6aae3bd140000455a0e58457db\"}, {\"url\": \"https://git.kernel.org/stable/c/c5da8aa441053958594f94254592bb41264bdfbf\"}, {\"url\": \"https://git.kernel.org/stable/c/e1722acf4f0d4d67b60f57e08ce16f8b66cd4b8f\"}, {\"url\": \"https://git.kernel.org/stable/c/64e491c1634b73d3bddc081d08620bdc92ab2c12\"}, {\"url\": \"https://git.kernel.org/stable/c/00de977f9e0aa9760d9a79d1e41ff780f74e3424\"}], \"x_generator\": {\"engine\": \"bippy-1.2.0\"}, \"descriptions\": [{\"lang\": \"en\", \"value\": \"In the Linux kernel, the following vulnerability has been resolved:\\n\\nserial: core: fix transmit-buffer reset and memleak\\n\\nCommit 761ed4a94582 (\\\"tty: serial_core: convert uart_close to use\\ntty_port_close\\\") converted serial core to use tty_port_close() but\\nfailed to notice that the transmit buffer still needs to be freed on\\nfinal close.\\n\\nNot freeing the transmit buffer means that the buffer is no longer\\ncleared on next open so that any ioctl() waiting for the buffer to drain\\nmight wait indefinitely (e.g. on termios changes) or that stale data can\\nend up being transmitted in case tx is restarted.\\n\\nFurthermore, the buffer of any port that has been opened would leak on\\ndriver unbind.\\n\\nNote that the port lock is held when clearing the buffer pointer due to\\nthe ldisc race worked around by commit a5ba1d95e46e (\\\"uart: fix race\\nbetween uart_put_char() and uart_shutdown()\\\").\\n\\nAlso note that the tty-port shutdown() callback is not called for\\nconsole ports so it is not strictly necessary to free the buffer page\\nafter releasing the lock (cf. d72402145ace (\\\"tty/serial: do not free\\ntrasnmit buffer page under port lock\\\")).\"}], \"cpeApplicability\": [{\"nodes\": [{\"negate\": false, \"cpeMatch\": [{\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"4.9.292\", \"versionStartIncluding\": \"4.9\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"4.14.257\", \"versionStartIncluding\": \"4.9\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"4.19.220\", \"versionStartIncluding\": \"4.9\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"5.4.164\", \"versionStartIncluding\": \"4.9\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"5.10.84\", \"versionStartIncluding\": \"4.9\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"5.15.7\", \"versionStartIncluding\": \"4.9\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"5.16\", \"versionStartIncluding\": \"4.9\"}], \"operator\": \"OR\"}]}], \"providerMetadata\": {\"orgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"shortName\": \"Linux\", \"dateUpdated\": \"2025-05-04T07:12:53.351Z\"}}}",
      "cveMetadata": "{\"cveId\": \"CVE-2021-47527\", \"state\": \"PUBLISHED\", \"dateUpdated\": \"2025-05-04T07:12:53.351Z\", \"dateReserved\": \"2024-05-24T15:02:54.825Z\", \"assignerOrgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"datePublished\": \"2024-05-24T15:09:38.690Z\", \"assignerShortName\": \"Linux\"}",
      "dataType": "CVE_RECORD",
      "dataVersion": "5.1"
    }
  }
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.


Loading…

Loading…