Skip to content

Commit 39fac85

Browse files
Roberto SassuTyler Hicks
authored andcommitted
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 <roberto.sassu@polito.it> Cc: Dustin Kirkland <kirkland@canonical.com> Cc: James Morris <jmorris@namei.org> Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
1 parent aee683b commit 39fac85

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎fs/ecryptfs/keystore.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1819,11 +1819,11 @@ int ecryptfs_parse_packet_set(struct ecryptfs_crypt_stat *crypt_stat,
18191819
rc = -EINVAL;
18201820
goto out_wipe_list;
18211821
}
1822-
ecryptfs_find_auth_tok_for_sig(&auth_tok_key,
1822+
rc = ecryptfs_find_auth_tok_for_sig(&auth_tok_key,
18231823
&matching_auth_tok,
18241824
crypt_stat->mount_crypt_stat,
18251825
candidate_auth_tok_sig);
1826-
if (matching_auth_tok) {
1826+
if (!rc) {
18271827
found_auth_tok = 1;
18281828
goto found_matching_auth_tok;
18291829
}

0 commit comments

Comments
 (0)