Skip to content

Commit

Permalink
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git…
Browse files Browse the repository at this point in the history
…/herbert/crypto-2.6

Pull crypto fix from Herbert Xu:
 "This fixes a regression in af_alg"

* 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: algif_aead - fix uninitialized ctx->init
  • Loading branch information
torvalds committed Aug 14, 2020
2 parents 0fd9cc6 + 21dfbcd commit d9361cb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
6 changes: 0 additions & 6 deletions crypto/algif_aead.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,12 +554,6 @@ static int aead_accept_parent_nokey(void *private, struct sock *sk)

INIT_LIST_HEAD(&ctx->tsgl_list);
ctx->len = len;
ctx->used = 0;
atomic_set(&ctx->rcvused, 0);
ctx->more = 0;
ctx->merge = 0;
ctx->enc = 0;
ctx->aead_assoclen = 0;
crypto_init_wait(&ctx->wait);

ask->private = ctx;
Expand Down
7 changes: 1 addition & 6 deletions crypto/algif_skcipher.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,23 +329,18 @@ static int skcipher_accept_parent_nokey(void *private, struct sock *sk)
ctx = sock_kmalloc(sk, len, GFP_KERNEL);
if (!ctx)
return -ENOMEM;
memset(ctx, 0, len);

ctx->iv = sock_kmalloc(sk, crypto_skcipher_ivsize(tfm),
GFP_KERNEL);
if (!ctx->iv) {
sock_kfree_s(sk, ctx, len);
return -ENOMEM;
}

memset(ctx->iv, 0, crypto_skcipher_ivsize(tfm));

INIT_LIST_HEAD(&ctx->tsgl_list);
ctx->len = len;
ctx->used = 0;
atomic_set(&ctx->rcvused, 0);
ctx->more = 0;
ctx->merge = 0;
ctx->enc = 0;
crypto_init_wait(&ctx->wait);

ask->private = ctx;
Expand Down

0 comments on commit d9361cb

Please sign in to comment.