From d5f4fcfa244eced002a2984d0c56ef4dceb22579 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 20 Sep 2017 16:58:38 +0200 Subject: 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 Signed-off-by: David Howells Reviewed-by: Eric Biggers Cc: Herbert Xu Cc: Kirill Marinushkin Cc: security@kernel.org [bwh: Backported to 3.16: there's only one kfree() to change] Signed-off-by: Ben Hutchings --- security/keys/big_key.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'security') 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; } } -- cgit v1.2.3