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]
Message-ID: <zjzuypgma6p5dme5dh4iyh6a3km6qhsydelubdf2jvbsykyywf@4incsw36xqxh>
Date: Sun, 15 Jun 2025 21:23:00 -0400
From: Kent Overstreet <kent.overstreet@...ux.dev>
To: Eric Biggers <ebiggers@...nel.org>
Cc: linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org, 
	linux-arm-kernel@...ts.infradead.org, "Jason A . Donenfeld " <Jason@...c4.com>, 
	Ard Biesheuvel <ardb@...nel.org>
Subject: Re: [PATCH] lib/crypto/poly1305: Fix arm64's poly1305_blocks_arch()

On Sun, Jun 15, 2025 at 06:06:54PM -0700, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@...gle.com>
> 
> For some reason arm64's Poly1305 code got changed to ignore the padbit
> argument.  As a result, the output is incorrect when the message length
> is not a multiple of 16 (which is not reached with the standard
> ChaCha20Poly1305, but bcachefs could reach this).  Fix this.
> 
> Fixes: a59e5468a921 ("crypto: arm64/poly1305 - Add block-only interface")
> Reported-by: Kent Overstreet <kent.overstreet@...ux.dev>
> Signed-off-by: Eric Biggers <ebiggers@...gle.com>

Thanks for the quick fix :)

Tested-by: Kent Overstreet <kent.overstreet@...ux.dev>

> ---
>  arch/arm64/lib/crypto/poly1305-glue.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/lib/crypto/poly1305-glue.c b/arch/arm64/lib/crypto/poly1305-glue.c
> index 6a661cf048213..c9a74766785bd 100644
> --- a/arch/arm64/lib/crypto/poly1305-glue.c
> +++ b/arch/arm64/lib/crypto/poly1305-glue.c
> @@ -36,18 +36,18 @@ void poly1305_blocks_arch(struct poly1305_block_state *state, const u8 *src,
>  	if (static_branch_likely(&have_neon)) {
>  		do {
>  			unsigned int todo = min_t(unsigned int, len, SZ_4K);
>  
>  			kernel_neon_begin();
> -			poly1305_blocks_neon(state, src, todo, 1);
> +			poly1305_blocks_neon(state, src, todo, padbit);
>  			kernel_neon_end();
>  
>  			len -= todo;
>  			src += todo;
>  		} while (len);
>  	} else
> -		poly1305_blocks(state, src, len, 1);
> +		poly1305_blocks(state, src, len, padbit);
>  }
>  EXPORT_SYMBOL_GPL(poly1305_blocks_arch);
>  
>  bool poly1305_is_arch_optimized(void)
>  {
> 
> base-commit: 19272b37aa4f83ca52bdf9c16d5d81bdd1354494
> -- 
> 2.49.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ