Skip to content

Commit cd25e15

Browse files
zhashaericvh
authored andcommitted
fs/9p: only translate RWX permissions for plain 9P2000
Garbage in plain 9P2000's perm bits is allowed through, which causes it to be able to set (among others) the suid bit. This was presumably not the intent since the unix extended bits are handled explicitly and conditionally on .u. Signed-off-by: Joakim Sindholt <[email protected]> Signed-off-by: Eric Van Hensbergen <[email protected]>
1 parent 8d025e2 commit cd25e15

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/9p/vfs_inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ static int p9mode2perm(struct v9fs_session_info *v9ses,
8383
int res;
8484
int mode = stat->mode;
8585

86-
res = mode & S_IALLUGO;
86+
res = mode & 0777; /* S_IRWXUGO */
8787
if (v9fs_proto_dotu(v9ses)) {
8888
if ((mode & P9_DMSETUID) == P9_DMSETUID)
8989
res |= S_ISUID;

0 commit comments

Comments
 (0)