# CVE-2026-31531: ipv4: nexthop: allocate skb dynamically in rtm_get_nexthop()

Status: published. Published: 2026-04-23. Updated: 2026-11-05.

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

ipv4: nexthop: allocate skb dynamically in rtm_get_nexthop()

When querying a nexthop object via RTM_GETNEXTHOP, the kernel currently
allocates a fixed-size skb using NLMSG_GOODSIZE. While sufficient for
single nexthops and small Equal-Cost Multi-Path groups, this fixed
allocation fails for large nexthop groups like 512 nexthops.

This results in the following warning splat:

 WARNING: net/ipv4/nexthop.c:3395 at rtm_get_nexthop+0x176/0x1c0, CPU#20: rep/4608
 [...]
 RIP: 0010:rtm_get_nexthop (net/ipv4/nexthop.c:3395)
 [...]
 Call Trace:
  <TASK>
  rtnetlink_rcv_msg (net/core/rtnetlink.c:6989)
  netlink_rcv_skb (net/netlink/af_netlink.c:2550)
  netlink_unicast (net/netlink/af_netlink.c:1319 net/netlink/af_netlink.c:1344)
  netlink_sendmsg (net/netlink/af_netlink.c:1894)
  ____sys_sendmsg (net/socket.c:721 net/socket.c:736 net/socket.c:2585)
  ___sys_sendmsg (net/socket.c:2641)
  __sys_sendmsg (net/socket.c:2671)
  do_syscall_64 (arch/x86/entry/syscall_64.c:63 arch/x86/entry/syscall_64.c:94)
  entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130)
  </TASK>

Fix this by allocating the size dynamically using nh_nlmsg_size() and
using nlmsg_new(), this is consistent with nexthop_notify() behavior. In
addition, adjust nh_nlmsg_size_grp() so it calculates the size needed
based on flags passed. While at it, also add the size of NHA_FDB for
nexthop group size calculation as it was missing too.

This cannot be reproduced via iproute2 as the group size is currently
limited and the command fails as follows:

addattr_l ERROR: message exceeded bound of 1048

## Remediation

No remediation reported in collected sources

## Affected products and versions

- Linux / Linux: ≥ 430a049190de3c9e219f43084de9f1122da04570; < 5f479aac1262959e54cdd978d873be5f202e2a40 (affected, git); ≥ 430a049190de3c9e219f43084de9f1122da04570; < 18a4543c1750f96be63e349936d2dfdcb360b2dc (affected, git); ≥ 430a049190de3c9e219f43084de9f1122da04570; < 615517f3f8d53b0cf41507c7599971e17adfdfa5 (affected, git); ≥ 430a049190de3c9e219f43084de9f1122da04570; < 40bd39e383a0478fd5c221f393df05fd9d70cfbc (affected, git); ≥ 430a049190de3c9e219f43084de9f1122da04570; < 635038fe19db391117e66b46bdc2b6e447ac801d (affected, git); ≥ 430a049190de3c9e219f43084de9f1122da04570; < 14cf0cd35361f4e94824bf8a42f72713d7702a73 (affected, git). Source: CNA: Linux
- Linux / Linux: 5.3 (affected); ≥ 0; < 5.3 (unaffected, semver); ≥ 6.1.191; ≤ 6.1.* (unaffected, semver); ≥ 6.6.160; ≤ 6.6.* (unaffected, semver); ≥ 6.12.83; ≤ 6.12.* (unaffected, semver); ≥ 6.18.24; ≤ 6.18.* (unaffected, semver); ≥ 6.19.14; ≤ 6.19.* (unaffected, semver); ≥ 7.0; ≤ * (unaffected, original_commit_for_fix). Source: CNA: Linux

## Severity and prioritization

- CISA KEV: No listing in collected sources

- EPSS: 0.17% as of 2026-11-05; percentile 5.74%

- SSVC: exploitation none; automatable no; technical impact partial; source ADP: CISA-ADP

- Weaknesses: Not reported

## Exploit evidence

No exploit evidence in collected sources. This is not proof of no exploitation.

## References

- https://git.kernel.org/stable/c/5f479aac1262959e54cdd978d873be5f202e2a40 (CNA: Linux)

- https://git.kernel.org/stable/c/18a4543c1750f96be63e349936d2dfdcb360b2dc (CNA: Linux)

- https://git.kernel.org/stable/c/615517f3f8d53b0cf41507c7599971e17adfdfa5 (CNA: Linux)

- https://git.kernel.org/stable/c/40bd39e383a0478fd5c221f393df05fd9d70cfbc (CNA: Linux)

- https://git.kernel.org/stable/c/635038fe19db391117e66b46bdc2b6e447ac801d (CNA: Linux)

- https://git.kernel.org/stable/c/14cf0cd35361f4e94824bf8a42f72713d7702a73 (CNA: Linux)

## Provenance

- CNA: Linux: https://www.cve.org/CVERecord?id=CVE-2026-31531; retrieved 2026-11-05; source updated 2026-11-05

- FIRST EPSS: https://api.first.org/data/v1/epss?cve=CVE-2026-31531; retrieved 2026-11-05; source updated Not reported

Revision: b1ed9ddcb8e4612da1f18a7b2af5d7771358051a7a3f0e2a32b1808f0a05478b

Canonical: https://y2.dev/cve/CVE-2026-31531

## Agent and API access

Public CVE pages, Markdown, and JSON are free to read without an account or API key.

- Public catalog: https://y2.dev/cve/index.json. Follow nextCursor with the same search, filters, sort, and limit (1–100). A null cursor marks the end.

- WebMCP: search_cve_disclosures, get_cve_disclosure, get_cve_page_markdown, get_y2_cve_access. Available in compatible browsers.

- Cyber API: https://api.y2.dev/api/v2/cyber/cves and https://api.y2.dev/api/v2/cyber/cves/{cveId}.

- Y2 Pro or Elite: create a workspace API key with the intel:cyber scope and send Authorization: Bearer <Y2_API_KEY>. Setup: https://y2.dev/docs/api/create-key.

- x402: Pay per request without an account or API key. Omit Authorization, read the HTTP 402 PAYMENT-REQUIRED challenge, validate its current requirements, and retry with PAYMENT-SIGNATURE through an authorized payment client. These browser tools never make payments. Guide: https://y2.dev/docs/api/x402.

- OpenAPI: https://y2.dev/api/openapi.yaml. Agent access metadata: https://y2.dev/cve/agent.json.

Collected public records only. Check source status for coverage and freshness.