From: Tyler Hicks Date: Wed, 26 Aug 2009 06:54:56 +0000 (-0500) Subject: eCryptfs: Validate global auth tok keys X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=3891959846709a19f76628e33478cd85edb0e79f;hp=df6ad33ba1b9846bd5f0e2b9016c30c20bc2d948;p=deliverable%2Flinux.git eCryptfs: Validate global auth tok keys When searching through the global authentication tokens for a given key signature, verify that a matching key has not been revoked and has not expired. This allows the `keyctl revoke` command to be properly used on keys in use by eCryptfs. Acked-by: Serge Hallyn Cc: ecryptfs-devel@lists.launchpad.net Cc: stable Signed-off-by: Tyler Hicks --- diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c index 17164e483ab1..a0a7847567e9 100644 --- a/fs/ecryptfs/keystore.c +++ b/fs/ecryptfs/keystore.c @@ -416,7 +416,9 @@ ecryptfs_find_global_auth_tok_for_sig( &mount_crypt_stat->global_auth_tok_list, mount_crypt_stat_list) { if (memcmp(walker->sig, sig, ECRYPTFS_SIG_SIZE_HEX) == 0) { - (*global_auth_tok) = walker; + rc = key_validate(walker->global_auth_tok_key); + if (!rc) + (*global_auth_tok) = walker; goto out; } }