]> 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, 22 Nov 2010 19:00:12 +0000 (11:00 -0800)
commit4ba3d9baf1ebfb97ea04384e8b2775744b341268
treeed373768cdcdf028a98d4cd9c8862eb73557a026
parent56b8700a1069f66ace7575b9cd104f626379f8cd
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