# CVE-2026-31531: ipv4: nexthop: allocate skb dynamically in rtm\_get\_nexthop()

- Priority: **Routine**
- Reason: Not severe (CVSS 5.5, local access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2026-04-23 · Modified: 2026-11-05
- Aliases: UBUNTU-CVE-2026-31531, DEBIAN-CVE-2026-31531, CGA-278h-x258-jxmx, CGA-28p2-cq8x-p78h, CGA-7ghx-63p8-676w, CGA-7h55-fw52-whj7, CGA-9vgg-6pjg-cfrc, CGA-gj2m-qm3q-c8hm, CGA-hpm7-69vf-pvxj, CGA-m7x4-v6mv-67xp, CGA-qc98-cm7g-9fh7, CGA-w7ch-fqcg-32h2
- Record: https://cvemate.com/vulnerability/CVE-2026-31531 · JSON: https://cvemate.com/vulnerability/CVE-2026-31531/json

## Description

```text
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
```

## Signals

- CVSS: 5.5 medium (v3.1, NVD) CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
- EPSS: 0.171%, percentile 6.76%, as of 2026-12-05
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected (first 20 of 168)

- chainguard linux-aws-6.12 (Chainguard): \< 6.12.85-r0
- chainguard linux-aws-6.18 (Chainguard): \< 6.18.31-r0
- chainguard linux-azure-6.18 (Chainguard): \< 6.18.31-r0
- chainguard linux-gcp-6.12 (Chainguard): \< 6.12.85-r0
- chainguard linux-gcp-6.18 (Chainguard): \< 6.18.31-r0
- chainguard linux-qemu-6.12 (Chainguard): \< 6.12.85-r0
- chainguard linux-qemu-6.18 (Chainguard): \< 6.18.31-r0
- chainguard linux-qemu-6.18-bootc-boot-installed (Chainguard): \< 6.18.31-r0
- chainguard linux-vmware-6.12 (Chainguard): \< 6.12.85-r0
- chainguard linux-vmware-6.18 (Chainguard): \< 6.18.31-r0
- debian linux (Debian): All versions (No fix recorded) \| \< 6.1.192-1 \| \< 6.12.85-1 \| \< 6.19.14-1
- ubuntu linux (Ubuntu): All versions (No fix recorded) \| \< 6.8.0-151.151
- ubuntu linux-allwinner-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws (Ubuntu): All versions (No fix recorded) \| \< 6.8.0-1070.76
- ubuntu linux-aws-5.0 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.11 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.13 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.15 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.3 (Ubuntu): All versions (No fix recorded)

## References

- <https://git.kernel.org/stable/c/615517f3f8d53b0cf41507c7599971e17adfdfa5>
- <https://git.kernel.org/stable/c/40bd39e383a0478fd5c221f393df05fd9d70cfbc>
- <https://git.kernel.org/stable/c/635038fe19db391117e66b46bdc2b6e447ac801d>
- <https://git.kernel.org/stable/c/14cf0cd35361f4e94824bf8a42f72713d7702a73>
- <https://ubuntu.com/security/CVE-2026-31531>
- <https://www.cve.org/CVERecord?id=CVE-2026-31531>
- <https://git.kernel.org/linus/14cf0cd35361f4e94824bf8a42f72713d7702a73>
- <https://security-tracker.debian.org/tracker/CVE-2026-31531>
- <https://git.kernel.org/stable/c/18a4543c1750f96be63e349936d2dfdcb360b2dc>
- <https://git.kernel.org/stable/c/5f479aac1262959e54cdd978d873be5f202e2a40>
- <https://ubuntu.com/security/notices/USN-9173-1>
- <https://ubuntu.com/security/notices/USN-9175-1>
- <https://ubuntu.com/security/notices/USN-9174-1>
- <https://ubuntu.com/security/notices/USN-9183-1>
- <https://ubuntu.com/security/notices/USN-9173-2>
- <https://ubuntu.com/security/notices/USN-9192-1>
- <https://ubuntu.com/security/notices/USN-9173-3>
- <https://ubuntu.com/security/notices/USN-9174-2>
- <https://ubuntu.com/security/notices/USN-9191-1>

---

Data as of 2026-12-06T04:33:16.979Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
