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

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

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

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

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

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