Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 72227eac177d ("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>

authored by

Alexander Mikhalitsyn and committed by
Miklos Szeredi
1cc4606d 06bbb761

+6
+6
fs/fuse/ioctl.c
··· 419 419 struct fuse_mount *fm = get_fuse_mount(inode); 420 420 bool isdir = S_ISDIR(inode->i_mode); 421 421 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 + 422 428 if (!S_ISREG(inode->i_mode) && !isdir) 423 429 return ERR_PTR(-ENOTTY); 424 430