diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-09-20 17:58:38 +0300 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2018-01-01 23:51:41 +0300 |
commit | d5f4fcfa244eced002a2984d0c56ef4dceb22579 (patch) | |
tree | 942debe0fafd18cd7abd64c785d37231ad094bc6 /security | |
parent | 519dab751968b16f6c039abbc53ecd89f4668c68 (diff) | |
download | linux-d5f4fcfa244eced002a2984d0c56ef4dceb22579.tar.xz |
security/keys: properly zero out sensitive key material in big_key
commit 910801809b2e40a4baedd080ef5d80b4a180e70e upstream.
Error paths forgot to zero out sensitive material, so this patch changes
some kfrees into a kzfrees.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Eric Biggers <ebiggers3@gmail.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Kirill Marinushkin <k.marinushkin@gmail.com>
Cc: security@kernel.org
[bwh: Backported to 3.16: there's only one kfree() to change]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'security')
-rw-r--r-- | security/keys/big_key.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/security/keys/big_key.c b/security/keys/big_key.c index 8137b27d641d..aa8f46f0918a 100644 --- a/security/keys/big_key.c +++ b/security/keys/big_key.c @@ -135,7 +135,7 @@ void big_key_destroy(struct key *key) path->mnt = NULL; path->dentry = NULL; } else { - kfree(key->payload.data); + kzfree(key->payload.data); key->payload.data = NULL; } } |