Re: [PATCH v2] crypto: algif_aead - fix uninitialized ctx->init

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

 



On Wed, Aug 12, 2020 at 02:58:25PM +0200, Ondrej Mosnacek wrote:
> In skcipher_accept_parent_nokey() the whole af_alg_ctx structure is
> cleared by memset() after allocation, so add such memset() also to
> aead_accept_parent_nokey() so that the new "init" field is also
> initialized to zero. Without that the initial ctx->init checks might
> randomly return true and cause errors.
> 
> While there, also remove the redundant zero assignments in both
> functions.
> 
> Found via libkcapi testsuite.
> 
> Cc: Stephan Mueller <smueller@xxxxxxxxxx>
> Fixes: f3c802a1f300 ("crypto: algif_aead - Only wake up when ctx->more is zero")
> Suggested-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Ondrej Mosnacek <omosnace@xxxxxxxxxx>
> ---
> 
> v2:
>  - intead add missing memset() to algif_aead and remove the redundant
>    zero assignments (suggested by Herbert)
> 
>  crypto/algif_aead.c     | 6 ------
>  crypto/algif_skcipher.c | 7 +------
>  2 files changed, 1 insertion(+), 12 deletions(-)

Patch applied.  Thanks.
-- 
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