aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ecryptfs/main.c
diff options
context:
space:
mode:
authorRoberto Sassu <roberto.sassu@polito.it>2011-03-21 11:00:55 -0400
committerTyler Hicks <tyhicks@linux.vnet.ibm.com>2011-03-28 02:49:43 -0400
commitb5695d04634fa4ccca7dcbc05bb4a66522f02e0b (patch)
tree568155380ea1b1fa3b9e68f68dd74cdd9d651229 /fs/ecryptfs/main.c
parent950983fc04e02232e0d25717903461578a755ebb (diff)
eCryptfs: write lock requested keys
A requested key is write locked in order to prevent modifications on the authentication token while it is being used. Signed-off-by: Roberto Sassu <roberto.sassu@polito.it> Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
Diffstat (limited to 'fs/ecryptfs/main.c')
-rw-r--r--fs/ecryptfs/main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
index 520d05f5ad0..c27c0ecf90b 100644
--- a/fs/ecryptfs/main.c
+++ b/fs/ecryptfs/main.c
@@ -254,8 +254,10 @@ static int ecryptfs_init_global_auth_toks(
254 "option: [%s]\n", global_auth_tok->sig); 254 "option: [%s]\n", global_auth_tok->sig);
255 global_auth_tok->flags |= ECRYPTFS_AUTH_TOK_INVALID; 255 global_auth_tok->flags |= ECRYPTFS_AUTH_TOK_INVALID;
256 goto out; 256 goto out;
257 } else 257 } else {
258 global_auth_tok->flags &= ~ECRYPTFS_AUTH_TOK_INVALID; 258 global_auth_tok->flags &= ~ECRYPTFS_AUTH_TOK_INVALID;
259 up_write(&(global_auth_tok->global_auth_tok_key)->sem);
260 }
259 } 261 }
260out: 262out:
261 return rc; 263 return rc;