CVE-2026-143186: nsh: limit recursion in nsh_gso_segment()

Published Dec 3, 2026
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

nsh: limit recursion in nshgsosegment()

nshgsosegment() calls skbmacgsosegment() for the inner packet, which calls nshgsosegment() again when the next protocol is NSH, either directly or behind an inner Ethernet header (ETHPTEB).

Nothing limits the depth: a GSO packet made of stacked 8-byte NSH headers recurses once per header, and a 64KB packet can hold about 8000 of them, overflowing the kernel stack.

Such a packet can be injected with a packet socket using PACKETVNETHDR, or with tun/tap or virtionet, as nothing checks that a GSO packet with VIRTIONETHDRFNEEDSCSUM carries the protocol it claims. It is then segmented in software if the output device does not support the GSO type:

BUG: TASK stack guard page was hit at ffffcad5c0ab3ff8 (stack is ffffcad5c0ab4000..ffffcad5c0ab8000) Oops: stack guard page: 0000 [#1] SMP NOPTI CPU: 3 UID: 0 PID: 337 Comm: nshgso Tainted: G E 7.4.0-rc1+ #118 PREEMPT(lazy) RIP: 0010:lockacquire (kernel/locking/lockdep.c:5902) Call Trace: <TASK> skbmacgsosegment (include/linux/rcupdate.h:309 include/linux/rcupdate.h:849 net/core/gso.c:50) nshgsosegment (net/nsh/nsh.c:110) nsh skbmacgsosegment (net/core/gso.c:53) nshgsosegment (net/nsh/nsh.c:110) nsh [...] skbmacgsosegment (net/core/gso.c:53) skbgsosegment (net/core/gso.c:129) validatexmitskb (net/core/dev.c:4238) devqueuexmit (net/core/dev.c:5087) packetsendmsg (net/packet/afpacket.c:3157 net/packet/afpacket.c:3189) syssendto (net/socket.c:800 net/socket.c:818 net/socket.c:2283) x64syssendto (net/socket.c:2290 net/socket.c:2286 net/socket.c:2286) dosyscall64 (arch/x86/entry/syscall64.c:61 arch/x86/entry/syscall64.c:84) entrySYSCALL64afterhwframe (arch/x86/entry/entry64.S:121)

Use gsorecursioninctest(), added in commit 006c8b834aed ("net: gso: limit recursive IP-in-IP segmentation"), with the same limit as IPv4 and IPv6. The counter is shared with them: a packet with four NSH headers in front of an IPv4 header is still segmented, one more NSH header and it is dropped.

The NSH -> ETHPTEB -> NSH route is covered as well, as each round goes through nshgsosegment().

Affected Software

7 affected componentsFixes available
Linux Linux kernel
linux/kernel>=4.14.0<6.12.120
6.12.120
linux/kernel>=6.13.0<6.18.66
6.18.66
linux/kernel>=6.19.0<7.3.7
7.3.7
debian/linux*
debian/linux*
debian/linux*

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.12.120
  2. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.18.66
  3. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 7.3.7

Event History

Dec 3, 2026
CVE Published
via MITRE·09:20 AM
Data Sourced
via MITRE·09:20 AM
Description
Data Sourced
via OSV·09:20 AM
DescriptionAffected Software
Data Sourced
via NVD·10:17 AM
Description

Frequently Asked Questions

1

What traffic pattern triggers the stack overflow?

A GSO packet containing deeply stacked 8-byte NSH headers can cause recursive segmentation when the next protocol is NSH, either directly or behind an inner Ethernet header using ETH_P_TEB. A 64KB packet can contain roughly 8,000 such headers, exhausting the kernel stack.

2

Which packet injection paths can carry the crafted packet?

The crafted GSO packet can be injected through a packet socket using PACKET_VNET_HDR, or through tun/tap or virtio_net. These paths do not verify that a GSO packet marked with VIRTIO_NET_HDR_F_NEEDS_CSUM carries the protocol it claims.

3

When is the vulnerable segmentation path reached?

The packet is segmented in software when the output device does not support the relevant GSO type. During that software segmentation, nsh_gso_segment() can recursively re-enter itself for each stacked NSH header.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203