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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 increases the speed of the CTR DRBG by 1 to 3 percent
> depending on the buffer size of the output buffer.
> 
> Signed-off-by: Stephan Mueller <smueller@xxxxxxxxxx>

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.

A better solution would be either an SG-list interface for rng,
or alternatively a virtual address interface for sync skcipher.

Cheers,
-- 
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt



[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux