tcp: fix MSG_PEEK race check
commit35eca254c87cb5664e59da0e4ceb2a755d04c047
authorIlpo Jarvinen <ilpo.jarvinen@helsinki.fi>
Sun, 10 May 2009 20:32:34 +0000 (10 20:32 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 15 Jun 2009 16:39:50 +0000 (15 09:39 -0700)
treee577b6d0a54f81cb81e270c69027ec3a575f63ab
parentde9fbb9b8480bbcde060589621923fceb4b4a5d7
tcp: fix MSG_PEEK race check

[ Upstream commit 775273131810caa41dfc7f9e552ea5d8508caf40 ]

Commit 518a09ef11 (tcp: Fix recvmsg MSG_PEEK influence of
blocking behavior) lets the loop run longer than the race check
did previously expect, so we need to be more careful with this
check and consider the work we have been doing.

I tried my best to deal with urg hole madness too which happens
here:
if (!sock_flag(sk, SOCK_URGINLINE)) {
++*seq;
...
by using additional offset by one but I certainly have very
little interest in testing that part.

Signed-off-by: Ilpo Jarvinen <ilpo.jarvinen@helsinki.fi>
Tested-by: Frans Pop <elendil@planet.nl>
Tested-by: Ian Zimmermann <itz@buug.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/ipv4/tcp.c