{
  "affected": [
    {
      "ranges": [
        {
          "events": [
            {
              "introduced": "ce06b03e60fc19c680d1bf873e779bf11c2fc518"
            },
            {
              "fixed": "ee642b1962caa9aa231c01abbd58bc453ae6b66e"
            },
            {
              "fixed": "42cfd7898eeed290c9fb73f732af1f7d6b0a703e"
            },
            {
              "fixed": "1b4c03f8892d955385c202009af7485364731bb9"
            },
            {
              "fixed": "654386baef228c2992dbf604c819e4c7c35fc71b"
            },
            {
              "fixed": "75fe6db23705a1d55160081f7b37db9665b1880b"
            },
            {
              "fixed": "d0c7cdc15fdf8c4f91aca1928e52295d175b6ec6"
            },
            {
              "fixed": "ceccbfc6de720ad633519a226715989cfb065af1"
            },
            {
              "fixed": "42156f93d123436f2a27c468f18c966b7e5db796"
            }
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "type": "GIT"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Linux",
        "name": "Kernel"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "3.1.0"
            },
            {
              "fixed": "5.10.253"
            }
          ],
          "type": "ECOSYSTEM"
        },
        {
          "events": [
            {
              "introduced": "5.11.0"
            },
            {
              "fixed": "5.15.203"
            }
          ],
          "type": "ECOSYSTEM"
        },
        {
          "events": [
            {
              "introduced": "5.16.0"
            },
            {
              "fixed": "6.1.168"
            }
          ],
          "type": "ECOSYSTEM"
        },
        {
          "events": [
            {
              "introduced": "6.2.0"
            },
            {
              "fixed": "6.6.131"
            }
          ],
          "type": "ECOSYSTEM"
        },
        {
          "events": [
            {
              "introduced": "6.7.0"
            },
            {
              "fixed": "6.12.80"
            }
          ],
          "type": "ECOSYSTEM"
        },
        {
          "events": [
            {
              "introduced": "6.13.0"
            },
            {
              "fixed": "6.18.21"
            }
          ],
          "type": "ECOSYSTEM"
        },
        {
          "events": [
            {
              "introduced": "6.19.0"
            },
            {
              "fixed": "6.19.11"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "database_specific": {
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/31xxx/CVE-2026-31504.json"
  },
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nnet: fix fanout UAF in packet_release() via NETDEV_UP race\n\n`packet_release()` has a race window where `NETDEV_UP` can re-register a\nsocket into a fanout group's `arr[]` array. The re-registration is not\ncleaned up by `fanout_release()`, leaving a dangling pointer in the fanout\narray.\n`packet_release()` does NOT zero `po-\u003enum` in its `bind_lock` section.\nAfter releasing `bind_lock`, `po-\u003enum` is still non-zero and `po-\u003eifindex`\nstill matches the bound device. A concurrent `packet_notifier(NETDEV_UP)`\nthat already found the socket in `sklist` can re-register the hook.\nFor fanout sockets, this re-registration calls `__fanout_link(sk, po)`\nwhich adds the socket back into `f-\u003earr[]` and increments `f-\u003enum_members`,\nbut does NOT increment `f-\u003esk_ref`.\n\nThe fix sets `po-\u003enum` to zero in `packet_release` while `bind_lock` is\nheld to prevent NETDEV_UP from linking, preventing the race window.\n\nThis bug was found following an additional audit with Claude Code based\non CVE-2025-38617.",
  "id": "CVE-2026-31504",
  "modified": "2026-07-08T05:39:24.156358942Z",
  "published": "2026-04-22T13:54:23.862Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/1b4c03f8892d955385c202009af7485364731bb9"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/42156f93d123436f2a27c468f18c966b7e5db796"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/42cfd7898eeed290c9fb73f732af1f7d6b0a703e"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/654386baef228c2992dbf604c819e4c7c35fc71b"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/75fe6db23705a1d55160081f7b37db9665b1880b"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/ceccbfc6de720ad633519a226715989cfb065af1"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/d0c7cdc15fdf8c4f91aca1928e52295d175b6ec6"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/ee642b1962caa9aa231c01abbd58bc453ae6b66e"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/31xxx/CVE-2026-31504.json"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-31504"
    },
    {
      "type": "PACKAGE",
      "url": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
    }
  ],
  "schema_version": "1.7.5",
  "severity": [
    {
      "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "net: fix fanout UAF in packet_release() via NETDEV_UP race"
}