diff options
Diffstat (limited to 'fs/ecryptfs/keystore.c')
-rw-r--r-- | fs/ecryptfs/keystore.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c index e7f029f00c6b..b1f6858a5223 100644 --- a/fs/ecryptfs/keystore.c +++ b/fs/ecryptfs/keystore.c | |||
@@ -459,6 +459,15 @@ ecryptfs_find_auth_tok_for_sig( | |||
459 | if (ecryptfs_find_global_auth_tok_for_sig(&global_auth_tok, | 459 | if (ecryptfs_find_global_auth_tok_for_sig(&global_auth_tok, |
460 | mount_crypt_stat, sig)) { | 460 | mount_crypt_stat, sig)) { |
461 | 461 | ||
462 | /* if the flag ECRYPTFS_GLOBAL_MOUNT_AUTH_TOK_ONLY is set in the | ||
463 | * mount_crypt_stat structure, we prevent to use auth toks that | ||
464 | * are not inserted through the ecryptfs_add_global_auth_tok | ||
465 | * function. | ||
466 | */ | ||
467 | if (mount_crypt_stat->flags | ||
468 | & ECRYPTFS_GLOBAL_MOUNT_AUTH_TOK_ONLY) | ||
469 | return -EINVAL; | ||
470 | |||
462 | rc = ecryptfs_keyring_auth_tok_for_sig(auth_tok_key, auth_tok, | 471 | rc = ecryptfs_keyring_auth_tok_for_sig(auth_tok_key, auth_tok, |
463 | sig); | 472 | sig); |
464 | } else | 473 | } else |