Re: [PATCH] tcp: possible race between tcp_done() and tcp_poll()

2017-03-29 Thread Seiichi Ikarashi
On 2017-03-30 12:18, Eric Dumazet wrote: > On Thu, 2017-03-30 at 11:55 +0900, Seiichi Ikarashi wrote: > >> I got a report that receiving a RST packet but poll() got only POLLERR, no >> POLLIN|POLLRDHUP . >> It was an old x86_64 kernel which does not include sk_state_{l

Re: [PATCH] tcp: possible race between tcp_done() and tcp_poll()

2017-03-29 Thread Seiichi Ikarashi
Hi Eric, On 2017-03-30 11:31, Eric Dumazet wrote: > On Thu, 2017-03-30 at 09:35 +0900, Seiichi Ikarashi wrote: >> Similar to a4d258036ed9 ("tcp: Fix race in tcp_poll"). >> >> Between receiving a packet and tcp_poll(), sk->sk_err is protected by memory >>

[PATCH] tcp: possible race between tcp_done() and tcp_poll()

2017-03-29 Thread Seiichi Ikarashi
ket. Signed-off-by: Seiichi Ikarashi --- net/ipv4/tcp.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index cf4..c8bc86e 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -456,6 +456,8 @@ unsigned int tcp_poll(struct file *file, s

Re: [PATCH] tcp: possible race between tcp_done() and tcp_poll()

2017-03-29 Thread Seiichi Ikarashi
Thanks Sergei! On 2017-03-29 20:57, Sergei Shtylyov wrote: > Hello! > > On 3/29/2017 8:22 AM, Seiichi Ikarashi wrote: > >> Similar to commit a4d258036ed9b2a1811. > >Commit citing is standardized: it should specify 12-digit (at least) SHA1 > and the comm

[PATCH] tcp: possible race between tcp_done() and tcp_poll()

2017-03-28 Thread Seiichi Ikarashi
Similar to commit a4d258036ed9b2a1811. Between receiving a packet and tcp_poll(), sk->sk_err is protected by memory barriers but sk->sk_shutdown and sk->sk_state are not. So possibly, POLLIN|POLLRDNORM|POLLRDHUP might not be set even when receiving a RST packet. Signed-off-by: Seiichi