Skip to content
Snippets Groups Projects
Commit 5a605930 authored by Joakim Sindholt's avatar Joakim Sindholt Committed by Greg Kroah-Hartman
Browse files

fs/9p: only translate RWX permissions for plain 9P2000


[ Upstream commit cd25e15e ]

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: default avatarJoakim Sindholt <opensource@zhasha.com>
Signed-off-by: default avatarEric Van Hensbergen <ericvh@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent a79b53d0
No related branches found
No related tags found
2 merge requests!185🤖 Sync Bot: Update v5.10-ktn to Latest Stable Kernel (v5.10.234),!172🤖 Sync Bot: Update v5.10-ktn to Latest Stable Kernel (v5.10.230)
...@@ -86,7 +86,7 @@ static int p9mode2perm(struct v9fs_session_info *v9ses, ...@@ -86,7 +86,7 @@ static int p9mode2perm(struct v9fs_session_info *v9ses,
int res; int res;
int mode = stat->mode; int mode = stat->mode;
res = mode & S_IALLUGO; res = mode & 0777; /* S_IRWXUGO */
if (v9fs_proto_dotu(v9ses)) { if (v9fs_proto_dotu(v9ses)) {
if ((mode & P9_DMSETUID) == P9_DMSETUID) if ((mode & P9_DMSETUID) == P9_DMSETUID)
res |= S_ISUID; res |= S_ISUID;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment