Re: [PATCH 1/2] crypto: DH - update test for public key verification

2018-07-19 Thread Herbert Xu
On Wed, Jul 11, 2018 at 08:35:49PM +0200, Stephan Müller wrote: > By adding a zero byte-length for the DH parameter Q value, the public > key verification test is disabled for the given test. > > Reported-by: Eric Biggers > Signed-off-by: Stephan Mueller Patch applied. Thanks. -- Email: Herbe

Re: [PATCH] crypto: sharah: Unregister correct algorithms for SAHARA 3

2018-07-19 Thread Herbert Xu
On Sun, Jul 15, 2018 at 12:27:06AM +0200, Michael Müller wrote: > This patch fixes two typos related to unregistering algorithms supported by > SAHARAH 3. In sahara_register_algs the wrong algorithms are unregistered > in case of an error. In sahara_unregister_algs the wrong array is used to > dete

Re: [PATCH 2/2] crypto: ECDH - fix typo of P-192 b value

2018-07-19 Thread Herbert Xu
On Wed, Jul 11, 2018 at 08:36:23PM +0200, Stephan Müller wrote: > Fix the b value to be compliant with FIPS 186-4 D.1.2.1. This fix is > required to make sure the SP800-56A public key test passes for P-192. > > Signed-off-by: Stephan Mueller Patch applied. Thanks. -- Email: Herbert Xu Home Pa

Re: [PATCH 2/2] crypto: DRBG - use caller buffer if suitable

2018-07-19 Thread Herbert Xu
On Fri, Jul 20, 2018 at 07:09:05AM +0200, Stephan Mueller wrote: > > Maybe I have a different understanding of how such interface should look like. > > Can you give me some more detail on how you envision such virtual address > interface should work? It should look like shash. Cheers, -- Email

Re: [PATCH 2/2] crypto: DRBG - use caller buffer if suitable

2018-07-19 Thread Herbert Xu
On Fri, Jul 20, 2018 at 08:08:22AM +0200, Stephan Mueller wrote: > > - should it be synchronous like blkcipher? It should be synchronous. > - the TFMs (cipher Impls and templates) all operate on SGLs - should a virt > API simply convert a virt address into an SGL? If so, the problem that > trig

Re: [PATCH] crypto: inside-secure - switch to SPDX identifiers

2018-07-19 Thread Herbert Xu
On Fri, Jul 13, 2018 at 04:51:37PM +0200, Antoine Tenart wrote: > Use the appropriate SPDX license identifiers and drop the license text. > This patch is only cosmetic. > > Signed-off-by: Antoine Tenart Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert

Re: [PATCH] crypto: dh - fix memory leak

2018-07-19 Thread Herbert Xu
On Tue, Jul 10, 2018 at 09:22:52AM -0500, Gustavo A. R. Silva wrote: > In case memory resources for *base* were allocated, release them > before return. > > Addresses-Coverity-ID: 1471702 ("Resource leak") > Fixes: e3fe0ae12962 ("crypto: dh - add public key verification test") > Signed-off-by: Gus

Re: [PATCH] crypto: inside-secure - initialize first_rdesc to make GCC happy

2018-07-19 Thread Herbert Xu
On Fri, Jul 13, 2018 at 05:43:16PM +0200, Antoine Tenart wrote: > In the cipher safexcel_send_req function, GCC warns that > first_rdesc may be used uninitialized. While this should never > happen, this patch removes the warning by initializing this > variable to NULL to make GCC happy. > > This w

Re: [PATCH 1/2] crypto: DRBG - eliminate constant reinitialization of SGL

2018-07-19 Thread Herbert Xu
On Tue, Jul 10, 2018 at 05:56:33PM +0200, Stephan Müller wrote: > The CTR DRBG requires two SGLs pointing to input/output buffers for the > CTR AES operation. The used SGLs always have only one entry. Thus, the > SGL can be initialized during allocation time, preventing a > re-initialization of the

Re: [PATCH 2/2] crypto: DRBG - use caller buffer if suitable

2018-07-19 Thread Stephan Mueller
>> On Fri, Jul 20, 2018 at 07:09:05AM +0200, Stephan Mueller wrote: >> >> Maybe I have a different understanding of how such interface should look >> like. >> >> Can you give me some more detail on how you envision such virtual address >> interface should work? > > It should look like shash.

Re: [PATCH 2/2] crypto: DRBG - use caller buffer if suitable

2018-07-19 Thread Stephan Mueller
> Am 20.07.2018 um 05:54 schrieb Herbert Xu : > >> On Thu, Jul 19, 2018 at 10:57:16PM +0200, Stephan Müller wrote: >> >> Therefore, I am not sure that either having an SGL interface for the RNG API >> or a virtual address interface for the sync skcipher would be helpful. > > Could you please

Re: [PATCH] crypto: Add 0 walk-offset check in scatterwalk_pagedone()

2018-07-19 Thread 罗新强
Hi, Eric, Thanks for your reply. I had tried your program on a original kernel and it reproduced the crash. And I also tried the program on a kernel with our patch, but there was no crash occur. I think the crash reason of the program is that, the parameter buffer is aligned with the page and i

Re: [PATCH 2/2] crypto: DRBG - use caller buffer if suitable

2018-07-19 Thread Herbert Xu
On Thu, Jul 19, 2018 at 10:57:16PM +0200, Stephan Müller wrote: > > Therefore, I am not sure that either having an SGL interface for the RNG API > or a virtual address interface for the sync skcipher would be helpful. Could you please explain again why a virtual address interface to sync skcipher

Re: [RFC] crypto: Remove mcryptd

2018-07-19 Thread Herbert Xu
On Fri, May 11, 2018 at 06:44:13PM -0700, Megha Dey wrote: > > +static struct ahash_alg *simd_ahash_create_compat(const char *algname, > +const char *drvname, > +const char *basename) > +{ > +

Re: [PATCH 2/2] crypto: DRBG - use caller buffer if suitable

2018-07-19 Thread Stephan Müller
Am Donnerstag, 19. Juli 2018, 11:34:33 CEST schrieb Herbert Xu: Hi Herbert, > I think this is an abuse of virt_addr_valid. It's meant to catch > bogus uses of SG lists, it's not meant to be a guarantee that an > address can be used on an SG list. Thanks for your insights. > > A better solution

Re: [PATCH] random: addu a config option to trust the CPU's hwrng

2018-07-19 Thread Yann Droneaud
Hi, Le mercredi 18 juillet 2018 à 13:36 -0400, Theodore Y. Ts'o a écrit : > For those people who are super paranoid and want a "true random > number generator" (and the meaning of that is hazy) because a > CRNG is Not Enough, my recommendation these days is that they get > something like an open

Re: [PATCH v4 11/14] treewide: Prepare to remove VLA usage for AHASH_REQUEST_ON_STACK

2018-07-19 Thread Kees Cook
On Thu, Jul 19, 2018 at 7:54 AM, Ard Biesheuvel wrote: > On 19 July 2018 at 12:13, Ard Biesheuvel wrote: >> >>> On 19 Jul 2018, at 12:09, Kees Cook wrote: >>> >>> On Wed, Jul 18, 2018 at 7:55 PM, Ard Biesheuvel >>> wrote: I have only build tested it, so if you make sure that it does not br

Re: [PATCH 0/4][RFC v2] Introduce the in-kernel hibernation encryption

2018-07-19 Thread joeyli
Hi, On Thu, Jul 19, 2018 at 01:01:49PM +0200, Pavel Machek wrote: > On Thu 2018-07-19 07:58:51, Yu Chen wrote: > > Hi, > > On Wed, Jul 18, 2018 at 10:22:35PM +0200, Pavel Machek wrote: > > > On Thu 2018-07-19 00:38:06, Chen Yu wrote: > > > > As security becomes more and more important, we add the

Re: [PATCH v4 11/14] treewide: Prepare to remove VLA usage for AHASH_REQUEST_ON_STACK

2018-07-19 Thread Ard Biesheuvel
On 19 July 2018 at 12:13, Ard Biesheuvel wrote: > >> On 19 Jul 2018, at 12:09, Kees Cook wrote: >> >> On Wed, Jul 18, 2018 at 7:55 PM, Ard Biesheuvel >> wrote: >>> I have only build tested it, so if you make sure that it does not break >>> anything, please go ahead. >> >> I can give it a spin;

Re: [PATCH] random: addu a config option to trust the CPU's hwrng

2018-07-19 Thread Theodore Y. Ts'o
On Wed, Jul 18, 2018 at 04:22:35PM -0400, Sandy Harris wrote: > > Yes & one of those can also solve any difficulty with random(4) at > startup. Another alternative, perhaps easier on some systems, is > Denker's Turbid trng: > https://www.av8n.com/turbid/paper/turbid.htm In the link above I saw br

Re: [PATCH 0/4][RFC v2] Introduce the in-kernel hibernation encryption

2018-07-19 Thread Yu Chen
On Thu, Jul 19, 2018 at 01:01:49PM +0200, Pavel Machek wrote: > On Thu 2018-07-19 07:58:51, Yu Chen wrote: > > Hi, > > On Wed, Jul 18, 2018 at 10:22:35PM +0200, Pavel Machek wrote: > > > On Thu 2018-07-19 00:38:06, Chen Yu wrote: > > > > As security becomes more and more important, we add the in-ke

Re: [PATCH 0/4][RFC v2] Introduce the in-kernel hibernation encryption

2018-07-19 Thread Pavel Machek
On Thu 2018-07-19 07:58:51, Yu Chen wrote: > Hi, > On Wed, Jul 18, 2018 at 10:22:35PM +0200, Pavel Machek wrote: > > On Thu 2018-07-19 00:38:06, Chen Yu wrote: > > > As security becomes more and more important, we add the in-kernel > > > encryption support for hibernation. > > > > Sorry, this does

Re: [PATCH 2/2] crypto: DRBG - use caller buffer if suitable

2018-07-19 Thread Herbert Xu
On Tue, Jul 10, 2018 at 05:57:00PM +0200, Stephan Müller wrote: > The SGL can directly operate caller-provided memory with the exception > of stack memory. The DRBG detects whether the caller provided > non-suitable memory and uses the scratchpad only on those circumstances. > > This patch increas

Re: [PATCH] crypto: dh - fix calculating encoded key size

2018-07-19 Thread Herbert Xu
On Wed, Jul 11, 2018 at 09:27:56AM -0700, Eric Biggers wrote: > > The callers do check for errors, but at the point of the proposed BUG_ON() a > buffer overflow may have already occurred, so I think a BUG_ON() would be more > appropriate than a WARN_ON(). Of course, it would be better to prevent a

Crypto Fixes for 4.18

2018-07-19 Thread Herbert Xu
Hi Linus: This push fixes an allocation error-path bug in af_alg discovered by syzkaller. Please pull from git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6.git linus Stephan Mueller (1): crypto: af_alg - Initialize sg_num_bytes in error code path crypto/af_alg.c |