fs/9p: only translate RWX permissions for plain 9P2000
authorJoakim Sindholt <opensource@zhasha.com>
Mon, 18 Mar 2024 11:22:31 +0000 (12:22 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 May 2024 09:50:55 +0000 (11:50 +0200)
commitad4f65328661392de74e3608bb736fedf3b67e32
tree15e4af6d10fa5963d8ccdeb4874d4fb68c61b28d
parent3931e927d55103a9d68819b815e6fb33fbe48515
fs/9p: only translate RWX permissions for plain 9P2000

[ Upstream commit cd25e15e57e68a6b18dc9323047fe9c68b99290b ]

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 <opensource@zhasha.com>
Signed-off-by: Eric Van Hensbergen <ericvh@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/9p/vfs_inode.c