]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tcp: fix access to sk->sk_state in tcp_poll()
authorDavide Caratti <dcaratti@redhat.com>
Wed, 26 Apr 2017 17:07:35 +0000 (19:07 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 14 May 2017 12:06:01 +0000 (14:06 +0200)
commit011fbfb296e4cfcd5769fb3f84ae2f263b1faac1
tree2cf9a32b0f09ede3637993491576d2be8995877c
parentc0e5b847c77e2b8265a5abe7f7642526f08cd51a
tcp: fix access to sk->sk_state in tcp_poll()

[ Upstream commit d68be71ea14d609a5f31534003319be5db422595 ]

avoid direct access to sk->sk_state when tcp_poll() is called on a socket
using active TCP fastopen with deferred connect. Use local variable
'state', which stores the result of sk_state_load(), like it was done in
commit 00fd38d938db ("tcp: ensure proper barriers in lockless contexts").

Fixes: 19f6d3f3c842 ("net/tcp-fastopen: Add new API support")
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
Acked-by: Wei Wang <weiwan@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv4/tcp.c