Xin Long
df80cd9b28
sctp: do not peel off an assoc from one netns to another one
...
Now when peeling off an association to the sock in another netns, all
transports in this assoc are not to be rehashed and keep use the old
key in hashtable.
As a transport uses sk->net as the hash key to insert into hashtable,
it would miss removing these transports from hashtable due to the new
netns when closing the sock and all transports are being freeed, then
later an use-after-free issue could be caused when looking up an asoc
and dereferencing those transports.
This is a very old issue since very beginning, ChunYu found it with
syzkaller fuzz testing with this series:
socket$inet6_sctp()
bind$inet6()
sendto$inet6()
unshare(0x40000000)
getsockopt$inet_sctp6_SCTP_GET_ASSOC_ID_LIST()
getsockopt$inet_sctp6_SCTP_SOCKOPT_PEELOFF()
This patch is to block this call when peeling one assoc off from one
netns to another one, so that the netns of all transport would not
go out-sync with the key in hashtable.
Note that this patch didn't fix it by rehashing transports, as it's
difficult to handle the situation when the tuple is already in use
in the new netns. Besides, no one would like to peel off one assoc
to another netns, considering ipaddrs, ifaces, etc. are usually
different.
Reported-by: ChunYu Wang <[email protected] >
Signed-off-by: Xin Long <[email protected] >
Acked-by: Marcelo Ricardo Leitner <[email protected] >
Acked-by: Neil Horman <[email protected] >
Signed-off-by: David S. Miller <[email protected] >
2017-10-19 13:16:07 +01:00
..
6lowpan
9p
net/9p: switch p9_fd_read to kernel_write
2017-09-04 19:05:16 -04:00
802
8021q
net: 8021q: skip packets if the vlan is down
2017-10-04 18:16:48 -07:00
appletalk
atm
net: atm: make atmdev_ops const
2017-08-09 22:43:50 -07:00
ax25
batman-adv
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
2017-08-09 16:28:45 -07:00
bluetooth
Revert "Bluetooth: Add option for disabling legacy ioctl interfaces"
2017-09-28 13:20:32 -07:00
bpf
bridge
netfilter: ebtables: fix race condition in frame_filter_net_init()
2017-09-29 13:36:06 +02:00
caif
can
rtnetlink: make rtnl_register accept a flags parameter
2017-08-09 16:57:38 -07:00
ceph
libceph: don't allow bidirectional swap of pg-upmap-items
2017-09-19 20:34:29 +02:00
core
dev_ioctl: add missing NETDEV_CHANGE_TX_QUEUE_LEN event notification
2017-10-16 21:23:10 +01:00
dcb
rtnetlink: make rtnl_register accept a flags parameter
2017-08-09 16:57:38 -07:00
dccp
net: dccp: Add handling of IPV6_PKTOPTIONS to dccp_v6_do_rcv()
2017-08-31 11:43:47 -07:00
decnet
Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next
2017-09-03 17:08:42 -07:00
dns_resolver
dsa
net: dsa: Fix network device registration order
2017-09-28 10:12:53 -07:00
ethernet
hsr
net/hsr: Check skb_put_padto() return value
2017-08-22 13:40:23 -07:00
ieee802154
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
2017-09-05 20:03:35 -07:00
ife
ipv4
ip: update policy routing config help
2017-10-12 22:57:11 -07:00
ipv6
Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf
2017-10-09 10:39:52 -07:00
ipx
iucv
kcm
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
2017-09-01 17:42:05 -07:00
key
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
2017-08-15 20:23:23 -07:00
l2tp
l2tp: check ps->sock before running pppol2tp_session_ioctl()
2017-10-14 18:38:56 -07:00
l3mdev
lapb
llc
mac80211
mac80211: accept key reinstall without changing anything
2017-10-16 13:02:03 +02:00
mac802154
mpls
rtnetlink: make rtnl_register accept a flags parameter
2017-08-09 16:57:38 -07:00
ncsi
net/ncsi: Don't limit vids based on hot_channel
2017-10-11 20:10:37 -07:00
netfilter
netfilter: xt_bpf: Fix XT_BPF_MODE_FD_PINNED mode of 'xt_bpf_info_v1'
2017-10-09 15:18:04 +02:00
netlabel
netlink
netlink: fix netlink_ack() extack race
2017-10-18 12:22:28 +01:00
netrom
nfc
nsh
nsh: add GSO support
2017-08-29 15:16:52 -07:00
openvswitch
openvswitch: Fix an error handling path in 'ovs_nla_init_match_and_action()'
2017-09-12 20:37:31 -07:00
packet
packet: only test po->has_vnet_hdr once in packet_snd
2017-09-28 10:24:31 -07:00
phonet
rtnetlink: make rtnl_register accept a flags parameter
2017-08-09 16:57:38 -07:00
psample
qrtr
rtnetlink: make rtnl_register accept a flags parameter
2017-08-09 16:57:38 -07:00
rds
rds: Fix incorrect statistics counting
2017-09-07 20:07:13 -07:00
rfkill
rose
rxrpc
rxrpc: Make service connection lookup always check for retry
2017-09-05 14:39:17 -07:00
sched
net/sched: cls_flower: Set egress_dev mark when calling into the HW driver
2017-10-16 21:18:59 +01:00
sctp
sctp: do not peel off an assoc from one netns to another one
2017-10-19 13:16:07 +01:00
smc
net/smc: no close wait in case of process shut down
2017-09-21 15:31:03 -07:00
strparser
strparser: initialize all callbacks
2017-08-24 21:57:50 -07:00
sunrpc
sunrpc: remove redundant initialization of sock
2017-10-01 18:51:30 -04:00
switchdev
net: switchdev: Remove bridge bypass support from switchdev
2017-08-07 14:48:48 -07:00
tipc
tipc: Unclone message at secondary destination lookup
2017-10-08 21:13:23 -07:00
tls
tls: make tls_sw_free_resources static
2017-09-14 09:55:21 -07:00
unix
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
2017-08-21 17:06:42 -07:00
vmw_vsock
hv_sock: implements Hyper-V transport for Virtual Sockets (AF_VSOCK)
2017-08-28 15:38:18 -07:00
wimax
wireless
nl80211: Define policy for packet pattern attributes
2017-10-04 14:39:21 +02:00
x25
xfrm
xfrm: don't call xfrm_policy_cache_flush under xfrm_state_lock
2017-09-28 09:39:05 +02:00
compat.c
net: compat: assert the size of cmsg copied in is as expected
2017-09-20 15:36:18 -07:00
Kconfig
net: Remove CONFIG_NETFILTER_DEBUG and _ASSERT() macros.
2017-09-04 13:25:20 +02:00
Makefile
nsh: add GSO support
2017-08-29 15:16:52 -07:00
socket.c
net: fixes for skb_send_sock
2017-08-16 11:27:52 -07:00
sysctl_net.c