{"id":"CVE-2026-31531","aliases":["CVE-2026-31531"],"related":[],"kind":"vulnerability","state":"published","title":"ipv4: nexthop: allocate skb dynamically in rtm_get_nexthop()","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nipv4: nexthop: allocate skb dynamically in rtm_get_nexthop()\n\nWhen querying a nexthop object via RTM_GETNEXTHOP, the kernel currently\nallocates a fixed-size skb using NLMSG_GOODSIZE. While sufficient for\nsingle nexthops and small Equal-Cost Multi-Path groups, this fixed\nallocation fails for large nexthop groups like 512 nexthops.\n\nThis results in the following warning splat:\n\n WARNING: net/ipv4/nexthop.c:3395 at rtm_get_nexthop+0x176/0x1c0, CPU#20: rep/4608\n [...]\n RIP: 0010:rtm_get_nexthop (net/ipv4/nexthop.c:3395)\n [...]\n Call Trace:\n  <TASK>\n  rtnetlink_rcv_msg (net/core/rtnetlink.c:6989)\n  netlink_rcv_skb (net/netlink/af_netlink.c:2550)\n  netlink_unicast (net/netlink/af_netlink.c:1319 net/netlink/af_netlink.c:1344)\n  netlink_sendmsg (net/netlink/af_netlink.c:1894)\n  ____sys_sendmsg (net/socket.c:721 net/socket.c:736 net/socket.c:2585)\n  ___sys_sendmsg (net/socket.c:2641)\n  __sys_sendmsg (net/socket.c:2671)\n  do_syscall_64 (arch/x86/entry/syscall_64.c:63 arch/x86/entry/syscall_64.c:94)\n  entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130)\n  </TASK>\n\nFix this by allocating the size dynamically using nh_nlmsg_size() and\nusing nlmsg_new(), this is consistent with nexthop_notify() behavior. In\naddition, adjust nh_nlmsg_size_grp() so it calculates the size needed\nbased on flags passed. While at it, also add the size of NHA_FDB for\nnexthop group size calculation as it was missing too.\n\nThis cannot be reproduced via iproute2 as the group size is currently\nlimited and the command fails as follows:\n\naddattr_l ERROR: message exceeded bound of 1048","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nipv4: nexthop: allocate skb dynamically in rtm_get_nexthop()\n\nWhen querying a nexthop object via RTM_GETNEXTHOP, the kernel currently\nallocates a fixed-size skb using NLMSG_GOODSIZE. While sufficient for\nsingle nexthops and small Equal-Cost Multi-Path groups, this fixed\nallocation fails for large nexthop groups like 512 nexthops.\n\nThis results in the following warning splat:\n\n WARNING: net/ipv4/nexthop.c:3395 at rtm_get_nexthop+0x176/0x1c0, CPU#20: rep/4608\n [...]\n RIP: 0010:rtm_get_nexthop (net/ipv4/nexthop.c:3395)\n [...]\n Call Trace:\n  <TASK>\n  rtnetlink_rcv_msg (net/core/rtnetlink.c:6989)\n  netlink_rcv_skb (net/netlink/af_netlink.c:2550)\n  netlink_unicast (net/netlink/af_netlink.c:1319 net/netlink/af_netlink.c:1344)\n  netlink_sendmsg (net/netlink/af_netlink.c:1894)\n  ____sys_sendmsg (net/socket.c:721 net/socket.c:736 net/socket.c:2585)\n  ___sys_sendmsg (net/socket.c:2641)\n  __sys_sendmsg (net/socket.c:2671)\n  do_syscall_64 (arch/x86/entry/syscall_64.c:63 arch/x86/entry/syscall_64.c:94)\n  entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130)\n  </TASK>\n\nFix this by allocating the size dynamically using nh_nlmsg_size() and\nusing nlmsg_new(), this is consistent with nexthop_notify() behavior. In\naddition, adjust nh_nlmsg_size_grp() so it calculates the size needed\nbased on flags passed. While at it, also add the size of NHA_FDB for\nnexthop group size calculation as it was missing too.\n\nThis cannot be reproduced via iproute2 as the group size is currently\nlimited and the command fails as follows:\n\naddattr_l ERROR: message exceeded bound of 1048","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nipv4: nexthop: asignar skb dinámicamente en rtm_get_nexthop()\n\nAl consultar un objeto nexthop a través de RTM_GETNEXTHOP, el kernel actualmente\nasigna un skb de tamaño fijo usando NLMSG_GOODSIZE. Si bien es suficiente para\nnexthops individuales y grupos pequeños de rutas de costo igual (Equal-Cost Multi-Path), esta asignación\nfija falla para grupos grandes de nexthops como 512 nexthops.\n\nEsto resulta en el siguiente ’warning splat’:\n\n WARNING: net/ipv4/nexthop.c:3395 at rtm_get_nexthop+0x176/0x1c0, CPU#20: rep/4608\n [...]\n RIP: 0010:rtm_get_nexthop (net/ipv4/nexthop.c:3395)\n [...]\n Rastro de llamada:\n  [TASK]\n  rtnetlink_rcv_msg (net/core/rtnetlink.c:6989)\n  netlink_rcv_skb (net/netlink/af_netlink.c:2550)\n  netlink_unicast (net/netlink/af_netlink.c:1319 net/netlink/af_netlink.c:1344)\n  netlink_sendmsg (net/netlink/af_netlink.c:1894)\n  ____sys_sendmsg (net/socket.c:721 net/socket.c:736 net/socket.c:2585)\n  ___sys_sendmsg (net/socket.c:2641)\n  __sys_sendmsg (net/socket.c:2671)\n  do_syscall_64 (arch/x86/entry/syscall_64.c:63 arch/x86/entry/syscall_64.c:94)\n  entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130)\n  [/TASK]\n\nSolucione esto asignando el tamaño dinámicamente usando nh_nlmsg_size() y\nusando nlmsg_new(), esto es consistente con el comportamiento de nexthop_notify(). Además,\najuste nh_nlmsg_size_grp() para que calcule el tamaño necesario\nbasado en las banderas pasadas. Ya que estamos, también agregue el tamaño de NHA_FDB para\nel cálculo del tamaño del grupo nexthop, ya que también faltaba.\n\nEsto no puede ser reproducido a través de iproute2 ya que el tamaño del grupo está actualmente\nlimitado y el comando falla de la siguiente manera:\n\naddattr_l ERROR: el mensaje excedió el límite de 1048","source":"nvd"}],"published":"2026-04-23T11:12:44.143Z","modified":"2026-11-11T23:10:00.263Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"}],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"430a049190de3c9e219f43084de9f1122da04570","fixed":"5f479aac1262959e54cdd978d873be5f202e2a40","status":"affected"},{"type":"git","introduced":"430a049190de3c9e219f43084de9f1122da04570","fixed":"18a4543c1750f96be63e349936d2dfdcb360b2dc","status":"affected"},{"type":"git","introduced":"430a049190de3c9e219f43084de9f1122da04570","fixed":"615517f3f8d53b0cf41507c7599971e17adfdfa5","status":"affected"},{"type":"git","introduced":"430a049190de3c9e219f43084de9f1122da04570","fixed":"40bd39e383a0478fd5c221f393df05fd9d70cfbc","status":"affected"},{"type":"git","introduced":"430a049190de3c9e219f43084de9f1122da04570","fixed":"635038fe19db391117e66b46bdc2b6e447ac801d","status":"affected"},{"type":"git","introduced":"430a049190de3c9e219f43084de9f1122da04570","fixed":"14cf0cd35361f4e94824bf8a42f72713d7702a73","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.3","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.3","status":"unaffected"},{"type":"semver","introduced":"6.1.191","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.160","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.83","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.24","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"6.19.14","lastAffected":"6.19.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.0","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"5.3","fixed":"6.12.83"},{"status":"affected","introduced":"6.13","fixed":"6.18.24"},{"status":"affected","introduced":"6.19","fixed":"6.19.14"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/5f479aac1262959e54cdd978d873be5f202e2a40","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/18a4543c1750f96be63e349936d2dfdcb360b2dc","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/615517f3f8d53b0cf41507c7599971e17adfdfa5","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/40bd39e383a0478fd5c221f393df05fd9d70cfbc","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/635038fe19db391117e66b46bdc2b6e447ac801d","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/14cf0cd35361f4e94824bf8a42f72713d7702a73","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-11-05T21:37:53.479Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-31531","url":"https://www.cve.org/CVERecord?id=CVE-2026-31531","licence":"CVE Terms of Use","modified":"2026-11-05T21:45:06.641Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-31531","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31531","licence":"Public domain","modified":"2026-11-11T23:10:00.263Z"}],"updatedAt":"2026-11-25T22:59:19.384Z","epss":{"score":0.00171,"percentile":0.06814,"date":"2026-12-01T12:00:22.000Z"}}