Skip to content

Commit 1cc4606

Browse files
mihalicynMiklos Szeredi
authored andcommitted
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: 72227ea ("fuse: convert to fileattr") Cc: <[email protected]> # v5.13 Signed-off-by: Alexander Mikhalitsyn <[email protected]> Signed-off-by: Miklos Szeredi <[email protected]>
1 parent 06bbb76 commit 1cc4606

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

fs/fuse/ioctl.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,12 @@ static struct fuse_file *fuse_priv_ioctl_prepare(struct inode *inode)
419419
struct fuse_mount *fm = get_fuse_mount(inode);
420420
bool isdir = S_ISDIR(inode->i_mode);
421421

422+
if (!fuse_allow_current_process(fm->fc))
423+
return ERR_PTR(-EACCES);
424+
425+
if (fuse_is_bad(inode))
426+
return ERR_PTR(-EIO);
427+
422428
if (!S_ISREG(inode->i_mode) && !isdir)
423429
return ERR_PTR(-ENOTTY);
424430

0 commit comments

Comments
 (0)