Skip to contentSkip to conversation

Missing patch from stable [2/7]

PATCH Willy Tarreau 1 participant 1 message Jun 8, 2008 Ecrypt file system

lore
Share & tools
lore
#0 lore raw

Hi,

this patch from mainline seems suitable for -stable, but was not proposed for inclusion. I think we should include it for next review unless the author disagrees.

Thanks,
Willy
--

Quoted 1 line

From 2f9b12a31fcb738ea8c9eb0d4ddf906c6f1d696c Mon Sep 17 00:00:00 2001

From: Michael Halcrow <[email protected]>
Date: Tue, 29 Apr 2008 00:59:52 -0700
Subject: eCryptfs: protect crypt_stat->flags in ecryptfs_open()

Make sure crypt_stat->flags is protected with a lock in ecryptfs_open().

---
 fs/ecryptfs/file.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
fs/ecryptfs/file.c +2 -0
index 2b8f5ed..2258b8f 100644
@@ -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;
 	}
Signature · 1 line
1.5.3.8