Commit 93513a7e authored by Ioanna Alifieraki's avatar Ioanna Alifieraki Committed by Khalid Elmously

UBUNTU: SAUCE: Revert "ovl: modify ovl_permission() to do checks on two inodes"

BugLink: https://bugs.launchpad.net/bugs/1851243

This commit breaks r/w access to files. Since fixing it requires many
commits to be backported revert it to avoid risk of regressions.
For detailed description please look at LP #1851243.

This reverts commit c8838e8e.
Signed-off-by: default avatarIoanna Alifieraki <ioanna-maria.alifieraki@canonical.com>
Acked-by: default avatarConnor Kuehl <connor.kuehl@canonical.com>
Acked-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent df928332
......@@ -9,7 +9,6 @@
#include <linux/fs.h>
#include <linux/slab.h>
#include <linux/cred.h>
#include <linux/xattr.h>
#include "overlayfs.h"
......@@ -92,7 +91,6 @@ int ovl_permission(struct inode *inode, int mask)
struct ovl_entry *oe;
struct dentry *alias = NULL;
struct inode *realinode;
const struct cred *old_cred;
struct dentry *realdentry;
bool is_upper;
int err;
......@@ -145,18 +143,7 @@ int ovl_permission(struct inode *inode, int mask)
goto out_dput;
}
/*
* Check overlay inode with the creds of task and underlying inode
* with creds of mounter
*/
err = generic_permission(inode, mask);
if (err)
goto out_dput;
old_cred = ovl_override_creds(inode->i_sb);
err = __inode_permission(realinode, mask);
revert_creds(old_cred);
out_dput:
dput(alias);
return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment