Re: [PATCH v2 11/11] crypto: skcipher: Remove VLA usage for SKCIPHER_REQUEST_ON_STACK

2018-06-27 Thread Kees Cook
On Wed, Jun 27, 2018 at 3:27 PM, Herbert Xu wrote: > On Wed, Jun 27, 2018 at 11:31:09AM -0700, Kees Cook wrote: >> crypto/lrw.c: crypto_skcipher_set_reqsize(tfm, >> crypto_skcipher_reqsize(cipher) + >> crypto/lrw.c-sizeof(struct rctx)); >> ... >> crypto/cts.c-

Re: [PATCH v2 11/11] crypto: skcipher: Remove VLA usage for SKCIPHER_REQUEST_ON_STACK

2018-06-27 Thread Herbert Xu
On Wed, Jun 27, 2018 at 11:31:09AM -0700, Kees Cook wrote: > > I might be catching on... so from this list, I should only "count" the > synchronous ones as being wrappable? The skcipher list is actually > pretty short: > > crypto/cryptd.c:crypto_skcipher_set_reqsize( > crypto/cryptd.c-

Re: [PATCH v2 11/11] crypto: skcipher: Remove VLA usage for SKCIPHER_REQUEST_ON_STACK

2018-06-27 Thread Kees Cook
On Wed, Jun 27, 2018 at 7:36 AM, Herbert Xu wrote: > On Tue, Jun 26, 2018 at 09:45:09AM -0700, Kees Cook wrote: >> >> Which are likely to be wrapped together? Should I take this to 512 or >> something else? > > The situation is similar to ahash. While they're using the same > skcipher interface,

Re: [dm-devel] [PATCH v2 10/11] crypto: ahash: Remove VLA usage for AHASH_REQUEST_ON_STACK

2018-06-27 Thread Kees Cook
On Wed, Jun 27, 2018 at 7:34 AM, Herbert Xu wrote: > On Tue, Jun 26, 2018 at 10:02:31AM -0700, Kees Cook wrote: >> >> There is no SHASH_MAX_REQSIZE? >> >> As for users of AHASH_REQUEST_ON_STACK, I see: > > These users are only using the top-level ahash interface. The > underlying algorithms must

Re: [PATCH v2 11/11] crypto: skcipher: Remove VLA usage for SKCIPHER_REQUEST_ON_STACK

2018-06-27 Thread Herbert Xu
On Tue, Jun 26, 2018 at 09:45:09AM -0700, Kees Cook wrote: > > Which are likely to be wrapped together? Should I take this to 512 or > something else? The situation is similar to ahash. While they're using the same skcipher interface, the underlying algorithms must all be synchronous. In fact, i

Re: [dm-devel] [PATCH v2 10/11] crypto: ahash: Remove VLA usage for AHASH_REQUEST_ON_STACK

2018-06-27 Thread Herbert Xu
On Tue, Jun 26, 2018 at 10:02:31AM -0700, Kees Cook wrote: > > There is no SHASH_MAX_REQSIZE? > > As for users of AHASH_REQUEST_ON_STACK, I see: These users are only using the top-level ahash interface. The underlying algorithms must all be shas. Cheers, -- Email: Herbert Xu Home Page: http:/

Re: [PATCH v3 0/2] Detect & register virtio-crypto algos only if it can be supported by backend

2018-06-27 Thread Farhan Ali
Polite ping :) Would like to know how to merge these patches in the mainline kernel. Thanks Farhan On 06/19/2018 11:41 AM, Farhan Ali wrote: Hi, Currently the Linux virtio-crypto driver registers the crypto algorithm without verifying if the backend actually supports the algorithm. This ke

Re: [PATCH 3/3] hwrng: msm - Add support for prng v2

2018-06-27 Thread Stephan Mueller
Am Mittwoch, 27. Juni 2018, 09:01:44 CEST schrieb Vinod: Hi Vinod, > > > Currently am doing bunch of initialization in .probe (platform driver) > > > and I think recommendation would be to move that to .cra_init, which > > > seem > > > plausible but I don't have pdev to read hw_resource etc.. so

Re: [PATCH 3/3] hwrng: msm - Add support for prng v2

2018-06-27 Thread Vinod
Hi Stephan, Thanks for quick reply, On 27-06-18, 08:43, Stephan Mueller wrote: > > On 27-06-18, 08:13, Stephan Mueller wrote: > > > The key is: > > > alg->base.cra_ctxsize = sizeof(struct drbg_state); > > > > > > during initialization since the kernel crypto API allocates that buffer >