cve-2020-36789
Vulnerability from cvelistv5
Published
2025-04-17 18:01
Modified
2025-04-17 18:01
Severity ?
Summary
can: dev: can_get_echo_skb(): prevent call to kfree_skb() in hard IRQ context
Impacted products
LinuxLinux
LinuxLinux
Show details on NVD website


{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/net/can/dev.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "248b71ce92d4f3a574b2537f9838f48e892618f4",
              "status": "affected",
              "version": "39549eef3587f1c1e8c65c88a2400d10fd30ea17",
              "versionType": "git"
            },
            {
              "lessThan": "451187b20431924d13fcfecc500d7cd2d9951bac",
              "status": "affected",
              "version": "39549eef3587f1c1e8c65c88a2400d10fd30ea17",
              "versionType": "git"
            },
            {
              "lessThan": "3a922a85701939624484e7f2fd07d32beed00d25",
              "status": "affected",
              "version": "39549eef3587f1c1e8c65c88a2400d10fd30ea17",
              "versionType": "git"
            },
            {
              "lessThan": "7e4cf2ec0ca236c3e5f904239cec6efe1f3baf22",
              "status": "affected",
              "version": "39549eef3587f1c1e8c65c88a2400d10fd30ea17",
              "versionType": "git"
            },
            {
              "lessThan": "ab46748bf98864f9c3f5559060bf8caf9df2b41e",
              "status": "affected",
              "version": "39549eef3587f1c1e8c65c88a2400d10fd30ea17",
              "versionType": "git"
            },
            {
              "lessThan": "87530b557affe01c764de32dbeb58cdf47234574",
              "status": "affected",
              "version": "39549eef3587f1c1e8c65c88a2400d10fd30ea17",
              "versionType": "git"
            },
            {
              "lessThan": "2283f79b22684d2812e5c76fc2280aae00390365",
              "status": "affected",
              "version": "39549eef3587f1c1e8c65c88a2400d10fd30ea17",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/net/can/dev.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "2.6.31"
            },
            {
              "lessThan": "2.6.31",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "4.4.*",
              "status": "unaffected",
              "version": "4.4.244",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "4.9.*",
              "status": "unaffected",
              "version": "4.9.244",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "4.14.*",
              "status": "unaffected",
              "version": "4.14.207",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "4.19.*",
              "status": "unaffected",
              "version": "4.19.158",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.4.*",
              "status": "unaffected",
              "version": "5.4.78",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.9.*",
              "status": "unaffected",
              "version": "5.9.9",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "5.10",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\ncan: dev: can_get_echo_skb(): prevent call to kfree_skb() in hard IRQ context\n\nIf a driver calls can_get_echo_skb() during a hardware IRQ (which is often, but\nnot always, the case), the \u0027WARN_ON(in_irq)\u0027 in\nnet/core/skbuff.c#skb_release_head_state() might be triggered, under network\ncongestion circumstances, together with the potential risk of a NULL pointer\ndereference.\n\nThe root cause of this issue is the call to kfree_skb() instead of\ndev_kfree_skb_irq() in net/core/dev.c#enqueue_to_backlog().\n\nThis patch prevents the skb to be freed within the call to netif_rx() by\nincrementing its reference count with skb_get(). The skb is finally freed by\none of the in-irq-context safe functions: dev_consume_skb_any() or\ndev_kfree_skb_any(). The \"any\" version is used because some drivers might call\ncan_get_echo_skb() in a normal context.\n\nThe reason for this issue to occur is that initially, in the core network\nstack, loopback skb were not supposed to be received in hardware IRQ context.\nThe CAN stack is an exeption.\n\nThis bug was previously reported back in 2017 in [1] but the proposed patch\nnever got accepted.\n\nWhile [1] directly modifies net/core/dev.c, we try to propose here a\nsmoother modification local to CAN network stack (the assumption\nbehind is that only CAN devices are affected by this issue).\n\n[1] http://lore.kernel.org/r/57a3ffb6-3309-3ad5-5a34-e93c3fe3614d@cetitec.com"
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2025-04-17T18:01:28.613Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/248b71ce92d4f3a574b2537f9838f48e892618f4"
        },
        {
          "url": "https://git.kernel.org/stable/c/451187b20431924d13fcfecc500d7cd2d9951bac"
        },
        {
          "url": "https://git.kernel.org/stable/c/3a922a85701939624484e7f2fd07d32beed00d25"
        },
        {
          "url": "https://git.kernel.org/stable/c/7e4cf2ec0ca236c3e5f904239cec6efe1f3baf22"
        },
        {
          "url": "https://git.kernel.org/stable/c/ab46748bf98864f9c3f5559060bf8caf9df2b41e"
        },
        {
          "url": "https://git.kernel.org/stable/c/87530b557affe01c764de32dbeb58cdf47234574"
        },
        {
          "url": "https://git.kernel.org/stable/c/2283f79b22684d2812e5c76fc2280aae00390365"
        }
      ],
      "title": "can: dev: can_get_echo_skb(): prevent call to kfree_skb() in hard IRQ context",
      "x_generator": {
        "engine": "bippy-1.0.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2020-36789",
    "datePublished": "2025-04-17T18:01:28.613Z",
    "dateReserved": "2024-02-26T17:07:27.435Z",
    "dateUpdated": "2025-04-17T18:01:28.613Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2020-36789\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2025-04-17T18:15:42.743\",\"lastModified\":\"2025-04-29T18:55:11.223\",\"vulnStatus\":\"Analyzed\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\ncan: dev: can_get_echo_skb(): prevent call to kfree_skb() in hard IRQ context\\n\\nIf a driver calls can_get_echo_skb() during a hardware IRQ (which is often, but\\nnot always, the case), the \u0027WARN_ON(in_irq)\u0027 in\\nnet/core/skbuff.c#skb_release_head_state() might be triggered, under network\\ncongestion circumstances, together with the potential risk of a NULL pointer\\ndereference.\\n\\nThe root cause of this issue is the call to kfree_skb() instead of\\ndev_kfree_skb_irq() in net/core/dev.c#enqueue_to_backlog().\\n\\nThis patch prevents the skb to be freed within the call to netif_rx() by\\nincrementing its reference count with skb_get(). The skb is finally freed by\\none of the in-irq-context safe functions: dev_consume_skb_any() or\\ndev_kfree_skb_any(). The \\\"any\\\" version is used because some drivers might call\\ncan_get_echo_skb() in a normal context.\\n\\nThe reason for this issue to occur is that initially, in the core network\\nstack, loopback skb were not supposed to be received in hardware IRQ context.\\nThe CAN stack is an exeption.\\n\\nThis bug was previously reported back in 2017 in [1] but the proposed patch\\nnever got accepted.\\n\\nWhile [1] directly modifies net/core/dev.c, we try to propose here a\\nsmoother modification local to CAN network stack (the assumption\\nbehind is that only CAN devices are affected by this issue).\\n\\n[1] http://lore.kernel.org/r/57a3ffb6-3309-3ad5-5a34-e93c3fe3614d@cetitec.com\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: can: dev: can_get_echo_skb(): evitar la llamada a kfree_skb() en el contexto de IRQ duro Si un controlador llama a can_get_echo_skb() durante un IRQ de hardware (que es a menudo, pero no siempre, el caso), el \u0027WARN_ON(in_irq)\u0027 en net/core/skbuff.c#skb_release_head_state() podr\u00eda activarse, en circunstancias de congesti\u00f3n de la red, junto con el riesgo potencial de una desreferencia de puntero NULL. La causa ra\u00edz de este problema es la llamada a kfree_skb() en lugar de dev_kfree_skb_irq() en net/core/dev.c#enqueue_to_backlog(). Este parche evita que el skb se libere dentro de la llamada a netif_rx() incrementando su contador de referencias con skb_get(). El skb se libera finalmente mediante una de las funciones seguras en contexto IRQ: dev_consume_skb_any() o dev_kfree_skb_any(). Se utiliza la versi\u00f3n \\\"any\\\" porque algunos controladores podr\u00edan llamar a can_get_echo_skb() en un contexto normal. Este problema se debe a que, inicialmente, en la pila de red principal, no se esperaba que los skb de bucle invertido se recibieran en el contexto IRQ de hardware. La pila CAN es una excepci\u00f3n. Este error se report\u00f3 previamente en 2017 en [1], pero el parche propuesto nunca fue aceptado. Si bien [1] modifica directamente net/core/dev.c, aqu\u00ed intentamos proponer una modificaci\u00f3n m\u00e1s fluida local en la pila de red CAN (suponiendo que solo los dispositivos CAN se ven afectados por este problema). [1] http://lore.kernel.org/r/57a3ffb6-3309-3ad5-5a34-e93c3fe3614d@cetitec.com\"}],\"metrics\":{\"cvssMetricV31\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"cvssData\":{\"version\":\"3.1\",\"vectorString\":\"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H\",\"baseScore\":5.5,\"baseSeverity\":\"MEDIUM\",\"attackVector\":\"LOCAL\",\"attackComplexity\":\"LOW\",\"privilegesRequired\":\"LOW\",\"userInteraction\":\"NONE\",\"scope\":\"UNCHANGED\",\"confidentialityImpact\":\"NONE\",\"integrityImpact\":\"NONE\",\"availabilityImpact\":\"HIGH\"},\"exploitabilityScore\":1.8,\"impactScore\":3.6}]},\"weaknesses\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"description\":[{\"lang\":\"en\",\"value\":\"CWE-476\"}]}],\"configurations\":[{\"nodes\":[{\"operator\":\"OR\",\"negate\":false,\"cpeMatch\":[{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"2.6.31\",\"versionEndExcluding\":\"4.4.244\",\"matchCriteriaId\":\"BCE79E39-47AC-4822-993E-020CB01414EB\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"4.5\",\"versionEndExcluding\":\"4.9.244\",\"matchCriteriaId\":\"5DA13F99-FB5C-48E2-89F8-771B5DA2F0D1\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"4.10\",\"versionEndExcluding\":\"4.14.207\",\"matchCriteriaId\":\"DD9E0DA2-567F-4DF2-9A1E-5D22A91FA245\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"4.15\",\"versionEndExcluding\":\"4.19.158\",\"matchCriteriaId\":\"3DABF800-EF14-41DA-B3D6-4B5DBF148443\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"4.20\",\"versionEndExcluding\":\"5.4.78\",\"matchCriteriaId\":\"DFFC67F2-DDE1-4CA5-A075-32865562DF37\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"5.5\",\"versionEndExcluding\":\"5.9.9\",\"matchCriteriaId\":\"8FC7AE04-F63B-4317-8485-E44A13A4CFCC\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:5.10:rc1:*:*:*:*:*:*\",\"matchCriteriaId\":\"9DD7EB1D-064C-4DB9-AD34-D8EF78312C17\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:5.10:rc2:*:*:*:*:*:*\",\"matchCriteriaId\":\"12505363-342C-4333-98C0-41F031024348\"}]}]}],\"references\":[{\"url\":\"https://git.kernel.org/stable/c/2283f79b22684d2812e5c76fc2280aae00390365\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/248b71ce92d4f3a574b2537f9838f48e892618f4\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/3a922a85701939624484e7f2fd07d32beed00d25\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/451187b20431924d13fcfecc500d7cd2d9951bac\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/7e4cf2ec0ca236c3e5f904239cec6efe1f3baf22\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/87530b557affe01c764de32dbeb58cdf47234574\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/ab46748bf98864f9c3f5559060bf8caf9df2b41e\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]}]}}"
  }
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading...

Loading...

Loading...
  • 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.