fuse:rely on fuse_perm for exec when no mode bits set
Subsystems (2)
PATCH 1/1 fuse:rely on fuse_perm for exec when no mode bits set
In current code, for exec we are checking mode bits for x bit set even though the fuse_perm_getattr returns success. Changes in this patch avoids mode bit explicit check, leaves the exec checking to fuse file system in uspace.
--- fs/fuse/dir.c | 5 ----- 1 file changed, 5 deletions(-)
fs/fuse/dir.c +0 -5
@@ -1196,12 +1196,7 @@ static int fuse_permission(struct inode *inode, int mask) err =fuse_access (inode, mask); }else if ((mask &MAY_EXEC ) &&S_ISREG (inode->i_mode)) {if (!(inode->i_mode &S_IXUGO )) { -if (refreshed) -return -EACCES ; - err =fuse_perm_getattr (inode, mask); -if (!err && !(inode->i_mode &S_IXUGO )) -return -EACCES ; } }return err;
Signature · 1 line
2.7.4
Miklos Szeredi
maintainerQuoted 6 lines · Chakra Divi
In current code, for exec we are checking mode bits for x bit set even though the
fuse_perm_getattrreturns success. Changes in this patch avoids mode bit explicit check, leaves the exec checking to fuse file system in uspace.
Why is this needed?
Thanks,
Miklos
Quoted 10 lines · Miklos Szeredi
Quoted 6 lines · Chakra Divi
In current code, for exec we are checking mode bits for x bit set even though the
fuse_perm_getattrreturns success. Changes in this patch avoids mode bit explicit check, leaves the exec checking to fuse file system in uspace.Why is this needed?
Thanks for responding Miklos. We have an use case with our remote file system mounted on fuse , where permissions checks will happen remotely without the need of mode bits. In case of read, write it worked without issues. But for executable files, we found that fuse kernel is explicitly checking 'x' mode bit set on the file. We want this checking also to be pushed to remote instead of kernel doing it - so modified the kernel code to send getattr op to usespace in exec case too.
Quoted 2 lines
Thanks,
Miklos
Quoted 13 lines · Chakra Divi
Quoted 10 lines · Miklos Szeredi
Quoted 6 lines · Chakra Divi
In current code, for exec we are checking mode bits for x bit set even though the
fuse_perm_getattrreturns success. Changes in this patch avoids mode bit explicit check, leaves the exec checking to fuse file system in uspace.Why is this needed?
Quoted 8 lines
Thanks for responding Miklos. We have an use case with our remote file system mounted on fuse , where permissions checks will happen remotely without the need of mode bits. In case of read, write it worked without issues. But for executable files, we found that fuse kernel is explicitly checking 'x' mode bit set on the file. We want this checking also to be pushed to remote instead of kernel doing it - so modified the kernel code to send getattr op to usespace in exec case too.
Any help on this Miklos....
Thanks,
Chakra
Quoted 2 lines
Quoted 2 lines
Thanks,
Miklos
Miklos Szeredi
maintainerQuoted 24 lines · Chakra Divi
Quoted 13 lines · Chakra Divi
Quoted 10 lines · Miklos Szeredi
Quoted 6 lines · Chakra Divi
In current code, for exec we are checking mode bits for x bit set even though the
fuse_perm_getattrreturns success. Changes in this patch avoids mode bit explicit check, leaves the exec checking to fuse file system in uspace.Why is this needed?
Quoted 8 lines
Thanks for responding Miklos. We have an use case with our remote file system mounted on fuse , where permissions checks will happen remotely without the need of mode bits. In case of read, write it worked without issues. But for executable files, we found that fuse kernel is explicitly checking 'x' mode bit set on the file. We want this checking also to be pushed to remote instead of kernel doing it - so modified the kernel code to send getattr op to usespace in exec case too.
Quoted 1 line
Any help on this Miklos....
I still don't understand what you are requesting. What your patch does is unconditionally allow execution, even without any 'x' bits in the mode. What does that achieve?
Thanks,
Miklos
Quoted 26 lines · Miklos Szeredi
Quoted 24 lines · Chakra Divi
Quoted 21 lines · Chakra Divi
Quoted 10 lines · Miklos Szeredi
Quoted 6 lines · Chakra Divi
In current code, for exec we are checking mode bits for x bit set even though the
fuse_perm_getattrreturns success. Changes in this patch avoids mode bit explicit check, leaves the exec checking to fuse file system in uspace.Why is this needed?
Thanks for responding Miklos. We have an use case with our remote file system mounted on fuse , where permissions checks will happen remotely without the need of mode bits. In case of read, write it worked without issues. But for executable files, we found that fuse kernel is explicitly checking 'x' mode bit set on the file. We want this checking also to be pushed to remote instead of kernel doing it - so modified the kernel code to send getattr op to usespace in exec case too.
Quoted 5 lines
Quoted 1 line
Any help on this Miklos....
I still don't understand what you are requesting. What your patch does is unconditionally allow execution, even without any 'x' bits in the mode. What does that achieve?
Thanks for the help Miklos. We have a network based filesystem that supports acls.
As our filesystem give granular access, we wipe out the mode bits and completely rely on ACLs.
Fuse works well for all other ops (with default_permissions disabled )
as all the checks are done at the filesystems.
But only executables have problems because fuse kernel rejects the execution by doing access checks on mode bit.
To push this check to filesystem, in the above patch - i'm relying on return value from fuse_perm_getattr() ignoring the mode bits.
When the fuse module is asked to rely on filesystem for access checks, why do we need this explicit check for executables?
I found out that it is the same issue with nfs too. Is there a reason for it ? Should we not push this check to filesystem ?
Thanks,
Chakra
Quoted 3 lines
Thanks,
Miklos
Miklos Szeredi
maintainerQuoted 30 lines · Chakra Divi
Quoted 28 lines · Miklos Szeredi
Quoted 25 lines · Chakra Divi
Quoted 13 lines · Chakra Divi
Quoted 10 lines · Miklos Szeredi
Quoted 6 lines · Chakra Divi
In current code, for exec we are checking mode bits for x bit set even though the
fuse_perm_getattrreturns success. Changes in this patch avoids mode bit explicit check, leaves the exec checking to fuse file system in uspace.Why is this needed?
Quoted 8 lines
Thanks for responding Miklos. We have an use case with our remote file system mounted on fuse , where permissions checks will happen remotely without the need of mode bits. In case of read, write it worked without issues. But for executable files, we found that fuse kernel is explicitly checking 'x' mode bit set on the file. We want this checking also to be pushed to remote instead of kernel doing it - so modified the kernel code to send getattr op to usespace in exec case too.
Any help on this Miklos....
Quoted 8 lines
Quoted 3 lines
I still don't understand what you are requesting. What your patch does is unconditionally allow execution, even without any 'x' bits in the mode. What does that achieve?
Thanks for the help Miklos. We have a network based filesystem that supports acls.
As our filesystem give granular access, we wipe out the mode bits and completely rely on ACLs.
Are you using POSIX ACLs? Why can't you translate the ACL's back
into mode bits (that's what all filesystems do)?
Quoted 10 lines
Fuse works well for all other ops (with
default_permissionsdisabled )
as all the checks are done at the filesystems.
But only executables have problems because fuse kernel rejects the execution by doing access checks on mode bit.
To push this check to filesystem, in the above patch - i'm relying on return value fromfuse_perm_getattr()ignoring the mode bits.When the fuse module is asked to rely on filesystem for access checks, why do we need this explicit check for executables?
Because there's no other check. Have you noticed that with your patch *all* files become executable? I guess that's not what you wanted...
Thanks,
Miklos