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: <Y0eqIQ9PC3Edd+D/@sol.localdomain>
Date:   Wed, 12 Oct 2022 23:03:13 -0700
From:   Eric Biggers <ebiggers@...nel.org>
To:     Robert Elliott <elliott@....com>
Cc:     herbert@...dor.apana.org.au, davem@...emloft.net,
        tim.c.chen@...ux.intel.com, ap420073@...il.com, ardb@...nel.org,
        linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 08/19] crypto: x86/ghash - limit FPU preemption

On Wed, Oct 12, 2022 at 04:59:20PM -0500, Robert Elliott wrote:
> -	kernel_fpu_begin();
> -	clmul_ghash_update(dst, src, srclen, &ctx->shash);
> -	kernel_fpu_end();
> +	while (srclen >= GHASH_BLOCK_SIZE) {
> +		unsigned int fpulen = min(srclen, FPU_BYTES);
> +
> +		kernel_fpu_begin();
> +		while (fpulen >= GHASH_BLOCK_SIZE) {
> +			int n = min_t(unsigned int, fpulen, GHASH_BLOCK_SIZE);
> +
> +			clmul_ghash_update(dst, src, n, &ctx->shash);
> +
> +			srclen -= n;
> +			fpulen -= n;
> +			src += n;
> +		}
> +		kernel_fpu_end();
> +	}

Another loop that doesn't make sense.  Why is this only passing 16 bytes at a
time into the assembly code?  There shouldn't be an inner loop here at all.

- Eric

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ