]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: memset ca_priv data to 0 properly
authorWei Wang <weiwan@google.com>
Wed, 26 Apr 2017 00:38:02 +0000 (17:38 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 26 Apr 2017 18:58:32 +0000 (14:58 -0400)
commit55043d9bcf9261b37a9f13a1260c91d57c1f5103
tree15df9f7c9f473cd0ff8887653b2e01fbaebbc7e0
parent7fc43b692b81811eb6d84972656bad302ca2f4e5
tcp: memset ca_priv data to 0 properly

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: c02084a8e ("tcp: add CDG congestion control")
Reported-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Wei Wang <weiwan@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Acked-by: Yuchung Cheng <ycheng@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_cong.c