]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
client: prohibit unprivileged users from setting sgid/suid bits
authorKefu Chai <tchaikov@gmail.com>
Sat, 5 Jul 2025 08:23:36 +0000 (16:23 +0800)
committerVenky Shankar <vshankar@redhat.com>
Thu, 23 Oct 2025 07:28:44 +0000 (12:58 +0530)
commit44c3410cf519aa4a3ea5423d909e0b9a4d98efc8
tree0e09ee8d3c9965b3d953b0fb445ce6709d96326d
parent2eca0ab7384133c638ef4f999692373eae5c8e4f
client: prohibit unprivileged users from setting sgid/suid bits

Prior to fb1b72d, unprivileged users could add mode bits as long as
S_ISUID and S_ISGID were not included in the change.

After fb1b72d, unprivileged users were allowed to modify S_ISUID and
S_ISGID bits only when no other mode bits were changed in the same
operation. This inadvertently permitted unprivileged users to set
S_ISUID and/or S_ISGID bits when they were the sole bits being modified.

This behavior should not be allowed. Unprivileged users should be
prohibited from setting S_ISUID and/or S_ISGID bits under any
circumstances.

This change tightens the permission check to prevent unprivileged
users from setting these privileged bits in all cases.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
(cherry picked from commit 7028ed21138522495df1e9f8b01195a3c43d47ff)
src/client/Client.cc
src/test/libcephfs/suidsgid.cc