mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-23 11:01:15 +00:00
fuse: add inode/permission checks to fileattr_get/fileattr_set
commit1cc4606d19
upstream. It looks like these checks were accidentally lost during the conversion to fileattr API. Fixes:72227eac17
("fuse: convert to fileattr") Cc: <stable@vger.kernel.org> # v5.13 Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
5a66e59e1f
commit
bea92c2d45
1 changed files with 6 additions and 0 deletions
|
@ -419,6 +419,12 @@ static struct fuse_file *fuse_priv_ioctl_prepare(struct inode *inode)
|
|||
struct fuse_mount *fm = get_fuse_mount(inode);
|
||||
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)
|
||||
return ERR_PTR(-ENOTTY);
|
||||
|
||||
|
|
Loading…
Reference in a new issue