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
| ||
|
Date: Thu, 13 Oct 2022 22:41:58 +0000 From: "Elliott, Robert (Servers)" <elliott@....com> To: Eric Biggers <ebiggers@...nel.org> CC: "herbert@...dor.apana.org.au" <herbert@...dor.apana.org.au>, "davem@...emloft.net" <davem@...emloft.net>, "tim.c.chen@...ux.intel.com" <tim.c.chen@...ux.intel.com>, "ap420073@...il.com" <ap420073@...il.com>, "ardb@...nel.org" <ardb@...nel.org>, "linux-crypto@...r.kernel.org" <linux-crypto@...r.kernel.org>, "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org> Subject: RE: :Re: [PATCH v2 04/19] crypto: x86/sha - limit FPU preemption > > diff --git a/arch/x86/crypto/sha1_ssse3_glue.c ... > > + do { > > + unsigned int chunk = min(len, FPU_BYTES); > > + > > + if (chunk) { > > + kernel_fpu_begin(); > > + sha1_base_do_update(desc, data, chunk, sha1_xform); > > + kernel_fpu_end(); > > + } > > + > > + len -= chunk; > > + data += chunk; > > + } while (len); > > 'len' can't be 0 at the beginning of this loop, so the 'if (chunk)' check > isn't needed. And it wouldn't make sense even if 'len' could be 0, since > a while loop could just be used in that case. Thanks, I'll remove that if from all the sha functions, since they do have that protective check upfront. I'll review the 0 byte handling in all of them.
Powered by blists - more mailing lists