summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-09-20 16:58:38 +0200
committerBen Hutchings <ben@decadent.org.uk>2018-01-01 20:51:41 +0000
commitd5f4fcfa244eced002a2984d0c56ef4dceb22579 (patch)
tree942debe0fafd18cd7abd64c785d37231ad094bc6 /security
parent519dab751968b16f6c039abbc53ecd89f4668c68 (diff)
downloadlinux-stable-d5f4fcfa244eced002a2984d0c56ef4dceb22579.tar.gz
linux-stable-d5f4fcfa244eced002a2984d0c56ef4dceb22579.tar.bz2
linux-stable-d5f4fcfa244eced002a2984d0c56ef4dceb22579.zip
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.c2
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;
}
}