Re: [PATCH 2/3] ecryptfs: checking return code ofecryptfs_find_auth_tok_for_sig()

From: Tyler Hicks
Date: Fri Oct 08 2010 - 15:10:44 EST


On Wed Oct 06, 2010 at 06:31:15PM +0200, Roberto Sassu <roberto.sassu@xxxxxxxxx> wrote:
> 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@xxxxxxxxx>
> ---

Nice catch - applied to
git://git.kernel.org/pub/scm/linux/kernel/git/ecryptfs/ecryptfs-2.6.git#next

Thanks!

> fs/ecryptfs/keystore.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c
> index 77580db..643d011 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;
> }
> --
> 1.7.2.3


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/