Commit 1cc4606d authored by Alexander Mikhalitsyn's avatar Alexander Mikhalitsyn Committed by Miklos Szeredi

fuse: add inode/permission checks to fileattr_get/fileattr_set

It looks like these checks were accidentally lost during the conversion to
fileattr API.

Fixes: 72227eac ("fuse: convert to fileattr")
Cc: <stable@vger.kernel.org> # v5.13
Signed-off-by: default avatarAlexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
parent 06bbb761
...@@ -419,6 +419,12 @@ static struct fuse_file *fuse_priv_ioctl_prepare(struct inode *inode) ...@@ -419,6 +419,12 @@ static struct fuse_file *fuse_priv_ioctl_prepare(struct inode *inode)
struct fuse_mount *fm = get_fuse_mount(inode); struct fuse_mount *fm = get_fuse_mount(inode);
bool isdir = S_ISDIR(inode->i_mode); bool isdir = S_ISDIR(inode->i_mode);
if (!fuse_allow_current_process(fm->fc))
return ERR_PTR(-EACCES);
if (fuse_is_bad(inode))
return ERR_PTR(-EIO);
if (!S_ISREG(inode->i_mode) && !isdir) if (!S_ISREG(inode->i_mode) && !isdir)
return ERR_PTR(-ENOTTY); return ERR_PTR(-ENOTTY);
......
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