lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 19 Jun 2019 10:25:39 -0700
From:   Eric Biggers <ebiggers@...nel.org>
To:     Ard Biesheuvel <ard.biesheuvel@...aro.org>
Cc:     netdev@...r.kernel.org, linux-crypto@...r.kernel.org,
        herbert@...dor.apana.org.au, edumazet@...gle.com,
        davem@...emloft.net, kuznet@....inr.ac.ru, yoshfuji@...ux-ipv6.org,
        jbaron@...mai.com, cpaasch@...le.com, David.Laight@...lab.com,
        ycheng@...gle.com
Subject: Re: [PATCH net-next v2 1/1] net: fastopen: robustness and endianness
 fixes for SipHash

On Wed, Jun 19, 2019 at 08:55:10AM +0200, Ard Biesheuvel wrote:
>  int tcp_fastopen_reset_cipher(struct net *net, struct sock *sk,
> -			      void *primary_key, void *backup_key,
> -			      unsigned int len)
> +			      void *primary_key, void *backup_key)
>  {
>  	struct tcp_fastopen_context *ctx, *octx;
>  	struct fastopen_queue *q;
> @@ -81,9 +79,15 @@ int tcp_fastopen_reset_cipher(struct net *net, struct sock *sk,
>  		goto out;
>  	}
>  
> -	memcpy(ctx->key[0], primary_key, len);
> +	ctx->key[0] = (siphash_key_t){
> +		get_unaligned_le64(primary_key),
> +		get_unaligned_le64(primary_key + 8)
> +	};
>  	if (backup_key) {
> -		memcpy(ctx->key[1], backup_key, len);
> +		ctx->key[1] = (siphash_key_t){
> +			get_unaligned_le64(backup_key),
> +			get_unaligned_le64(backup_key + 8)
> +		};
>  		ctx->num = 2;
>  	} else {
>  		ctx->num = 1;

These initializers are missing a level of braces.

Otherwise this patch looks good to me.

net/ipv4/tcp_fastopen.c: In function ‘tcp_fastopen_reset_cipher’:
net/ipv4/tcp_fastopen.c:82:16: warning: missing braces around initializer [-Wmissing-braces]
  ctx->key[0] = (siphash_key_t){
                ^
   get_unaligned_le64(primary_key),
   {
net/ipv4/tcp_fastopen.c:85:2:
  };
  }
net/ipv4/tcp_fastopen.c:87:17: warning: missing braces around initializer [-Wmissing-braces]
   ctx->key[1] = (siphash_key_t){
                 ^
    get_unaligned_le64(backup_key),
    {
net/ipv4/tcp_fastopen.c:90:3:
   };
   }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ