From: Roberto Sassu Date: Wed, 6 Oct 2010 16:31:15 +0000 (+0200) Subject: ecryptfs: checking return code of ecryptfs_find_auth_tok_for_sig() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=39fac853a758306285404368fbe392408057b136;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git ecryptfs: checking return code of ecryptfs_find_auth_tok_for_sig() This patch replaces the check of the 'matching_auth_tok' pointer with the exit status of ecryptfs_find_auth_tok_for_sig(). This avoids to use authentication tokens obtained through the function ecryptfs_keyring_auth_tok_for_sig which are not valid. Signed-off-by: Roberto Sassu Cc: Dustin Kirkland Cc: James Morris Signed-off-by: Tyler Hicks --- diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c index b85c6a7770a8..e7f029f00c6b 100644 --- a/fs/ecryptfs/keystore.c +++ b/fs/ecryptfs/keystore.c @@ -1819,11 +1819,11 @@ find_next_matching_auth_tok: rc = -EINVAL; goto out_wipe_list; } - ecryptfs_find_auth_tok_for_sig(&auth_tok_key, + rc = ecryptfs_find_auth_tok_for_sig(&auth_tok_key, &matching_auth_tok, crypt_stat->mount_crypt_stat, candidate_auth_tok_sig); - if (matching_auth_tok) { + if (!rc) { found_auth_tok = 1; goto found_matching_auth_tok; }