mirror-linux/Documentation/netlink/specs
Jakub Kicinski d75ec7e8ba net: shaper: protect from late creation of hierarchy
We look up a netdev during prep of Netlink ops (pre- callbacks)
and take a ref to it. Then later in the body of the callback
we take its lock or RCU which are the actual protections.

The netdev may get unregistered in between the time we take
the ref and the time we lock it. We may allocate the hierarchy
after flush has already run, which would lead to a leak.

Take the instance lock in pre- already, this saves us from the race
and removes the need for dedicated lock/unlock callbacks completely.
After all, if there's any chance of write happening concurrently
with the flush - we're back to leaking the hierarchy.

We may take the lock for devices which don't support shapers but
we're only dealing with SET operations here, not taking the lock
would be optimizing for an error case.

Fixes: 93954b40f6 ("net-shapers: implement NL set and delete operations")
Link: https://lore.kernel.org/20260309173450.538026-1-p@1g4.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Link: https://patch.msgid.link/20260317161014.779569-2-kuba@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-03-19 13:47:15 +01:00
..
binder.yaml netlink: specs: binder: replace underscores with dashes in names 2025-08-21 16:49:38 +02:00
conntrack.yaml ynl: fix schema check errors 2025-11-28 19:53:20 -08: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: support default values for param-get and param-set 2025-11-20 19:01:22 -08:00
dpll.yaml dpll: expose fractional frequency offset in ppt 2026-01-29 18:21:16 -08:00
ethtool.yaml ynl: fix a yamllint warning in ethtool spec 2025-11-28 19:53:19 -08:00
fou.yaml fou: Don't allow 0 for FOU_ATTR_IPPROTO. 2026-01-17 16:00:24 -08:00
handshake.yaml net/handshake: Add new parameter 'HANDSHAKE_A_ACCEPT_KEYRING' 2025-07-08 15:31:44 +02: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: protect from late creation of hierarchy 2026-03-19 13:47:15 +01:00
netdev.yaml Revert "Merge branch 'netkit-support-for-io_uring-zero-copy-and-af_xdp'" 2026-01-20 18:06:01 -08:00
nfsd.yaml nfsd: report the requested maximum number of threads instead of number running 2026-02-24 10:27:51 -05:00
nftables.yaml ynl: fix schema check errors 2025-11-28 19:53:20 -08:00
nl80211.yaml netlink: specs: explicitly declare block scalar strings 2025-09-15 18:27:19 -07:00
nlctrl.yaml netlink: specs: clean up spaces in brackets 2025-06-11 14:01:19 -07:00
ovpn.yaml Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-07-17 11:00:33 -07: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_vport.yaml netlink: specs: explicitly declare block scalar strings 2025-09-15 18:27:19 -07:00
psp.yaml psp: add stats from psp spec to driver facing api 2025-11-07 18:53:57 -08:00
rt-addr.yaml netlink: specs: add big-endian byte-order for u32 IPv4 addresses 2025-11-26 17:14:17 -08:00
rt-link.yaml geneve: add netlink support for GRO hint 2026-01-23 11:31:14 -08:00
rt-neigh.yaml netlink: specs: support ipv4-or-v6 for dual-stack fields 2025-11-18 18:42:10 -08:00
rt-route.yaml netlink: specs: support ipv4-or-v6 for dual-stack fields 2025-11-18 18:42:10 -08:00
rt-rule.yaml netlink: specs: support ipv4-or-v6 for dual-stack fields 2025-11-18 18:42:10 -08: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