]> git.baikalelectronics.ru Git - kernel.git/commit
inet: fix request sock refcounting
authorEric Dumazet <edumazet@google.com>
Wed, 18 Mar 2015 01:32:31 +0000 (18:32 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 18 Mar 2015 02:02:29 +0000 (22:02 -0400)
commitade4a23bc15101e05c64b5cf5791f21df60c2e80
tree798f475f48fbdff0eae359c3f345a1a0eaf83ca2
parent9c8a8b9512255d76c5b9229685a725be44ec19b5
inet: fix request sock refcounting

While testing last patch series, I found req sock refcounting was wrong.

We must set skc_refcnt to 1 for all request socks added in hashes,
but also on request sockets created by FastOpen or syncookies.

It is tricky because we need to defer this initialization so that
future RCU lookups do not try to take a refcount on a not yet
fully initialized request socket.

Also get rid of ireq_refcnt alias.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Fixes: 1289ce336f3e ("inet: add proper refcounting to request sock")
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/inet_connection_sock.h
include/net/inet_sock.h
include/net/request_sock.h
net/ipv4/syncookies.c
net/ipv4/tcp_fastopen.c
net/ipv4/tcp_input.c
net/ipv6/syncookies.c