cve-2021-47496
Vulnerability from cvelistv5
Published
2024-05-22 08:19
Modified
2024-12-19 07:43
Severity ?
Summary
In the Linux kernel, the following vulnerability has been resolved: net/tls: Fix flipped sign in tls_err_abort() calls sk->sk_err appears to expect a positive value, a convention that ktls doesn't always follow and that leads to memory corruption in other code. For instance, [kworker] tls_encrypt_done(..., err=<negative error from crypto request>) tls_err_abort(.., err) sk->sk_err = err; [task] splice_from_pipe_feed ... tls_sw_do_sendpage if (sk->sk_err) { ret = -sk->sk_err; // ret is positive splice_from_pipe_feed (continued) ret = actor(...) // ret is still positive and interpreted as bytes // written, resulting in underflow of buf->len and // sd->len, leading to huge buf->offset and bogus // addresses computed in later calls to actor() Fix all tls_err_abort() callers to pass a negative error code consistently and centralize the error-prone sign flip there, throwing in a warning to catch future misuse and uninlining the function so it really does only warn once.
Impacted products
Vendor Product Version
Linux Linux Version: c46234ebb4d1eee5e09819f49169e51cfc6eb909
Version: c46234ebb4d1eee5e09819f49169e51cfc6eb909
Version: c46234ebb4d1eee5e09819f49169e51cfc6eb909
Version: c46234ebb4d1eee5e09819f49169e51cfc6eb909
Create a notification for this product.
   Linux Linux Version: 4.17
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "adp": [
      {
        "providerMetadata": {
          "dateUpdated": "2024-08-04T05:39:59.752Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "references": [
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/e0cfd5159f314d6b304d030363650b06a2299cbb"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/f3dec7e7ace38224f82cf83f0049159d067c2e19"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/e41473543f75f7dbc5d605007e6f883f1bd13b9a"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/da353fac65fede6b8b4cfe207f0d9408e3121105"
          }
        ],
        "title": "CVE Program Container"
      },
      {
        "metrics": [
          {
            "other": {
              "content": {
                "id": "CVE-2021-47496",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2024-09-10T15:35:52.280096Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2024-09-11T17:33:23.659Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "include/net/tls.h",
            "net/tls/tls_sw.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "e0cfd5159f314d6b304d030363650b06a2299cbb",
              "status": "affected",
              "version": "c46234ebb4d1eee5e09819f49169e51cfc6eb909",
              "versionType": "git"
            },
            {
              "lessThan": "f3dec7e7ace38224f82cf83f0049159d067c2e19",
              "status": "affected",
              "version": "c46234ebb4d1eee5e09819f49169e51cfc6eb909",
              "versionType": "git"
            },
            {
              "lessThan": "e41473543f75f7dbc5d605007e6f883f1bd13b9a",
              "status": "affected",
              "version": "c46234ebb4d1eee5e09819f49169e51cfc6eb909",
              "versionType": "git"
            },
            {
              "lessThan": "da353fac65fede6b8b4cfe207f0d9408e3121105",
              "status": "affected",
              "version": "c46234ebb4d1eee5e09819f49169e51cfc6eb909",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "include/net/tls.h",
            "net/tls/tls_sw.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "4.17"
            },
            {
              "lessThan": "4.17",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.4.*",
              "status": "unaffected",
              "version": "5.4.157",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.10.*",
              "status": "unaffected",
              "version": "5.10.77",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.14.*",
              "status": "unaffected",
              "version": "5.14.16",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "5.15",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nnet/tls: Fix flipped sign in tls_err_abort() calls\n\nsk-\u003esk_err appears to expect a positive value, a convention that ktls\ndoesn\u0027t always follow and that leads to memory corruption in other code.\nFor instance,\n\n    [kworker]\n    tls_encrypt_done(..., err=\u003cnegative error from crypto request\u003e)\n      tls_err_abort(.., err)\n        sk-\u003esk_err = err;\n\n    [task]\n    splice_from_pipe_feed\n      ...\n        tls_sw_do_sendpage\n          if (sk-\u003esk_err) {\n            ret = -sk-\u003esk_err;  // ret is positive\n\n    splice_from_pipe_feed (continued)\n      ret = actor(...)  // ret is still positive and interpreted as bytes\n                        // written, resulting in underflow of buf-\u003elen and\n                        // sd-\u003elen, leading to huge buf-\u003eoffset and bogus\n                        // addresses computed in later calls to actor()\n\nFix all tls_err_abort() callers to pass a negative error code\nconsistently and centralize the error-prone sign flip there, throwing in\na warning to catch future misuse and uninlining the function so it\nreally does only warn once."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2024-12-19T07:43:34.898Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/e0cfd5159f314d6b304d030363650b06a2299cbb"
        },
        {
          "url": "https://git.kernel.org/stable/c/f3dec7e7ace38224f82cf83f0049159d067c2e19"
        },
        {
          "url": "https://git.kernel.org/stable/c/e41473543f75f7dbc5d605007e6f883f1bd13b9a"
        },
        {
          "url": "https://git.kernel.org/stable/c/da353fac65fede6b8b4cfe207f0d9408e3121105"
        }
      ],
      "title": "net/tls: Fix flipped sign in tls_err_abort() calls",
      "x_generator": {
        "engine": "bippy-5f407fcff5a0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2021-47496",
    "datePublished": "2024-05-22T08:19:43.489Z",
    "dateReserved": "2024-05-22T06:20:56.202Z",
    "dateUpdated": "2024-12-19T07:43:34.898Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "vulnerability-lookup:meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2021-47496\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2024-05-22T09:15:11.447\",\"lastModified\":\"2024-11-21T06:36:20.093\",\"vulnStatus\":\"Awaiting Analysis\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nnet/tls: Fix flipped sign in tls_err_abort() calls\\n\\nsk-\u003esk_err appears to expect a positive value, a convention that ktls\\ndoesn\u0027t always follow and that leads to memory corruption in other code.\\nFor instance,\\n\\n    [kworker]\\n    tls_encrypt_done(..., err=\u003cnegative error from crypto request\u003e)\\n      tls_err_abort(.., err)\\n        sk-\u003esk_err = err;\\n\\n    [task]\\n    splice_from_pipe_feed\\n      ...\\n        tls_sw_do_sendpage\\n          if (sk-\u003esk_err) {\\n            ret = -sk-\u003esk_err;  // ret is positive\\n\\n    splice_from_pipe_feed (continued)\\n      ret = actor(...)  // ret is still positive and interpreted as bytes\\n                        // written, resulting in underflow of buf-\u003elen and\\n                        // sd-\u003elen, leading to huge buf-\u003eoffset and bogus\\n                        // addresses computed in later calls to actor()\\n\\nFix all tls_err_abort() callers to pass a negative error code\\nconsistently and centralize the error-prone sign flip there, throwing in\\na warning to catch future misuse and uninlining the function so it\\nreally does only warn once.\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: net/tls: corrige las llamadas invertidas de tls_err_abort() sk-\u0026gt;sk_err parece esperar un valor positivo, una convenci\u00f3n que ktls no siempre sigue y que conduce a da\u00f1os en la memoria en otro c\u00f3digo. Por ejemplo, [kworker] tls_encrypt_done(..., err=) tls_err_abort(.., err) sk-\u0026gt;sk_err = err; [tarea] splice_from_pipe_feed ... tls_sw_do_sendpage if (sk-\u0026gt;sk_err) { ret = -sk-\u0026gt;sk_err; // ret es positivo splice_from_pipe_feed (continuaci\u00f3n) ret = actor(...) // ret sigue siendo positivo y se interpreta como bytes // escritos, lo que resulta en un desbordamiento insuficiente de buf-\u0026gt;len y // sd-\u0026gt;len, lo que genera enormes buf-\u0026gt;offset y bogus // direcciones calculadas en llamadas posteriores a actor(). Repare todas las llamadas tls_err_abort() para que pasen un c\u00f3digo de error negativo de manera consistente y centralice el cambio de se\u00f1al propenso a errores all\u00ed, lanzando una advertencia para detectar futuros usos indebidos y eliminaci\u00f3n de l\u00edneas. la funci\u00f3n por lo que realmente solo advierte una vez.\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/da353fac65fede6b8b4cfe207f0d9408e3121105\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/e0cfd5159f314d6b304d030363650b06a2299cbb\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/e41473543f75f7dbc5d605007e6f883f1bd13b9a\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/f3dec7e7ace38224f82cf83f0049159d067c2e19\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/da353fac65fede6b8b4cfe207f0d9408e3121105\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\"},{\"url\":\"https://git.kernel.org/stable/c/e0cfd5159f314d6b304d030363650b06a2299cbb\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\"},{\"url\":\"https://git.kernel.org/stable/c/e41473543f75f7dbc5d605007e6f883f1bd13b9a\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\"},{\"url\":\"https://git.kernel.org/stable/c/f3dec7e7ace38224f82cf83f0049159d067c2e19\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\"}]}}",
    "vulnrichment": {
      "containers": "{\"adp\": [{\"title\": \"CVE Program Container\", \"references\": [{\"url\": \"https://git.kernel.org/stable/c/e0cfd5159f314d6b304d030363650b06a2299cbb\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://git.kernel.org/stable/c/f3dec7e7ace38224f82cf83f0049159d067c2e19\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://git.kernel.org/stable/c/e41473543f75f7dbc5d605007e6f883f1bd13b9a\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://git.kernel.org/stable/c/da353fac65fede6b8b4cfe207f0d9408e3121105\", \"tags\": [\"x_transferred\"]}], \"providerMetadata\": {\"orgId\": \"af854a3a-2127-422b-91ae-364da2661108\", \"shortName\": \"CVE\", \"dateUpdated\": \"2024-08-04T05:39:59.752Z\"}}, {\"title\": \"CISA ADP Vulnrichment\", \"metrics\": [{\"other\": {\"type\": \"ssvc\", \"content\": {\"id\": \"CVE-2021-47496\", \"role\": \"CISA Coordinator\", \"options\": [{\"Exploitation\": \"none\"}, {\"Automatable\": \"no\"}, {\"Technical Impact\": \"partial\"}], \"version\": \"2.0.3\", \"timestamp\": \"2024-09-10T15:35:52.280096Z\"}}}], \"providerMetadata\": {\"orgId\": \"134c704f-9b21-4f2e-91b3-4a467353bcc0\", \"shortName\": \"CISA-ADP\", \"dateUpdated\": \"2024-09-11T12:42:16.475Z\"}}], \"cna\": {\"title\": \"net/tls: Fix flipped sign in tls_err_abort() calls\", \"affected\": [{\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"c46234ebb4d1eee5e09819f49169e51cfc6eb909\", \"lessThan\": \"e0cfd5159f314d6b304d030363650b06a2299cbb\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"c46234ebb4d1eee5e09819f49169e51cfc6eb909\", \"lessThan\": \"f3dec7e7ace38224f82cf83f0049159d067c2e19\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"c46234ebb4d1eee5e09819f49169e51cfc6eb909\", \"lessThan\": \"e41473543f75f7dbc5d605007e6f883f1bd13b9a\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"c46234ebb4d1eee5e09819f49169e51cfc6eb909\", \"lessThan\": \"da353fac65fede6b8b4cfe207f0d9408e3121105\", \"versionType\": \"git\"}], \"programFiles\": [\"include/net/tls.h\", \"net/tls/tls_sw.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.17\"}, {\"status\": \"unaffected\", \"version\": \"0\", \"lessThan\": \"4.17\", \"versionType\": \"semver\"}, {\"status\": \"unaffected\", \"version\": \"5.4.157\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"5.4.*\"}, {\"status\": \"unaffected\", \"version\": \"5.10.77\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"5.10.*\"}, {\"status\": \"unaffected\", \"version\": \"5.14.16\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"5.14.*\"}, {\"status\": \"unaffected\", \"version\": \"5.15\", \"versionType\": \"original_commit_for_fix\", \"lessThanOrEqual\": \"*\"}], \"programFiles\": [\"include/net/tls.h\", \"net/tls/tls_sw.c\"], \"defaultStatus\": \"affected\"}], \"references\": [{\"url\": \"https://git.kernel.org/stable/c/e0cfd5159f314d6b304d030363650b06a2299cbb\"}, {\"url\": \"https://git.kernel.org/stable/c/f3dec7e7ace38224f82cf83f0049159d067c2e19\"}, {\"url\": \"https://git.kernel.org/stable/c/e41473543f75f7dbc5d605007e6f883f1bd13b9a\"}, {\"url\": \"https://git.kernel.org/stable/c/da353fac65fede6b8b4cfe207f0d9408e3121105\"}], \"x_generator\": {\"engine\": \"bippy-5f407fcff5a0\"}, \"descriptions\": [{\"lang\": \"en\", \"value\": \"In the Linux kernel, the following vulnerability has been resolved:\\n\\nnet/tls: Fix flipped sign in tls_err_abort() calls\\n\\nsk-\u003esk_err appears to expect a positive value, a convention that ktls\\ndoesn\u0027t always follow and that leads to memory corruption in other code.\\nFor instance,\\n\\n    [kworker]\\n    tls_encrypt_done(..., err=\u003cnegative error from crypto request\u003e)\\n      tls_err_abort(.., err)\\n        sk-\u003esk_err = err;\\n\\n    [task]\\n    splice_from_pipe_feed\\n      ...\\n        tls_sw_do_sendpage\\n          if (sk-\u003esk_err) {\\n            ret = -sk-\u003esk_err;  // ret is positive\\n\\n    splice_from_pipe_feed (continued)\\n      ret = actor(...)  // ret is still positive and interpreted as bytes\\n                        // written, resulting in underflow of buf-\u003elen and\\n                        // sd-\u003elen, leading to huge buf-\u003eoffset and bogus\\n                        // addresses computed in later calls to actor()\\n\\nFix all tls_err_abort() callers to pass a negative error code\\nconsistently and centralize the error-prone sign flip there, throwing in\\na warning to catch future misuse and uninlining the function so it\\nreally does only warn once.\"}], \"providerMetadata\": {\"orgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"shortName\": \"Linux\", \"dateUpdated\": \"2024-12-19T07:43:34.898Z\"}}}",
      "cveMetadata": "{\"cveId\": \"CVE-2021-47496\", \"state\": \"PUBLISHED\", \"dateUpdated\": \"2024-12-19T07:43:34.898Z\", \"dateReserved\": \"2024-05-22T06:20:56.202Z\", \"assignerOrgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"datePublished\": \"2024-05-22T08:19:43.489Z\", \"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.
  • 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.