VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Tyler Hicks <tyhicks@canonical.com> 2012-06-12 11:17:01 -0700 committer: Tyler Hicks <tyhicks@canonical.com> 2012-07-03 16:34:09 -0700 commit: 9fe79d7600497ed8a95c3981cbe5b73ab98222f0 parent: ff826b2b5b269ad440afa686ede879ccabfda387
Commit Summary:
eCryptfs: Properly check for O_RDONLY flag before doing privileged open
Diffstat:
1 file changed, 1 insertion, 1 deletion
diff --git a/fs/ecryptfs/kthread.c b/fs/ecryptfs/kthread.c
index 69f994a7d524..0dbe58a8b172 100644
--- a/fs/ecryptfs/kthread.c
+++ b/fs/ecryptfs/kthread.c
@@ -149,7 +149,7 @@ int ecryptfs_privileged_open(struct file **lower_file,
 	(*lower_file) = dentry_open(lower_dentry, lower_mnt, flags, cred);
 	if (!IS_ERR(*lower_file))
 		goto out;
-	if (flags & O_RDONLY) {
+	if ((flags & O_ACCMODE) == O_RDONLY) {
 		rc = PTR_ERR((*lower_file));
 		goto out;
 	}