public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: <netdev@vger.kernel.org>
Subject: Re: Question with secure_ipv4_port_ephemeral() implementation
Date: Sun, 22 Apr 2012 04:29:53 +0100	[thread overview]
Message-ID: <1335065393.3209.361.camel@deadeye> (raw)
In-Reply-To: <201204202130.IJF95312.tQJFLMFOFSVHOO@I-love.SAKURA.ne.jp>

On Fri, 2012-04-20 at 21:30 +0900, Tetsuo Handa wrote:
> Commit 6e5714ea "net: Compute protocol sequence numbers and fragment IDs using
> MD5." removed periodic get_random_bytes() calls. After that commit,
> 
>   static u32 net_secret[MD5_MESSAGE_BYTES / 4] ____cacheline_aligned;
> 
> is filled with random bytes for only once upon boot and is never updated again.
> Then, shouldn't net_secret be marked as __read_mostly?
> 
> Just from curiosity... what was the reason for changing
> secure_ipv4_port_ephemeral() generate same return value for same arguments?
> Was periodically changing return value for same arguments unfriendly with NAT
> or something?

The commit message says:

> Furthermore, only having 24-bits of the sequence number be truly
> unpredictable is a very serious limitation.  So the periodic
> regeneration and 8-bit counter have been removed.  We compute and
> use a full 32-bit sequence number.

As I understand it, that 8-bit counter was used for all connections, so
in order to spoof the source of a TCP connection it was only necessary
to guess 24 bits of the ISN.  On a sufficiently fast network, it would
now be feasible to carry out a brute force attack that ACKs all possible
ISNs before the handshake times-out.  That's not yet feasible if the
attacker has to guess all 32 bits of the ISN.

The original reason for periodically regenerating the secret was that
the hash function was quite weak and the secret could presumably be
found in a reasonably short time.  So, without regeneration, the hash
also has to be stronger.

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

  reply	other threads:[~2012-04-22  3:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-20 12:30 Question with secure_ipv4_port_ephemeral() implementation Tetsuo Handa
2012-04-22  3:29 ` Ben Hutchings [this message]
2012-04-22  5:20   ` Tetsuo Handa
2012-04-22 14:21     ` Ben Hutchings
2012-04-22 14:38       ` Tetsuo Handa

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=1335065393.3209.361.camel@deadeye \
    --to=bhutchings@solarflare.com \
    --cc=netdev@vger.kernel.org \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    /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