CVE-2024-50186 (GCVE-0-2024-50186)
Vulnerability from cvelistv5
Published
2024-11-08 05:38
Modified
2026-08-05 11:42
Summary
In the Linux kernel, the following vulnerability has been resolved: net: explicitly clear the sk pointer, when pf->create fails We have recently noticed the exact same KASAN splat as in commit 6cd4a78d962b ("net: do not leave a dangling sk pointer, when socket creation fails"). The problem is that commit did not fully address the problem, as some pf->create implementations do not use sk_common_release in their error paths. For example, we can use the same reproducer as in the above commit, but changing ping to arping. arping uses AF_PACKET socket and if packet_create fails, it will just sk_free the allocated sk object. While we could chase all the pf->create implementations and make sure they NULL the freed sk object on error from the socket, we can't guarantee future protocols will not make the same mistake. So it is easier to just explicitly NULL the sk pointer upon return from pf->create in __sock_create. We do know that pf->create always releases the allocated sk object on error, so if the pointer is not NULL, it is definitely dangling.
Impacted products
Vendor Product Version
Linux Linux Version: 78e4aa528a7b1204219d808310524344f627d069
Version: 893eeba94c40d513cd0fe6539330ebdaea208c0e
Version: 454c454ed645fed051216b79622f7cb69c1638f5
Version: 6cd4a78d962bebbaf8beb7d2ead3f34120e3f7b2
Version: 6cd4a78d962bebbaf8beb7d2ead3f34120e3f7b2
Version: 5dfe2408fd7dc4d2e7ac38a116ff0a37b1cfd3b9
Version: 5.15.162   
Version: 6.1.96   
Version: 6.6.36   
Version: 6.9.7   
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "adp": [
      {
        "metrics": [
          {
            "cvssV3_1": {
              "attackComplexity": "LOW",
              "attackVector": "LOCAL",
              "availabilityImpact": "HIGH",
              "baseScore": 7.8,
              "baseSeverity": "HIGH",
              "confidentialityImpact": "HIGH",
              "integrityImpact": "HIGH",
              "privilegesRequired": "LOW",
              "scope": "UNCHANGED",
              "userInteraction": "NONE",
              "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
              "version": "3.1"
            }
          },
          {
            "other": {
              "content": {
                "id": "CVE-2024-50186",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "total"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2025-10-01T20:18:35.923854Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "problemTypes": [
          {
            "descriptions": [
              {
                "cweId": "CWE-416",
                "description": "CWE-416 Use After Free",
                "lang": "en",
                "type": "CWE"
              }
            ]
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2025-10-01T20:27:09.127Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      },
      {
        "providerMetadata": {
          "dateUpdated": "2025-11-03T22:26:38.814Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "references": [
          {
            "url": "https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html"
          }
        ],
        "title": "CVE Program Container"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "net/socket.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "daf462ff3cde6ecf22b98d9ae770232c10d28de2",
              "status": "affected",
              "version": "78e4aa528a7b1204219d808310524344f627d069",
              "versionType": "git"
            },
            {
              "lessThan": "b7d22a79ff4e962b8af5ffe623abd1d6c179eb9f",
              "status": "affected",
              "version": "893eeba94c40d513cd0fe6539330ebdaea208c0e",
              "versionType": "git"
            },
            {
              "lessThan": "563e6892e21d6ecabdf62103fc4e7b326d212334",
              "status": "affected",
              "version": "454c454ed645fed051216b79622f7cb69c1638f5",
              "versionType": "git"
            },
            {
              "lessThan": "8e1b72fd74bf9da3b099d09857f4e7f114f38e12",
              "status": "affected",
              "version": "6cd4a78d962bebbaf8beb7d2ead3f34120e3f7b2",
              "versionType": "git"
            },
            {
              "lessThan": "631083143315d1b192bd7d915b967b37819e88ea",
              "status": "affected",
              "version": "6cd4a78d962bebbaf8beb7d2ead3f34120e3f7b2",
              "versionType": "git"
            },
            {
              "status": "affected",
              "version": "5dfe2408fd7dc4d2e7ac38a116ff0a37b1cfd3b9",
              "versionType": "git"
            },
            {
              "lessThan": "5.15.168",
              "status": "affected",
              "version": "5.15.162",
              "versionType": "semver"
            },
            {
              "lessThan": "6.1.113",
              "status": "affected",
              "version": "6.1.96",
              "versionType": "semver"
            },
            {
              "lessThan": "6.6.57",
              "status": "affected",
              "version": "6.6.36",
              "versionType": "semver"
            },
            {
              "lessThan": "6.10",
              "status": "affected",
              "version": "6.9.7",
              "versionType": "semver"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "net/socket.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.10"
            },
            {
              "lessThan": "6.10",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.15.*",
              "status": "unaffected",
              "version": "5.15.168",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.1.*",
              "status": "unaffected",
              "version": "6.1.113",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.6.*",
              "status": "unaffected",
              "version": "6.6.57",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.11.*",
              "status": "unaffected",
              "version": "6.11.4",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.12",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.15.168",
                  "versionStartIncluding": "5.15.162",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.1.113",
                  "versionStartIncluding": "6.1.96",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.6.57",
                  "versionStartIncluding": "6.6.36",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.11.4",
                  "versionStartIncluding": "6.10",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.12",
                  "versionStartIncluding": "6.10",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionStartIncluding": "6.9.7",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nnet: explicitly clear the sk pointer, when pf-\u003ecreate fails\n\nWe have recently noticed the exact same KASAN splat as in commit\n6cd4a78d962b (\"net: do not leave a dangling sk pointer, when socket\ncreation fails\"). The problem is that commit did not fully address the\nproblem, as some pf-\u003ecreate implementations do not use sk_common_release\nin their error paths.\n\nFor example, we can use the same reproducer as in the above commit, but\nchanging ping to arping. arping uses AF_PACKET socket and if packet_create\nfails, it will just sk_free the allocated sk object.\n\nWhile we could chase all the pf-\u003ecreate implementations and make sure they\nNULL the freed sk object on error from the socket, we can\u0027t guarantee\nfuture protocols will not make the same mistake.\n\nSo it is easier to just explicitly NULL the sk pointer upon return from\npf-\u003ecreate in __sock_create. We do know that pf-\u003ecreate always releases the\nallocated sk object on error, so if the pointer is not NULL, it is\ndefinitely dangling."
        }
      ],
      "metrics": [
        {
          "cvssV3_1": {
            "baseScore": 7.8,
            "baseSeverity": "HIGH",
            "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
            "version": "3.1"
          },
          "scenarios": [
            {
              "lang": "en",
              "value": "AV:L - The dangling `sock-\u003esk` is created by a local `socket(2)` syscall that fails inside `pf-\u003ecreate()`; there is no remote or adjacent-network trigger since the failing socket is never bound or exposed to a peer.\nAC:L - The attacker deterministically produces the dangling pointer with a single syscall \u2014 `socket(AF_VSOCK, SOCK_DGRAM, 0)` always fails with -ENODEV on any host without the VMCI transport, and `AF_PACKET` fails identically \u2014 with no race to win and no memory-layout precondition; on the realistic target deployment (cloud/container hosts running eBPF observability agents hooked on `__sock_release`) the freed object is dereferenced on every attempt.\nPR:L - Any unprivileged local user can call `socket()`; the AF_VSOCK path has no capability check at all, and the AF_PACKET path\u0027s `ns_capable(net-\u003euser_ns, CAP_NET_RAW)` is trivially satisfied inside an unprivileged user namespace via `unshare -Urn`.\nUI:N - The attacker triggers the entire sequence from its own process with one failing `socket()` call; no victim action is needed.\nS:U - The freed `struct sock` and the corrupting access both live in the kernel\u0027s own security authority; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - This is a slab use-after-free: `__sock_gen_cookie()` reads 8 bytes from the freed `struct sock`, and because the attacker can reallocate that slab object with controlled content between the free and the read, the stale value returned to userspace-visible tracing output constitutes an arbitrary kernel heap read primitive.\nI:H - The same path performs `atomic64_cmpxchg(\u0026sk-\u003esk_cookie, ...)`, an 8-byte write into the freed object at a fixed offset, corrupting whatever structure was reallocated there \u2014 a classic heap-spray write primitive leveragable toward control-flow hijack.\nA:H - The use-after-free reliably produces a KASAN slab-use-after-free splat and can panic the kernel outright when the freed slab page has been returned to the page allocator or when the corrupted victim object contains a pointer that is later dereferenced."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-08-05T11:42:21.793Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/daf462ff3cde6ecf22b98d9ae770232c10d28de2"
        },
        {
          "url": "https://git.kernel.org/stable/c/b7d22a79ff4e962b8af5ffe623abd1d6c179eb9f"
        },
        {
          "url": "https://git.kernel.org/stable/c/563e6892e21d6ecabdf62103fc4e7b326d212334"
        },
        {
          "url": "https://git.kernel.org/stable/c/8e1b72fd74bf9da3b099d09857f4e7f114f38e12"
        },
        {
          "url": "https://git.kernel.org/stable/c/631083143315d1b192bd7d915b967b37819e88ea"
        }
      ],
      "title": "net: explicitly clear the sk pointer, when pf-\u003ecreate fails",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2024-50186",
    "datePublished": "2024-11-08T05:38:27.272Z",
    "dateReserved": "2024-10-21T19:36:19.967Z",
    "dateUpdated": "2026-08-05T11:42:21.793Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "vulnrichment": {
      "containers": "{\"adp\": [{\"title\": \"CVE Program Container\", \"references\": [{\"url\": \"https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html\"}], \"providerMetadata\": {\"orgId\": \"af854a3a-2127-422b-91ae-364da2661108\", \"shortName\": \"CVE\", \"dateUpdated\": \"2025-11-03T22:26:38.814Z\"}}, {\"title\": \"CISA ADP Vulnrichment\", \"metrics\": [{\"cvssV3_1\": {\"scope\": \"UNCHANGED\", \"version\": \"3.1\", \"baseScore\": 7.8, \"attackVector\": \"LOCAL\", \"baseSeverity\": \"HIGH\", \"vectorString\": \"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H\", \"integrityImpact\": \"HIGH\", \"userInteraction\": \"NONE\", \"attackComplexity\": \"LOW\", \"availabilityImpact\": \"HIGH\", \"privilegesRequired\": \"LOW\", \"confidentialityImpact\": \"HIGH\"}}, {\"other\": {\"type\": \"ssvc\", \"content\": {\"id\": \"CVE-2024-50186\", \"role\": \"CISA Coordinator\", \"options\": [{\"Exploitation\": \"none\"}, {\"Automatable\": \"no\"}, {\"Technical Impact\": \"total\"}], \"version\": \"2.0.3\", \"timestamp\": \"2025-10-01T20:18:35.923854Z\"}}}], \"problemTypes\": [{\"descriptions\": [{\"lang\": \"en\", \"type\": \"CWE\", \"cweId\": \"CWE-416\", \"description\": \"CWE-416 Use After Free\"}]}], \"providerMetadata\": {\"orgId\": \"134c704f-9b21-4f2e-91b3-4a467353bcc0\", \"shortName\": \"CISA-ADP\", \"dateUpdated\": \"2025-10-01T15:20:35.633Z\"}}], \"cna\": {\"title\": \"net: explicitly clear the sk pointer, when pf-\u003ecreate fails\", \"affected\": [{\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"78e4aa528a7b1204219d808310524344f627d069\", \"lessThan\": \"daf462ff3cde6ecf22b98d9ae770232c10d28de2\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"893eeba94c40d513cd0fe6539330ebdaea208c0e\", \"lessThan\": \"b7d22a79ff4e962b8af5ffe623abd1d6c179eb9f\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"454c454ed645fed051216b79622f7cb69c1638f5\", \"lessThan\": \"563e6892e21d6ecabdf62103fc4e7b326d212334\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"6cd4a78d962bebbaf8beb7d2ead3f34120e3f7b2\", \"lessThan\": \"8e1b72fd74bf9da3b099d09857f4e7f114f38e12\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"6cd4a78d962bebbaf8beb7d2ead3f34120e3f7b2\", \"lessThan\": \"631083143315d1b192bd7d915b967b37819e88ea\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"5dfe2408fd7dc4d2e7ac38a116ff0a37b1cfd3b9\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"5.15.162\", \"lessThan\": \"5.15.168\", \"versionType\": \"semver\"}, {\"status\": \"affected\", \"version\": \"6.1.96\", \"lessThan\": \"6.1.113\", \"versionType\": \"semver\"}, {\"status\": \"affected\", \"version\": \"6.6.36\", \"lessThan\": \"6.6.57\", \"versionType\": \"semver\"}, {\"status\": \"affected\", \"version\": \"6.9.7\", \"lessThan\": \"6.10\", \"versionType\": \"semver\"}], \"programFiles\": [\"net/socket.c\"], \"defaultStatus\": \"unaffected\"}, {\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"6.10\"}, {\"status\": \"unaffected\", \"version\": \"0\", \"lessThan\": \"6.10\", \"versionType\": \"semver\"}, {\"status\": \"unaffected\", \"version\": \"5.15.168\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"5.15.*\"}, {\"status\": \"unaffected\", \"version\": \"6.1.113\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"6.1.*\"}, {\"status\": \"unaffected\", \"version\": \"6.6.57\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"6.6.*\"}, {\"status\": \"unaffected\", \"version\": \"6.11.4\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"6.11.*\"}, {\"status\": \"unaffected\", \"version\": \"6.12\", \"versionType\": \"original_commit_for_fix\", \"lessThanOrEqual\": \"*\"}], \"programFiles\": [\"net/socket.c\"], \"defaultStatus\": \"affected\"}], \"references\": [{\"url\": \"https://git.kernel.org/stable/c/daf462ff3cde6ecf22b98d9ae770232c10d28de2\"}, {\"url\": \"https://git.kernel.org/stable/c/b7d22a79ff4e962b8af5ffe623abd1d6c179eb9f\"}, {\"url\": \"https://git.kernel.org/stable/c/563e6892e21d6ecabdf62103fc4e7b326d212334\"}, {\"url\": \"https://git.kernel.org/stable/c/8e1b72fd74bf9da3b099d09857f4e7f114f38e12\"}, {\"url\": \"https://git.kernel.org/stable/c/631083143315d1b192bd7d915b967b37819e88ea\"}], \"x_generator\": {\"engine\": \"bippy-1.2.0\"}, \"descriptions\": [{\"lang\": \"en\", \"value\": \"In the Linux kernel, the following vulnerability has been resolved:\\n\\nnet: explicitly clear the sk pointer, when pf-\u003ecreate fails\\n\\nWe have recently noticed the exact same KASAN splat as in commit\\n6cd4a78d962b (\\\"net: do not leave a dangling sk pointer, when socket\\ncreation fails\\\"). The problem is that commit did not fully address the\\nproblem, as some pf-\u003ecreate implementations do not use sk_common_release\\nin their error paths.\\n\\nFor example, we can use the same reproducer as in the above commit, but\\nchanging ping to arping. arping uses AF_PACKET socket and if packet_create\\nfails, it will just sk_free the allocated sk object.\\n\\nWhile we could chase all the pf-\u003ecreate implementations and make sure they\\nNULL the freed sk object on error from the socket, we can\u0027t guarantee\\nfuture protocols will not make the same mistake.\\n\\nSo it is easier to just explicitly NULL the sk pointer upon return from\\npf-\u003ecreate in __sock_create. We do know that pf-\u003ecreate always releases the\\nallocated sk object on error, so if the pointer is not NULL, it is\\ndefinitely dangling.\"}], \"cpeApplicability\": [{\"nodes\": [{\"negate\": false, \"cpeMatch\": [{\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"5.15.168\", \"versionStartIncluding\": \"5.15.162\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.1.113\", \"versionStartIncluding\": \"6.1.96\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.6.57\", \"versionStartIncluding\": \"6.6.36\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.11.4\", \"versionStartIncluding\": \"6.10\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.12\", \"versionStartIncluding\": \"6.10\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionStartIncluding\": \"6.9.7\"}], \"operator\": \"OR\"}]}], \"providerMetadata\": {\"orgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"shortName\": \"Linux\", \"dateUpdated\": \"2026-05-23T15:54:42.968Z\"}}}",
      "cveMetadata": "{\"cveId\": \"CVE-2024-50186\", \"state\": \"PUBLISHED\", \"dateUpdated\": \"2026-05-23T15:54:42.968Z\", \"dateReserved\": \"2024-10-21T19:36:19.967Z\", \"assignerOrgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"datePublished\": \"2024-11-08T05:38:27.272Z\", \"assignerShortName\": \"Linux\"}",
      "dataType": "CVE_RECORD",
      "dataVersion": "5.2"
    }
  }
}


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…