Skip to contentSkip to conversation

security: commoncap: drop stale CAP_FS_MASK FIXME

PATCH In review Adriano Cordova 3 participants 3 messages Oct 26 – Nov 4

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 security: commoncap: drop stale CAP_FS_MASK FIXME

CAP_FS_SET is exactly the set of capabilities that an fsuid of 0 historically granted (see CAP_FS_MASK in include/linux/capability.h), so cap_task_fix_setuid() drops that set from the effective set when fsuid leaves 0. Remove the stale FIXME.

---
v3: just drop the FIXME instead of replacing it with another explanation.

 security/commoncap.c | 3 ---
 1 file changed, 3 deletions(-)
security/commoncap.c +0 -3
index 3399535808fe..484d2b9256e9 100644
@@ -1171,9 +1171,6 @@ int cap_task_fix_setuid(struct cred *new, const struct cred *old, int flags)
 	case LSM_SETID_FS:
 		/* juggle the capabilities to follow FSUID changes, unless
 		 * otherwise suppressed
-		 *
-		 * FIXME - is fsuser used for all CAP_FS_MASK capabilities?
-		 *          if not, we might be a bit too harsh here.
 		 */
 		if (!issecure(SECURE_NO_SETUID_FIXUP)) {
 			kuid_t root_uid = make_kuid(old->user_ns, 0);
Signature · 1 line
2.51.0
#1 lore raw
Sashiko has reviewed this patch and found no issues.
Quoted 6 lines

CAP_FS_SET is exactly the set of capabilities that an fsuid of 0 historically granted (see CAP_FS_MASK in include/linux/capability.h), so cap_task_fix_setuid() drops that set from the effective set when fsuid leaves 0. Remove the stale FIXME.

Sashiko has reviewed this patch and found no issues.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
maintainer Reviewed-by on v3 1/1
#2 lore raw
In reply to Adriano Cordova
Quoted 6 lines · Adriano Cordova

CAP_FS_SET is exactly the set of capabilities that an fsuid of 0 historically granted (see CAP_FS_MASK in include/linux/capability.h), so cap_task_fix_setuid() drops that set from the effective set when fsuid leaves 0. Remove the stale FIXME.

Thanks. Will add this to caps-next for next merge.

Quoted 22 lines

---
v3: just drop the FIXME instead of replacing it with another explanation.

 security/commoncap.c | 3 ---
 1 file changed, 3 deletions(-)
security/commoncap.c +0 -3
index 3399535808fe..484d2b9256e9 100644
@@ -1171,9 +1171,6 @@ int cap_task_fix_setuid(struct cred *new, const struct cred *old, int flags)
 	case LSM_SETID_FS:
 		/* juggle the capabilities to follow FSUID changes, unless
 		 * otherwise suppressed
-		 *
-		 * FIXME - is fsuser used for all CAP_FS_MASK capabilities?
-		 *          if not, we might be a bit too harsh here.
 		 */
 		if (!issecure(SECURE_NO_SETUID_FIXUP)) {
 			kuid_t root_uid = make_kuid(old->user_ns, 0);
Signature · 1 line
2.51.0