{"id":"CVE-2026-143186","state":"PUBLISHED","title":"nsh: limit recursion in nsh_gso_segment()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nnsh: limit recursion in nsh_gso_segment()\n\nnsh_gso_segment() calls skb_mac_gso_segment() for the inner packet,\nwhich calls nsh_gso_segment() again when the next protocol is NSH,\neither directly or behind an inner Ethernet header (ETH_P_TEB).\n\nNothing limits the depth: a GSO packet made of stacked 8-byte NSH\nheaders recurses once per header, and a 64KB packet can hold about\n8000 of them, overflowing the kernel stack.\n\nSuch a packet can be injected with a packet socket using\nPACKET_VNET_HDR, or with tun/tap or virtio_net, as nothing checks\nthat a GSO packet with VIRTIO_NET_HDR_F_NEEDS_CSUM carries the\nprotocol it claims. It is then segmented in software if the output\ndevice does not support the GSO type:\n\nBUG: TASK stack guard page was hit at ffffcad5c0ab3ff8 (stack is ffffcad5c0ab4000..ffffcad5c0ab8000)\nOops: stack guard page: 0000 [#1] SMP NOPTI\nCPU: 3 UID: 0 PID: 337 Comm: nsh_gso Tainted: G            E       7.4.0-rc1+ #118 PREEMPT(lazy)\nRIP: 0010:lock_acquire (kernel/locking/lockdep.c:5902)\nCall Trace:\n <TASK>\n skb_mac_gso_segment (include/linux/rcupdate.h:309 include/linux/rcupdate.h:849 net/core/gso.c:50)\n nsh_gso_segment (net/nsh/nsh.c:110) nsh\n skb_mac_gso_segment (net/core/gso.c:53)\n nsh_gso_segment (net/nsh/nsh.c:110) nsh\n [...]\n skb_mac_gso_segment (net/core/gso.c:53)\n __skb_gso_segment (net/core/gso.c:129)\n validate_xmit_skb (net/core/dev.c:4238)\n __dev_queue_xmit (net/core/dev.c:5087)\n packet_sendmsg (net/packet/af_packet.c:3157 net/packet/af_packet.c:3189)\n __sys_sendto (net/socket.c:800 net/socket.c:818 net/socket.c:2283)\n __x64_sys_sendto (net/socket.c:2290 net/socket.c:2286 net/socket.c:2286)\n do_syscall_64 (arch/x86/entry/syscall_64.c:61 arch/x86/entry/syscall_64.c:84)\n entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:121)\n\nUse gso_recursion_inc_test(), added in commit 006c8b834aed (\"net: gso:\nlimit recursive IP-in-IP segmentation\"), with the same limit as IPv4\nand IPv6. The counter is shared with them: a packet with four NSH\nheaders in front of an IPv4 header is still segmented, one more NSH\nheader and it is dropped.\n\nThe NSH -> ETH_P_TEB -> NSH route is covered as well, as each round\ngoes through nsh_gso_segment().","publishedAt":"2026-12-03T09:20:16.705Z","updatedAt":"2026-12-03T09:20:16.705Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"c411ed854584a71b0e86ac3019b60e4789d88086","status":"affected","lessThan":"fd8822212fc3dbbf96531fcbc3979e2c7f456948","versionType":"git"},{"version":"c411ed854584a71b0e86ac3019b60e4789d88086","status":"affected","lessThan":"74f9a73053cc3cf6e6177d3c5ea9736adf1bdaf6","versionType":"git"},{"version":"c411ed854584a71b0e86ac3019b60e4789d88086","status":"affected","lessThan":"766d400fa553a8cef0670e1cb0664d8b78fd3101","versionType":"git"},{"version":"c411ed854584a71b0e86ac3019b60e4789d88086","status":"affected","lessThan":"3921fb102d78a6d7aa61b8d273e097a1a8026b90","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["include/net/gso.h","net/nsh/nsh.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.14","status":"affected"},{"version":"0","status":"unaffected","lessThan":"4.14","versionType":"semver"},{"version":"6.12.120","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.66","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.7","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc3","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["include/net/gso.h","net/nsh/nsh.c"]}],"references":["https://git.kernel.org/stable/c/fd8822212fc3dbbf96531fcbc3979e2c7f456948","https://git.kernel.org/stable/c/74f9a73053cc3cf6e6177d3c5ea9736adf1bdaf6","https://git.kernel.org/stable/c/766d400fa553a8cef0670e1cb0664d8b78fd3101","https://git.kernel.org/stable/c/3921fb102d78a6d7aa61b8d273e097a1a8026b90"],"weaknesses":[],"ingestedAt":"2026-12-03T09:40:06.136Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/143xxx/CVE-2026-143186.json","commit":"9e309c7c0f08856e2558a1df33f75dca027fab70","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-143186","state":"PUBLISHED","datePublished":"2026-12-03T09:20:16.705Z","dateUpdated":"2026-12-03T09:20:16.705Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-12-03T03:10:28.358Z"},"containers":{"cna":{"title":"nsh: limit recursion in nsh_gso_segment()","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nnsh: limit recursion in nsh_gso_segment()\n\nnsh_gso_segment() calls skb_mac_gso_segment() for the inner packet,\nwhich calls nsh_gso_segment() again when the next protocol is NSH,\neither directly or behind an inner Ethernet header (ETH_P_TEB).\n\nNothing limits the depth: a GSO packet made of stacked 8-byte NSH\nheaders recurses once per header, and a 64KB packet can hold about\n8000 of them, overflowing the kernel stack.\n\nSuch a packet can be injected with a packet socket using\nPACKET_VNET_HDR, or with tun/tap or virtio_net, as nothing checks\nthat a GSO packet with VIRTIO_NET_HDR_F_NEEDS_CSUM carries the\nprotocol it claims. It is then segmented in software if the output\ndevice does not support the GSO type:\n\nBUG: TASK stack guard page was hit at ffffcad5c0ab3ff8 (stack is ffffcad5c0ab4000..ffffcad5c0ab8000)\nOops: stack guard page: 0000 [#1] SMP NOPTI\nCPU: 3 UID: 0 PID: 337 Comm: nsh_gso Tainted: G            E       7.4.0-rc1+ #118 PREEMPT(lazy)\nRIP: 0010:lock_acquire (kernel/locking/lockdep.c:5902)\nCall Trace:\n <TASK>\n skb_mac_gso_segment (include/linux/rcupdate.h:309 include/linux/rcupdate.h:849 net/core/gso.c:50)\n nsh_gso_segment (net/nsh/nsh.c:110) nsh\n skb_mac_gso_segment (net/core/gso.c:53)\n nsh_gso_segment (net/nsh/nsh.c:110) nsh\n [...]\n skb_mac_gso_segment (net/core/gso.c:53)\n __skb_gso_segment (net/core/gso.c:129)\n validate_xmit_skb (net/core/dev.c:4238)\n __dev_queue_xmit (net/core/dev.c:5087)\n packet_sendmsg (net/packet/af_packet.c:3157 net/packet/af_packet.c:3189)\n __sys_sendto (net/socket.c:800 net/socket.c:818 net/socket.c:2283)\n __x64_sys_sendto (net/socket.c:2290 net/socket.c:2286 net/socket.c:2286)\n do_syscall_64 (arch/x86/entry/syscall_64.c:61 arch/x86/entry/syscall_64.c:84)\n entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:121)\n\nUse gso_recursion_inc_test(), added in commit 006c8b834aed (\"net: gso:\nlimit recursive IP-in-IP segmentation\"), with the same limit as IPv4\nand IPv6. The counter is shared with them: a packet with four NSH\nheaders in front of an IPv4 header is still segmented, one more NSH\nheader and it is dropped.\n\nThe NSH -> ETH_P_TEB -> NSH route is covered as well, as each round\ngoes through nsh_gso_segment()."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"c411ed854584a71b0e86ac3019b60e4789d88086","status":"affected","lessThan":"fd8822212fc3dbbf96531fcbc3979e2c7f456948","versionType":"git"},{"version":"c411ed854584a71b0e86ac3019b60e4789d88086","status":"affected","lessThan":"74f9a73053cc3cf6e6177d3c5ea9736adf1bdaf6","versionType":"git"},{"version":"c411ed854584a71b0e86ac3019b60e4789d88086","status":"affected","lessThan":"766d400fa553a8cef0670e1cb0664d8b78fd3101","versionType":"git"},{"version":"c411ed854584a71b0e86ac3019b60e4789d88086","status":"affected","lessThan":"3921fb102d78a6d7aa61b8d273e097a1a8026b90","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["include/net/gso.h","net/nsh/nsh.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.14","status":"affected"},{"version":"0","status":"unaffected","lessThan":"4.14","versionType":"semver"},{"version":"6.12.120","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.66","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.7","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc3","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["include/net/gso.h","net/nsh/nsh.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/fd8822212fc3dbbf96531fcbc3979e2c7f456948"},{"url":"https://git.kernel.org/stable/c/74f9a73053cc3cf6e6177d3c5ea9736adf1bdaf6"},{"url":"https://git.kernel.org/stable/c/766d400fa553a8cef0670e1cb0664d8b78fd3101"},{"url":"https://git.kernel.org/stable/c/3921fb102d78a6d7aa61b8d273e097a1a8026b90"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-12-03T09:20:16.705Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.14","versionEndExcluding":"6.12.120"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.14","versionEndExcluding":"6.18.66"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.14","versionEndExcluding":"7.3.7"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.14","versionEndExcluding":"7.4-rc3"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}