linux/Documentation/netlink/specs
Kuniyuki Iwashima 6d79b223ec neighbour: Enforce min/max to NDTPA_INTERVAL_PROBE_TIME_MS.
NDTPA_INTERVAL_PROBE_TIME_MS sets .type and .min but misses
.validation_type, so no validation is applied:

  # ynl --family rt-neigh --do setneightbl \
  --json '{"name": "arp_cache", "parms": {"interval-probe-time-ms": 0}}'

  # ynl --family rt-neigh --dump getneightbl --output-json | \
  jq '.[] | select(.name == "arp_cache" and has("config"))
          | .parms["interval-probe-time-ms"]'
  0

Moreover, nla_get_msecs() uses msecs_to_jiffies(), and u64 is
silently cast to u32, so a larger value can bypass the min check:

  e.g. 4294967296 == 0x100000000

  # ynl --family rt-neigh --do setneightbl \
  --json '{"name": "arp_cache", "parms": {"interval-probe-time-ms": 4294967296}}'

  # ynl --family rt-neigh --dump getneightbl --output-json | \
  jq '.[] | select(.name == "arp_cache" and has("config"))
          | .parms["interval-probe-time-ms"]'
  0

msecs_to_jiffies() returns MAX_JIFFY_OFFSET if the value is
larger than INT_MAX.  Also, INT_MAX ms overflows int NEIGH_VAR()
when HZ > 1000 (Alpha, MIPS), and passing a negative integer to
queue_delayed_work(unsigned long delay) causes sign extension,
which wraps around the expiry time to the past, resulting in it
being handled as 0 delay in the timer wheel.

Let's use NLA_POLICY_FULL_RANGE() and limit the max to 1 day.

The same max check is applied to sysctl as well.

Note that this controls the probe interval for NTF_MANAGED
entries, so the max of 1 day is unlikely to break any
deployments.

Fixes: 211da42eaa ("net, neigh: introduce interval_probe_time_ms for periodic probe")
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/20260909233143.2401847-3-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-11 17:25:13 -07:00
..
binder.yaml netlink: specs: binder: replace underscores with dashes in names 2025-08-21 16:49:38 +02:00
conntrack.yaml netlink: specs: add missing mask attributes for conntrack dump 2026-08-28 15:34:51 -07:00
dev-energymodel.yaml PM: EM: Add dump to get-perf-domains in the EM YNL spec 2026-01-09 21:44:46 +01:00
devlink.yaml devlink: Allow parent dev for rate-set and rate-new 2026-07-07 11:31:26 +02:00
dpll.yaml dpll: add DPLL_PIN_TYPE_INT_NCO pin type 2026-07-06 14:45:05 +02:00
drm_ras.yaml drm/drm_ras: Add clear-error-counter netlink command to drm_ras 2026-04-24 08:43:42 -04:00
ethtool.yaml net: ethtool: add ethtool COALESCE_RX_CQE_FRAMES/NSECS 2026-03-18 20:01:10 -07:00
fou.yaml fou: Don't allow 0 for FOU_ATTR_IPPROTO. 2026-01-17 16:00:24 -08:00
handshake.yaml handshake: Require admin permission for DONE command 2026-06-12 15:45:44 -07:00
index.rst docs: netlink: index.rst: add a netlink index file 2025-08-12 07:47:30 +02:00
lockd.yaml netlink: specs: clean up spaces in brackets 2025-06-11 14:01:19 -07:00
mptcp_pm.yaml mptcp: fix kdoc warnings 2026-02-06 20:35:06 -08:00
net_shaper.yaml net: shaper: reject handle IDs exceeding internal bit-width 2026-05-12 16:15:00 +02:00
netdev.yaml net: devmem: allow rx-page-size > PAGE_SIZE per dmabuf binding 2026-08-07 18:32:39 -07:00
nfsd.yaml nfsd: export NFSv4 callback op stats via netlink 2026-08-10 09:54:35 -04:00
nftables.yaml doc/netlink: nftables: Fill out operation attributes 2026-03-05 18:49:08 -08:00
nl80211.yaml netlink: specs: nl80211: fix TOOD -> TODO 2026-07-29 16:57:45 -07:00
nlctrl.yaml netlink: specs: clean up spaces in brackets 2025-06-11 14:01:19 -07:00
ovpn.yaml ovpn: limit keepalive values to one day 2026-07-30 11:28:30 +02:00
ovs_datapath.yaml netlink: specs: explicitly declare block scalar strings 2025-09-15 18:27:19 -07:00
ovs_flow.yaml netlink: specs: explicitly declare block scalar strings 2025-09-15 18:27:19 -07:00
ovs_packet.yaml netlink: specs: add OVS packet family specification 2026-05-26 17:17:41 -07:00
ovs_vport.yaml netlink: specs: explicitly declare block scalar strings 2025-09-15 18:27:19 -07:00
psp.yaml psp: add a new netdev event for dev unregister 2026-06-12 18:31:32 -07:00
rt-addr.yaml net: ipv4: report multicast group user count 2026-07-03 08:50:43 +02:00
rt-link.yaml net: reject oversized tx_queue_len at netlink parse time 2026-09-04 16:30:49 -07:00
rt-neigh.yaml neighbour: Enforce min/max to NDTPA_INTERVAL_PROBE_TIME_MS. 2026-09-11 17:25:13 -07:00
rt-route.yaml netlink: specs: rt-route: add the route deletion reason 2026-08-13 12:30:27 +02:00
rt-rule.yaml netlink: specs: support ipv4-or-v6 for dual-stack fields 2025-11-18 18:42:10 -08:00
sunrpc_cache.yaml NFSD: Put cache get-reqs dump attrs under reply 2026-06-01 11:08:18 -04:00
tc.yaml net/sched: sch_cake: share shaper state across sub-instances of cake_mq 2026-01-13 11:54:29 +01:00
tcp_metrics.yaml netlink: specs: clean up spaces in brackets 2025-06-11 14:01:19 -07:00
team.yaml netlink: specs: team: avoid mangling multilines doc 2025-09-15 18:27:19 -07:00
wireguard.yaml wireguard: netlink: add YNL specification 2025-12-02 04:12:19 +01:00