]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: randomize tcp timestamp offsets for each connection
authorFlorian Westphal <fw@strlen.de>
Thu, 1 Dec 2016 10:32:06 +0000 (11:32 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 2 Dec 2016 17:49:59 +0000 (12:49 -0500)
commit6d22703b350fdc23377aecc8092051a80d01b070
treeba58ca9c85a73dc887096d8123d199b3d28a705c
parent485bf17a0b1f574880b8a15c7fdc38e1cac0e09e
tcp: randomize tcp timestamp offsets for each connection

jiffies based timestamps allow for easy inference of number of devices
behind NAT translators and also makes tracking of hosts simpler.

commit 7072c2419efaa0d ("tcp: adding a per-socket timestamp offset")
added the main infrastructure that is needed for per-connection ts
randomization, in particular writing/reading the on-wire tcp header
format takes the offset into account so rest of stack can use normal
tcp_time_stamp (jiffies).

So only two items are left:
 - add a tsoffset for request sockets
 - extend the tcp isn generator to also return another 32bit number
   in addition to the ISN.

Re-use of ISN generator also means timestamps are still monotonically
increasing for same connection quadruple, i.e. PAWS will still work.

Includes fixes from Eric Dumazet.

Signed-off-by: Florian Westphal <fw@strlen.de>
Acked-by: Eric Dumazet <edumazet@google.com>
Acked-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/tcp.h
include/net/secure_seq.h
include/net/tcp.h
net/core/secure_seq.c
net/ipv4/syncookies.c
net/ipv4/tcp_input.c
net/ipv4/tcp_ipv4.c
net/ipv4/tcp_minisocks.c
net/ipv4/tcp_output.c
net/ipv6/syncookies.c
net/ipv6/tcp_ipv6.c