mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
eCryptfs: protect crypt_stat->flags in ecryptfs_open()
Make sure crypt_stat->flags is protected with a lock in ecryptfs_open(). Signed-off-by: Michael Halcrow <[email protected]> Cc: Al Viro <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
6a3fd92e73
commit
2f9b12a31f
1 changed files with 2 additions and 0 deletions
|
|
@ -195,7 +195,9 @@ static int ecryptfs_open(struct inode *inode, struct file *file)
|
|||
file, ecryptfs_inode_to_private(inode)->lower_file);
|
||||
if (S_ISDIR(ecryptfs_dentry->d_inode->i_mode)) {
|
||||
ecryptfs_printk(KERN_DEBUG, "This is a directory\n");
|
||||
mutex_lock(&crypt_stat->cs_mutex);
|
||||
crypt_stat->flags &= ~(ECRYPTFS_ENCRYPTED);
|
||||
mutex_unlock(&crypt_stat->cs_mutex);
|
||||
rc = 0;
|
||||
goto out;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue