Skip to content
Heist/ feed
Back to feed
HighFix available

net: explicitly clear the sk pointer, when pf->create fails

Type: advisorySources: OSV

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.

Products
Kernel
Affected versions
Not specified
Fixed versions
5.15.168, 6.1.113, 6.11.4, 6.6.57
CVEs
CVE-2024-50186
Confirmed fixed CVEs
Not specified
Updated in this feed
4 Nov 2026, 16:18 UTC · Revision 1

Source evidence

net: explicitly clear the sk pointer, when pf->create fails

core-osv · Original source

Published 8 Nov 2024, 05:38 UTC

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.

osv:CVE-2024-50186

Kernel

Fixed versions: 5.15.168, 6.1.113, 6.6.57, 6.11.4

Complete source record
{
  "id": "00be4a3762721f2b27e33fb284d480e46c7fdd7a4cb47da6633051d72187ac26",
  "url": "https://osv.dev/vulnerability/CVE-2024-50186",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "net: explicitly clear the sk pointer, when pf->create fails",
    "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.",
    "evidence": "osv:CVE-2024-50186",
    "products": [
      {
        "name": {
          "value": "Kernel",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "5.15.168",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.1.113",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.6.57",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.11.4",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "high",
    "structured": {
      "id": "CVE-2024-50186",
      "aliases": [
        "CVE-2024-50186"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "78e4aa528a7b1204219d808310524344f627d069"
                },
                {
                  "fixed": "daf462ff3cde6ecf22b98d9ae770232c10d28de2"
                }
              ]
            },
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "893eeba94c40d513cd0fe6539330ebdaea208c0e"
                },
                {
                  "fixed": "b7d22a79ff4e962b8af5ffe623abd1d6c179eb9f"
                }
              ]
            },
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "454c454ed645fed051216b79622f7cb69c1638f5"
                },
                {
                  "fixed": "563e6892e21d6ecabdf62103fc4e7b326d212334"
                }
              ]
            },
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "6cd4a78d962bebbaf8beb7d2ead3f34120e3f7b2"
                },
                {
                  "fixed": "8e1b72fd74bf9da3b099d09857f4e7f114f38e12"
                },
                {
                  "fixed": "631083143315d1b192bd7d915b967b37819e88ea"
                }
              ]
            },
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "5.15.162"
                },
                {
                  "fixed": "5.15.168"
                }
              ]
            },
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "6.1.96"
                },
                {
                  "fixed": "6.1.113"
                }
              ]
            },
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "6.6.36"
                },
                {
                  "fixed": "6.6.57"
                }
              ]
            },
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "6.9.7"
                },
                {
                  "fixed": "6.10"
                }
              ]
            },
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "5dfe2408fd7dc4d2e7ac38a116ff0a37b1cfd3b9"
                }
              ]
            }
          ],
          "versions": [
            "v5.15.167",
            "v5.15.166",
            "v5.15.165",
            "v5.15.164",
            "v5.15.163",
            "v5.15.162",
            "v6.1.112",
            "v6.1.111",
            "v6.1.110",
            "v6.1.109",
            "v6.1.108",
            "v6.1.107",
            "v6.1.106",
            "v6.1.105",
            "v6.1.104",
            "v6.1.103",
            "v6.1.102",
            "v6.1.101",
            "v6.1.100",
            "v6.1.99",
            "v6.1.98",
            "v6.1.97",
            "v6.1.96",
            "v6.6.56",
            "v6.6.55",
            "v6.6.54",
            "v6.6.53",
            "v6.6.52",
            "v6.6.51",
            "v6.6.50",
            "v6.6.49",
            "v6.6.48",
            "v6.6.47",
            "v6.6.46",
            "v6.6.45",
            "v6.6.44",
            "v6.6.43",
            "v6.6.42",
            "v6.6.41",
            "v6.6.40",
            "v6.6.39",
            "v6.6.38",
            "v6.6.37",
            "v6.6.36",
            "v6.9.12",
            "v6.9.11",
            "v6.9.10",
            "v6.9.9",
            "v6.9.8",
            "v6.9.7"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-50186.json"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "5.15.168"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.16.0"
                },
                {
                  "fixed": "6.1.113"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.2.0"
                },
                {
                  "fixed": "6.6.57"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.7.0"
                },
                {
                  "fixed": "6.11.4"
                }
              ]
            }
          ],
          "package": {
            "name": "Kernel",
            "ecosystem": "Linux"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-50186.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:37.635800252Z",
      "provider": "osv",
      "references": [
        "https://git.kernel.org/stable/c/563e6892e21d6ecabdf62103fc4e7b326d212334",
        "https://git.kernel.org/stable/c/631083143315d1b192bd7d915b967b37819e88ea",
        "https://git.kernel.org/stable/c/8e1b72fd74bf9da3b099d09857f4e7f114f38e12",
        "https://git.kernel.org/stable/c/b7d22a79ff4e962b8af5ffe623abd1d6c179eb9f",
        "https://git.kernel.org/stable/c/daf462ff3cde6ecf22b98d9ae770232c10d28de2",
        "https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/50xxx/CVE-2024-50186.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2024-50186",
        "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
      ],
      "provider_metadata": {
        "cna_assigner": "Linux",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/50xxx/CVE-2024-50186.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2024-50186",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 504604,
  "published_at": "2024-11-08T05:38:27.272+00:00"
}