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] [day] [month] [year] [list]
Message-ID: <20250207035750.GA43210@sol.localdomain>
Date: Thu, 6 Feb 2025 19:57:50 -0800
From: Eric Biggers <ebiggers@...nel.org>
To: Mustafa Ismail <mustafa.ismail@...el.com>,
	Tatyana Nikolova <tatyana.e.nikolova@...el.com>,
	Jason Gunthorpe <jgg@...pe.ca>, Leon Romanovsky <leon@...nel.org>,
	linux-rdma@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] RDMA/irdma: switch to using the crc32c library

On Thu, Feb 06, 2025 at 07:36:43PM -0800, Eric Biggers wrote:
> +int irdma_ieq_check_mpacrc(const void *addr, u32 len, u32 val)
>  {
> -	u32 crc = 0;
> -
> -	crypto_shash_digest(desc, addr, len, (u8 *)&crc);
> -	if (crc != val)
> +	if (~crc32c(~0, addr, len) != val)
>  		return -EINVAL;
>  
>  	return 0;
>  }

Sorry, I just realized this isn't actually equivalent on big endian CPUs, since
the byte array produced by crypto_shash_digest() used little endian byte order,
whereas crc32c() just returns a CPU endian value.

And of course this broken subsystem uses u32 for the little endian values
instead of __le32 like the result of the kernel.

Not sure it's worth my time to continue to try to fix this subsystem properly.

- Eric

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ