mint0x33/net
Marcelo Ricardo Leitner cfc370cb72 sctp: fix possibly using a bad saddr with a given dst
[ Upstream commit 582eea230536a6f104097dd46205822005d5fe3a ]

Under certain circumstances, depending on the order of addresses on the
interfaces, it could be that sctp_v[46]_get_dst() would return a dst
with a mismatched struct flowi.

For example, if when walking through the bind addresses and the first
one is not a match, it saves the dst as a fallback (added in
410f03831c), but not the flowi. Then if the next one is also not a
match, the previous dst will be returned but with the flowi information
for the 2nd address, which is wrong.

The fix is to use a locally stored flowi that can be used for such
attempts, and copy it to the parameter only in case it is a possible
match, together with the corresponding dst entry.

The patch updates IPv6 code mostly just to be in sync. Even though the issue
is also present there, it fallback is not expected to work with IPv6.

Fixes: 410f03831c ("sctp: add routing output fallback")
Reported-by: Jin Meng <meng.a.jin@nokia-sbell.com>
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Tested-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 10:34:18 +02:00
..
6lowpan 6lowpan: Off by one handling ->nexthdr 2020-01-27 14:46:30 +01:00
9p
802
8021q vlan: fix memory leak in vlan_dev_set_egress_priority 2020-01-12 12:12:09 +01:00
appletalk appletalk: Set error code if register_snap_client failed 2019-12-17 20:38:59 +01:00
atm net: use skb_queue_empty_lockless() in poll() handlers 2019-11-10 11:25:34 +01:00
ax25
batman-adv batman-adv: Don't schedule OGM for disabled interface 2020-03-20 10:54:23 +01:00
bluetooth Bluetooth: Fix race condition in hci_release_sock() 2020-02-05 14:18:16 +00:00
bpf
bridge netfilter: ebtables: CONFIG_COMPAT: reject trailing data after last rule 2020-01-27 14:46:34 +01:00
caif net: use skb_queue_empty_lockless() in poll() handlers 2019-11-10 11:25:34 +01:00
can
ceph
core net: memcg: late association of sock to memcg 2020-03-20 10:54:09 +01:00
dcb
dccp dccp: Fix memleak in __feat_register_sp 2020-01-17 19:45:43 +01:00
decnet net: add bool confirm_neigh parameter for dst_ops.update_pmtu 2020-01-04 14:00:14 +01:00
dns_resolver
dsa net: dsa: Fix duplicate frames flooded by learning 2020-04-02 16:34:24 +02:00
ethernet net: add annotations on hh->hh_len lockless accesses 2020-01-09 10:17:59 +01:00
hsr hsr: set .netnsok flag 2020-04-02 16:34:26 +02:00
ieee802154 nl802154: add missing attribute validation for dev_type 2020-03-20 10:54:10 +01:00
ife
ipv4 net, ip_tunnel: fix interface lookup with no key 2020-04-13 10:34:14 +02:00
ipv6 vti6: Fix memory leak of skb if input policy check fails 2020-04-02 16:34:32 +02:00
ipx
iucv net/af_iucv: always register net_device notifier 2020-01-27 14:46:38 +01:00
kcm
key
l2tp l2tp: Allow duplicate session creation with UDP 2020-02-14 16:32:06 -05:00
l3mdev
lapb
llc llc: fix sk_buff refcounting in llc_conn_state_process() 2020-01-27 14:46:49 +01:00
mac80211 mac80211: fix authentication with iwlwifi/mvm 2020-04-02 16:34:36 +02:00
mac802154
mpls mpls: fix warning with multi-label encap 2020-01-27 14:46:37 +01:00
ncsi
netfilter netfilter: nft_fwd_netdev: validate family and chain type 2020-04-02 16:34:32 +02:00
netlabel
netlink netlink: Use netlink header as base to calculate bad attribute offset 2020-03-20 10:54:07 +01:00
netrom
nfc nfc: add missing attribute validation for vendor subcommand 2020-03-20 10:54:12 +01:00
nsh
openvswitch openvswitch: support asymmetric conntrack 2019-12-21 10:47:34 +01:00
packet net/packet: tpacket_rcv: avoid a producer race condition 2020-04-02 16:34:24 +02:00
phonet net: use skb_queue_empty_lockless() in poll() handlers 2019-11-10 11:25:34 +01:00
psample net: psample: fix skb_over_panic 2019-12-05 15:38:15 +01:00
qrtr
rds net/rds: Fix 'ib_evt_handler_call' element in 'rds_ib_stat_names' 2020-01-27 14:46:47 +01:00
rfkill rfkill: Fix incorrect check to avoid NULL pointer dereference 2020-01-12 12:11:57 +01:00
rose
rxrpc rxrpc: Fix service call disconnection 2020-02-14 16:32:21 -05:00
sched net_sched: keep alloc_hash updated after hash allocation 2020-04-02 16:34:24 +02:00
sctp sctp: fix possibly using a bad saddr with a given dst 2020-04-13 10:34:18 +02:00
smc net/smc: check for valid ib_client_data 2020-03-20 10:54:20 +01:00
strparser
sunrpc sunrpc: expiry_time should be seconds not timeval 2020-02-14 16:32:15 -05:00
switchdev
tipc tipc: reduce risk of wakeup queue starvation 2020-01-27 14:46:41 +01:00
tls
unix af_unix: add compat_ioctl support 2020-01-17 19:45:49 +01:00
vmw_vsock hv_sock: Remove the accept port restriction 2020-02-14 16:32:21 -05:00
wimax
wireless cfg80211: check reg_rule for NULL in handle_channel_custom() 2020-03-20 10:54:24 +01:00
x25 net/x25: fix nonblocking connect 2020-01-29 15:02:39 +01:00
xfrm xfrm: policy: Fix doulbe free in xfrm_policy_timer 2020-04-02 16:34:32 +02:00
compat.c
Kconfig
Makefile
socket.c compat_ioctl: handle SIOCOUTQNSD 2020-01-17 19:45:49 +01:00
sysctl_net.c