{"id":"CVE-2025-71128","state":"PUBLISHED","title":"erspan: Initialize options_len before referencing options.","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nerspan: Initialize options_len before referencing options.\n\nThe struct ip_tunnel_info has a flexible array member named\noptions that is protected by a counted_by(options_len)\nattribute.\n\nThe compiler will use this information to enforce runtime bounds\nchecking deployed by FORTIFY_SOURCE string helpers.\n\nAs laid out in the GCC documentation, the counter must be\ninitialized before the first reference to the flexible array\nmember.\n\nAfter scanning through the files that use struct ip_tunnel_info\nand also refer to options or options_len, it appears the normal\ncase is to use the ip_tunnel_info_opts_set() helper.\n\nSaid helper would initialize options_len properly before copying\ndata into options, however in the GRE ERSPAN code a partial\nupdate is done, preventing the use of the helper function.\n\nBefore this change the handling of ERSPAN traffic in GRE tunnels\nwould cause a kernel panic when the kernel is compiled with\nGCC 15+ and having FORTIFY_SOURCE configured:\n\nmemcpy: detected buffer overflow: 4 byte write of buffer size 0\n\nCall Trace:\n <IRQ>\n __fortify_panic+0xd/0xf\n erspan_rcv.cold+0x68/0x83\n ? ip_route_input_slow+0x816/0x9d0\n gre_rcv+0x1b2/0x1c0\n gre_rcv+0x8e/0x100\n ? raw_v4_input+0x2a0/0x2b0\n ip_protocol_deliver_rcu+0x1ea/0x210\n ip_local_deliver_finish+0x86/0x110\n ip_local_deliver+0x65/0x110\n ? ip_rcv_finish_core+0xd6/0x360\n ip_rcv+0x186/0x1a0\n\nReported-at: https://launchpad.net/bugs/2129580","publishedAt":"2026-01-14T15:07:44.941Z","updatedAt":"2026-10-19T18:15:15.302Z","severity":{"score":7.5,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"bb5e62f2d547c4de6d1b144cbce2373a76c33f18","status":"affected","lessThan":"b282b2a9eed848587c1348abdd5d83fa346a2743","versionType":"git"},{"version":"bb5e62f2d547c4de6d1b144cbce2373a76c33f18","status":"affected","lessThan":"35ddf66c65eff93fff91406756ba273600bf61a3","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/ipv4/ip_gre.c","net/ipv6/ip6_gre.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.15","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.15","versionType":"semver"},{"version":"6.18.4","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"6.19","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/ipv4/ip_gre.c","net/ipv6/ip6_gre.c"]}],"references":["https://git.kernel.org/stable/c/b282b2a9eed848587c1348abdd5d83fa346a2743","https://git.kernel.org/stable/c/35ddf66c65eff93fff91406756ba273600bf61a3"],"weaknesses":["CWE-665"],"ingestedAt":"2026-10-29T20:10:04.440Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/71xxx/CVE-2025-71128.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-71128","state":"PUBLISHED","datePublished":"2026-01-14T15:07:44.941Z","dateUpdated":"2026-10-19T18:15:15.302Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-01-13T15:30:19.655Z"},"containers":{"cna":{"title":"erspan: Initialize options_len before referencing options.","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nerspan: Initialize options_len before referencing options.\n\nThe struct ip_tunnel_info has a flexible array member named\noptions that is protected by a counted_by(options_len)\nattribute.\n\nThe compiler will use this information to enforce runtime bounds\nchecking deployed by FORTIFY_SOURCE string helpers.\n\nAs laid out in the GCC documentation, the counter must be\ninitialized before the first reference to the flexible array\nmember.\n\nAfter scanning through the files that use struct ip_tunnel_info\nand also refer to options or options_len, it appears the normal\ncase is to use the ip_tunnel_info_opts_set() helper.\n\nSaid helper would initialize options_len properly before copying\ndata into options, however in the GRE ERSPAN code a partial\nupdate is done, preventing the use of the helper function.\n\nBefore this change the handling of ERSPAN traffic in GRE tunnels\nwould cause a kernel panic when the kernel is compiled with\nGCC 15+ and having FORTIFY_SOURCE configured:\n\nmemcpy: detected buffer overflow: 4 byte write of buffer size 0\n\nCall Trace:\n <IRQ>\n __fortify_panic+0xd/0xf\n erspan_rcv.cold+0x68/0x83\n ? ip_route_input_slow+0x816/0x9d0\n gre_rcv+0x1b2/0x1c0\n gre_rcv+0x8e/0x100\n ? raw_v4_input+0x2a0/0x2b0\n ip_protocol_deliver_rcu+0x1ea/0x210\n ip_local_deliver_finish+0x86/0x110\n ip_local_deliver+0x65/0x110\n ? ip_rcv_finish_core+0xd6/0x360\n ip_rcv+0x186/0x1a0\n\nReported-at: https://launchpad.net/bugs/2129580"}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"bb5e62f2d547c4de6d1b144cbce2373a76c33f18","status":"affected","lessThan":"b282b2a9eed848587c1348abdd5d83fa346a2743","versionType":"git"},{"version":"bb5e62f2d547c4de6d1b144cbce2373a76c33f18","status":"affected","lessThan":"35ddf66c65eff93fff91406756ba273600bf61a3","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/ipv4/ip_gre.c","net/ipv6/ip6_gre.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.15","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.15","versionType":"semver"},{"version":"6.18.4","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"6.19","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/ipv4/ip_gre.c","net/ipv6/ip6_gre.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/b282b2a9eed848587c1348abdd5d83fa346a2743"},{"url":"https://git.kernel.org/stable/c/35ddf66c65eff93fff91406756ba273600bf61a3"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","baseScore":7.5,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:N - IPv4 or IPv6 ERSPAN is carried over routable GRE/IP, allowing a remote attacker to send packets directly to an enabled collect-metadata ERSPAN endpoint.\nAC:L - Once the affected GCC 15+ FORTIFY build and metadata-mode endpoint exist, one well-formed packet deterministically triggers the failure without a race or heap-layout requirement.\nPR:N - Creating the endpoint requires CAP_NET_ADMIN, but the packet-processing path has no capability or authentication gate. A collect-metadata tunnel acts as a wildcard endpoint and accepts packets from unauthenticated peers.\nUI:N - Receiving the attacker-supplied packet triggers the vulnerability without any victim action.\nS:U - The resulting kernel failure affects resources governed by the same host-kernel security authority and does not cross a VM or comparable boundary.\nC:N - The allocation includes the complete ERSPAN metadata buffer, and FORTIFY invokes BUG() before the allegedly overflowing copy; no out-of-bounds read or disclosure primitive exists.\nI:N - The defect does not perform an out-of-bounds write: the destination is physically large enough, and the erroneous runtime bounds check stops execution before memcpy.\nA:H - The zero dynamic bound reaches __fortify_panic and BUG() in the receive softirq, producing a repeatable kernel oops or panic and system-wide service loss."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T12:12:14.477Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.15","versionEndExcluding":"6.18.4"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.15","versionEndExcluding":"6.19"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"id":"CVE-2025-71128","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"yes"},{"Technical Impact":"partial"}],"version":"2.0.3","timestamp":"2026-10-16T15:05:53.966037Z"}}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-665","lang":"en","type":"CWE","description":"CWE-665 Improper Initialization"}]}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-10-19T18:15:15.302Z"}}]}}}