]> git.karo-electronics.de Git - karo-tx-linux.git/commit
tcp: Fix race in tcp_poll
authorTom Marshall <tdm.code@gmail.com>
Mon, 20 Sep 2010 22:42:05 +0000 (15:42 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 21 Mar 2011 19:43:22 +0000 (12:43 -0700)
commita9108eedb9f2831904f9cb1250aabd4e3413fb02
treef79f0b597314c5c31278229f3d6c0d30971d84ce
parentbb9ec4584b3afa1ab0a9b8d6060fe08a3290ea4d
tcp: Fix race in tcp_poll

[ Upstream commit a4d258036ed9b2a1811c3670c6099203a0f284a0 ]

If a RST comes in immediately after checking sk->sk_err, tcp_poll will
return POLLIN but not POLLOUT.  Fix this by checking sk->sk_err at the end
of tcp_poll.  Additionally, ensure the correct order of operations on SMP
machines with memory barriers.

Signed-off-by: Tom Marshall <tdm.code@gmail.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/ipv4/tcp.c
net/ipv4/tcp_input.c