{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-99980","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","state":"PUBLISHED","assignerShortName":"Linux","dateReserved":"2026-09-25T10:25:14.450Z","datePublished":"2026-11-30T13:18:50.711Z","dateUpdated":"2026-11-30T13:18:50.711Z"},"containers":{"cna":{"providerMetadata":{"orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux","dateUpdated":"2026-11-30T13:18:50.711Z"},"descriptions":[{"lang":"en","value":"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->broadcast\" 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   <TASK>\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->broadcast\" 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."}],"affected":[{"product":"Linux","vendor":"Linux","defaultStatus":"unaffected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["include/linux/netdevice.h"],"versions":[{"version":"9027497a25e3c92b5053b2643e0c18f910865625","lessThan":"964b693376ff329071575dadd9dd531d989d12e5","status":"affected","versionType":"git"},{"version":"9027497a25e3c92b5053b2643e0c18f910865625","lessThan":"56f8d919739b588e2ad8cb9fb9eff704f32afaab","status":"affected","versionType":"git"}]},{"product":"Linux","vendor":"Linux","defaultStatus":"affected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["include/linux/netdevice.h"],"versions":[{"version":"7.1","status":"affected"},{"version":"0","lessThan":"7.1","status":"unaffected","versionType":"semver"},{"version":"7.3.4","lessThanOrEqual":"7.3.*","status":"unaffected","versionType":"semver"},{"version":"7.4-rc1","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"7.1","versionEndExcluding":"7.3.4"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"7.1","versionEndExcluding":"7.4-rc1"}]}]}],"references":[{"url":"https://git.kernel.org/stable/c/964b693376ff329071575dadd9dd531d989d12e5"},{"url":"https://git.kernel.org/stable/c/56f8d919739b588e2ad8cb9fb9eff704f32afaab"}],"title":"netdev: Hide the netdev_priv() origin from GCC in netdev_from_priv()","x_generator":{"engine":"bippy-1.2.0"}}}}