tcp: memset ca_priv data to 0 properly
Wei Wang authored
[ Upstream commit c1201444 ]

Always zero out ca_priv data in tcp_assign_congestion_control() so that
ca_priv data is cleared out during socket creation.
Also always zero out ca_priv data in tcp_reinit_congestion_control() so
that when cc algorithm is changed, ca_priv data is cleared out as well.
We should still zero out ca_priv data even in TCP_CLOSE state because
user could call connect() on AF_UNSPEC to disconnect the socket and
leave it in TCP_CLOSE state and later call setsockopt() to switch cc
algorithm on this socket.

Fixes: 2b0a8c9e

 ("tcp: add CDG congestion control")
Reported-by: default avatarAndrey Konovalov  <andreyknvl@google.com>
Signed-off-by: default avatarWei Wang <weiwan@google.com>
Acked-by: default avatarEric Dumazet <edumazet@google.com>
Acked-by: default avatarYuchung Cheng <ycheng@google.com>
Acked-by: default avatarNeal Cardwell <ncardwell@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
466dfcd1
Name Last commit Last update
..
netfilter netfilter: ipt_CLUSTERIP: fix build error without procfs
Kconfig Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Makefile net: ip, diag -- Add diag interface for raw sockets
af_inet.c net/tunnel: set inner protocol in network gro hooks
ah4.c ah4: Fix error return in ah_input().
arp.c NET: Fix /proc/net/arp for AX.25
cipso_ipv4.c netlabel: out of bound access in cipso_v4_validate()
datagram.c net: Set sk_txhash from a random number
devinet.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally
esp4.c esp4: Fix integrity verification when ESN are used
fib_frontend.c ipv4: provide stronger user input validation in nl_fib_input()
fib_lookup.h ipv4: consider TOS in fib_select_default
fib_rules.c switchdev: remove FIB offload infrastructure
fib_semantics.c net: lwtunnel: Handle lwtunnel_fill_encap failure
fib_trie.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally
fou.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
gre_demux.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
gre_offload.c net: add recursion limit to GRO
icmp.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally
igmp.c igmp, mld: Fix memory leak in igmpv3/mld_del_delrec()
inet_connection_sock.c inet: Fix get port to handle zero port number with soreuseport set
inet_diag.c tcp: no longer hold ehash lock while calling tcp_get_info()
inet_fragment.c net: disable fragment reassembly if high_thresh is zero
inet_hashtables.c net: Require exact match for TCP socket lookups if dif is l3mdev
inet_timewait_sock.c timers, net/ipv4/inet: Initialize connection request timers as pinned
inetpeer.c
ip_forward.c
ip_fragment.c
ip_gre.c
ip_input.c
ip_options.c
ip_output.c
ip_sockglue.c
ip_tunnel.c
ip_tunnel_core.c
ip_vti.c
ipcomp.c
ipconfig.c
ipip.c
ipmr.c
netfilter.c
ping.c
proc.c
protocol.c
raw.c
raw_diag.c
route.c
syncookies.c
sysctl_net_ipv4.c
tcp.c
tcp_bbr.c
tcp_bic.c
tcp_cdg.c
tcp_cong.c
tcp_cubic.c
tcp_dctcp.c
tcp_diag.c
tcp_fastopen.c
tcp_highspeed.c
tcp_htcp.c
tcp_hybla.c
tcp_illinois.c
tcp_input.c
tcp_ipv4.c
tcp_lp.c
tcp_metrics.c
tcp_minisocks.c
tcp_nv.c
tcp_offload.c
tcp_output.c
tcp_probe.c
tcp_rate.c
tcp_recovery.c
tcp_scalable.c
tcp_timer.c
tcp_vegas.c
tcp_vegas.h
tcp_veno.c
tcp_westwood.c
tcp_yeah.c
tunnel4.c
udp.c
udp_diag.c
udp_impl.h
udp_offload.c
udp_tunnel.c
udplite.c
xfrm4_input.c
xfrm4_mode_beet.c
xfrm4_mode_transport.c
xfrm4_mode_tunnel.c
xfrm4_output.c
xfrm4_policy.c
xfrm4_protocol.c
xfrm4_state.c
xfrm4_tunnel.c