WSL2-Linux-Kernel/net
Willem de Bruijn d51cd648db ipv6: per-netns exclusive flowlabel checks
commit 0b0dff5b3b upstream.

Ipv6 flowlabels historically require a reservation before use.
Optionally in exclusive mode (e.g., user-private).

Commit 59c820b231 ("ipv6: elide flowlabel check if no exclusive
leases exist") introduced a fastpath that avoids this check when no
exclusive leases exist in the system, and thus any flowlabel use
will be granted.

That allows skipping the control operation to reserve a flowlabel
entirely. Though with a warning if the fast path fails:

  This is an optimization. Robust applications still have to revert to
  requesting leases if the fast path fails due to an exclusive lease.

Still, this is subtle. Better isolate network namespaces from each
other. Flowlabels are per-netns. Also record per-netns whether
exclusive leases are in use. Then behavior does not change based on
activity in other netns.

Changes
  v2
    - wrap in IS_ENABLED(CONFIG_IPV6) to avoid breakage if disabled

Fixes: 59c820b231 ("ipv6: elide flowlabel check if no exclusive leases exist")
Link: https://lore.kernel.org/netdev/MWHPR2201MB1072BCCCFCE779E4094837ACD0329@MWHPR2201MB1072.namprd22.prod.outlook.com/
Reported-by: Congyu Liu <liu3101@purdue.edu>
Signed-off-by: Willem de Bruijn <willemb@google.com>
Tested-by: Congyu Liu <liu3101@purdue.edu>
Link: https://lore.kernel.org/r/20220215160037.1976072-1-willemdebruijn.kernel@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-23 12:03:10 +01:00
..
6lowpan
9p 9p/net: fix missing error check in p9_check_errors 2021-11-18 19:17:16 +01:00
802
8021q net: vlan: fix underflow for the real_dev refcnt 2021-12-01 09:04:53 +01:00
appletalk
atm
ax25 ax25: improve the incomplete fix to avoid UAF and NPD bugs 2022-02-23 12:03:05 +01:00
batman-adv batman-adv: allow netlink usage in unprivileged containers 2022-01-27 11:04:25 +01:00
bluetooth Bluetooth: refactor malicious adv data check 2022-02-01 17:27:14 +01:00
bpf
bpfilter
bridge netfilter: nft_reject_bridge: Fix for missing reply from prerouting 2022-02-08 18:34:08 +01:00
caif
can can: isotp: fix error path in isotp_sendmsg() to unlock wait queue 2022-02-16 12:56:05 +01:00
ceph
core rtnetlink: make sure to refresh master_dev/m_ops in __rtnl_newlink() 2022-02-05 12:38:59 +01:00
dcb
dccp tcp: switch orphan_count to bare per-cpu counters 2021-11-18 19:16:33 +01:00
decnet
dns_resolver
dsa net: dsa: fix incorrect function pointer check for MRP ring roles 2022-01-27 11:03:50 +01:00
ethernet
ethtool ethtool: do not perform operations on net devices being unregistered 2021-12-14 10:57:09 +01:00
hsr
ieee802154 net: ieee802154: Return meaningful error codes from the netlink helpers 2022-02-08 18:34:09 +01:00
ife
ipv4 ipv4: fix data races in fib_alias_hw_flags_set 2022-02-23 12:03:10 +01:00
ipv6 ipv6: per-netns exclusive flowlabel checks 2022-02-23 12:03:10 +01:00
iucv
kcm
key
l2tp
l3mdev
lapb
llc
mac80211 mac80211: allow non-standard VHT MCS-10/11 2022-01-27 11:04:52 +01:00
mac802154
mctp mctp: Don't let RTM_DELROUTE delete local routes 2021-12-08 09:04:53 +01:00
mpls net: mpls: Fix notifications when deleting a device 2021-12-08 09:04:47 +01:00
mptcp mptcp: netlink: process IPv6 addrs in creating listening sockets 2022-02-16 12:56:31 +01:00
ncsi net/ncsi: check for error return from call to nla_put_u32 2022-01-05 12:42:37 +01:00
netfilter netfilter: nft_synproxy: unregister hooks on init error path 2022-02-23 12:03:10 +01:00
netlabel
netlink net: netlink: af_netlink: Prevent empty skb by adding a check on len. 2021-12-17 10:30:15 +01:00
netrom netrom: fix api breakage in nr_setsockopt() 2022-01-27 11:04:00 +01:00
nfc nfc: llcp: fix NULL error pointer dereference on sendmsg() after failed bind() 2022-01-27 11:02:48 +01:00
nsh
openvswitch net: openvswitch: Fix ct_state nat flags for conns arriving from tc 2022-01-27 11:04:02 +01:00
packet af_packet: fix data-race in packet_setsockopt / packet_setsockopt 2022-02-05 12:38:59 +01:00
phonet phonet: refcount leak in pep_sock_accep 2022-01-11 15:35:16 +01:00
psample
qrtr
rds rds: memory leak in __rds_conn_create() 2021-12-22 09:32:42 +01:00
rfkill
rose
rxrpc rxrpc: Adjust retransmission backoff 2022-02-01 17:27:11 +01:00
sched net: sched: Clarify error message when qdisc kind is unknown 2022-02-16 12:56:12 +01:00
sctp sctp: hold endpoint before calling cb in sctp_transport_lookup_process 2022-01-11 15:35:14 +01:00
smc net/smc: Forward wakeup to smc socket waitqueue after fallback 2022-02-08 18:34:09 +01:00
strparser bpf: sockmap, strparser, and tls are reusing qdisc_skb_cb and colliding 2021-11-18 19:17:11 +01:00
sunrpc sunrpc: Fix potential race conditions in rpc_sysfs_xprt_state_change() 2022-02-16 12:56:10 +01:00
switchdev
tipc tipc: rate limit warning for received illegal binding update 2022-02-16 12:56:30 +01:00
tls net/tls: Fix authentication failure in CCM mode 2021-12-08 09:04:41 +01:00
unix af_unix: annote lockless accesses to unix_tot_inflight & gc_in_progress 2022-01-27 11:05:30 +01:00
vmw_vsock vsock: remove vsock from connected table when connect is interrupted by a signal 2022-02-23 12:03:09 +01:00
wireless cfg80211: Acquire wiphy mutex on regulatory work 2021-12-22 09:32:42 +01:00
x25
xdp Revert "xsk: Do not sleep in poll() when need_wakeup set" 2021-12-22 09:32:51 +01:00
xfrm xfrm: Don't accidentally set RTO_ONLINK in decode_session4() 2022-01-27 11:05:36 +01:00
Kconfig
Makefile
compat.c
devres.c
socket.c net: fix SOF_TIMESTAMPING_BIND_PHC to work with multiple sockets 2022-01-27 11:03:52 +01:00
sysctl_net.c