{
  "affected": [
    {
      "ranges": [
        {
          "events": [
            {
              "introduced": "9027497a25e3c92b5053b2643e0c18f910865625"
            },
            {
              "fixed": "964b693376ff329071575dadd9dd531d989d12e5"
            },
            {
              "fixed": "56f8d919739b588e2ad8cb9fb9eff704f32afaab"
            }
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "type": "GIT"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Linux",
        "name": "Kernel"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "7.1.0"
            },
            {
              "fixed": "7.3.4"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "database_specific": {
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/99xxx/CVE-2026-99980.json"
  },
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nnetdev: Hide the netdev_priv() origin from GCC in netdev_from_priv()\n\nGCC 15.1 and later can compute an object size of 0 for a pointer that\ncontainer_of() derives from a pointer into a __counted_by flexible array\nmember[1]; Clang gets it right. netdev_from_priv() does this with struct\nnet_device's \"priv\" array, so when GCC can see that its argument came\nfrom netdev_priv(), FORTIFY_SOURCE sees a zero-sized net_device. Since\ncommit 9027497a25e3c (\"team: use netdev_from_priv()\"), adding a port of\nanother type to a team device can then fail the memcpy() to\n\"dev-\u003ebroadcast\" in team_setup_by_port(), which GCC sees through after\ninlining team_port_add() into team_add_slave():\n\n  memcpy: detected buffer overflow: 4 byte write of buffer size 0\n  ...\n  kernel BUG at lib/string_helpers.c:1044!\n  ...\n  Call Trace:\n   \u003cTASK\u003e\n   team_add_slave.cold+0x88/0x201\n   do_set_master+0x11c/0x180\n   do_setlink.isra.0+0x3a4/0x1410\n\nWhether GCC inlines that far depends on the architecture and the\nconfiguration. It does on ppc64le, where this was reported, and on\nx86_64 with defconfig plus hardening.config or with Debian's\nconfiguration, but not with allmodconfig.\n\nHide where \"priv\" came from with OPTIMIZER_HIDE_VAR(), so GCC sees a\nnet_device of unknown size whose members have their declared sizes. (An\n\"unknown\" size is considered uncheckable by FORTIFY.)  FORTIFY still\nbounds writes to members; only the whole-object size becomes unknown,\nas it already is for any net_device pointer GCC can't trace to its\nallocation. In an extracted PoC, the __builtin_dynamic_object_size()\nof \"dev-\u003ebroadcast\" for the two types FORTIFY sees, before and after\nthis patch:\n\n                                   GCC 16.2.0      Clang 22 and 24\n                                 before   after\n  plain pointer, whole object   unknown  unknown        44\n  container_of(), whole object        0  unknown        44\n  container_of(), member              0       32        32\n\nIn addition to getting the bogus \"0\" fixed in GCC, I'll be following up\nto solve the whole-object visiblity disparity as well.\n\nBuild tested with GCC 16.2.0: ARCH=x86_64 defconfig with hardening.config,\nCONFIG_NET_TEAM=y, and CONFIG_NET_IPGRE=y; ARCH=arm64 defconfig with\nhardening.config, CONFIG_NET_TEAM=y, CONFIG_PPP=y, and CONFIG_NET_AIROHA=m;\nand drivers/net/team/, drivers/net/ppp/, and drivers/net/ethernet/airoha/\nin ARCH=x86_64 allmodconfig. Under QEMU, the x86_64 kernel hits the BUG\nabove when adding the GRE fallback device \"gre0\" as a port of a new team\ndevice without this patch, and adds it with the patch.",
  "id": "CVE-2026-99980",
  "modified": "2026-12-01T20:45:36.538075364Z",
  "published": "2026-11-30T13:18:50.711Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/56f8d919739b588e2ad8cb9fb9eff704f32afaab"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/964b693376ff329071575dadd9dd531d989d12e5"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/99xxx/CVE-2026-99980.json"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-99980"
    },
    {
      "type": "PACKAGE",
      "url": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
    }
  ],
  "schema_version": "1.9.2",
  "summary": "netdev: Hide the netdev_priv() origin from GCC in netdev_from_priv()"
}