From: Florian Westphal <fw@strlen.de>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Florian Westphal <fw@strlen.de>, netdev@vger.kernel.org
Subject: Re: [RFC 1/3] tcp: randomize tcp timestamp offsets for each connection
Date: Thu, 25 Aug 2016 11:06:02 +0200 [thread overview]
Message-ID: <20160825090602.GA30509@breakpoint.cc> (raw)
In-Reply-To: <1471537092.29842.62.camel@edumazet-glaptop3.roam.corp.google.com>
Eric Dumazet <eric.dumazet@gmail.com> wrote:
> On Thu, 2016-08-18 at 14:48 +0200, Florian Westphal wrote:
> > commit ceaa1fef65a7c2e ("tcp: adding a per-socket timestamp offset")
> > added the main infrastructure that is needed for per-connection
> > 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 like the idea, but the implementation looks a bit complex.
>
> Instead of initializing tsoffset to 0, we could simply use
>
> jhash(src_addr, dst_addr, boot_time_rnd)
>
> This way, even syncookies would be handled, and we do not need to
> increase tcp_request_sock size.
So I gave this a try and it does avoid this tcp_request_sock increase,
but I feel that getting boot_time_rnd is too easy.
I tried a few other ideas but nothing satisfying/simpler came out of it
(e.g. i tried to also hash the isn but that gets scaled w. current
clock so it doesn't work).
Are you more concerned wrt. complexity or the reqsk increase?
One could use tfo boolean padding in the struct to avoid size increase
(1 bit tfo_listener, 31 for tsoff).
I would then split this patch in two (one to add tsoff to reqsk, one
to add the randomization).
The only other alternative I see is to eat 2nd md5_transform and
add a tso_offset function to secure_seq.c -- but I don't like that
either.
Any other idea?
next prev parent reply other threads:[~2016-08-25 9:06 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-18 12:48 [RFC 0/3] tcp: increase resilence vs. blind data injection Florian Westphal
2016-08-18 12:48 ` [RFC 1/3] tcp: randomize tcp timestamp offsets for each connection Florian Westphal
2016-08-18 16:18 ` Eric Dumazet
2016-08-18 22:32 ` Florian Westphal
2016-08-25 9:06 ` Florian Westphal [this message]
2016-08-25 14:15 ` Eric Dumazet
2016-08-25 14:49 ` Florian Westphal
2016-08-25 16:05 ` Eric Dumazet
2016-08-25 19:34 ` Eric Dumazet
2016-08-25 20:31 ` Florian Westphal
2016-08-25 21:06 ` Eric Dumazet
2016-08-25 22:06 ` Eric Dumazet
2016-08-25 23:46 ` Florian Westphal
2016-08-26 2:34 ` Eric Dumazet
2016-08-18 12:48 ` [RFC 2/3] tcp: add tcp_timestamps=2 mode to force tsecr validation on ofo segments Florian Westphal
2016-08-18 12:48 ` [RFC 3/3] tcp: add mib counter to track ts tsecr validation failures Florian Westphal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160825090602.GA30509@breakpoint.cc \
--to=fw@strlen.de \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).