netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: ard.biesheuvel@linaro.org
Cc: netdev@vger.kernel.org, ebiggers@kernel.org,
	linux-crypto@vger.kernel.org, herbert@gondor.apana.org.au,
	edumazet@google.com, kuznet@ms2.inr.ac.ru,
	yoshfuji@linux-ipv6.org, jbaron@akamai.com, cpaasch@apple.com,
	David.Laight@aculab.com, ycheng@google.com
Subject: Re: [PATCH v4 1/1] net: fastopen: robustness and endianness fixes for SipHash
Date: Sat, 22 Jun 2019 16:30:51 -0700 (PDT)	[thread overview]
Message-ID: <20190622.163051.864287952863126273.davem@davemloft.net> (raw)
In-Reply-To: <20190619214628.2960-2-ard.biesheuvel@linaro.org>

From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Date: Wed, 19 Jun 2019 23:46:28 +0200

> Some changes to the TCP fastopen code to make it more robust
> against future changes in the choice of key/cookie size, etc.
> 
> - Instead of keeping the SipHash key in an untyped u8[] buffer
>   and casting it to the right type upon use, use the correct
>   type directly. This ensures that the key will appear at the
>   correct alignment if we ever change the way these data
>   structures are allocated. (Currently, they are only allocated
>   via kmalloc so they always appear at the correct alignment)
> 
> - Use DIV_ROUND_UP when sizing the u64[] array to hold the
>   cookie, so it is always of sufficient size, even if
>   TCP_FASTOPEN_COOKIE_MAX is no longer a multiple of 8.
> 
> - Drop the 'len' parameter from the tcp_fastopen_reset_cipher()
>   function, which is no longer used.
> 
> - Add endian swabbing when setting the keys and calculating the hash,
>   to ensure that cookie values are the same for a given key and
>   source/destination address pair regardless of the endianness of
>   the server.
> 
> Note that none of these are functional changes wrt the current
> state of the code, with the exception of the swabbing, which only
> affects big endian systems.
> 
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

Applied, thank you.

      reply	other threads:[~2019-06-22 23:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-19 21:46 [PATCH v4 0/1] net: fastopen: follow-up tweaks for SipHash switch Ard Biesheuvel
2019-06-19 21:46 ` [PATCH v4 1/1] net: fastopen: robustness and endianness fixes for SipHash Ard Biesheuvel
2019-06-22 23:30   ` David Miller [this message]

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=20190622.163051.864287952863126273.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=David.Laight@aculab.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=cpaasch@apple.com \
    --cc=ebiggers@kernel.org \
    --cc=edumazet@google.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=jbaron@akamai.com \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=linux-crypto@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=ycheng@google.com \
    --cc=yoshfuji@linux-ipv6.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).