Skip to content

Commit

Permalink
SafeSetID: fix UID printed instead of GID
Browse files Browse the repository at this point in the history
pr_warn message clearly says that GID should be printed,
but we have UID there. Let's fix that.

Found accidentally during the work on isolated user namespaces.

Signed-off-by: Alexander Mikhalitsyn <[email protected]>
[PM: fix spelling errors in description, subject tweak]
Signed-off-by: Paul Moore <[email protected]>
  • Loading branch information
mihalicyn authored and pcmoore committed Jun 21, 2023
1 parent b432b55 commit 970ebb8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion security/safesetid/lsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ static int safesetid_security_capable(const struct cred *cred,
* set*gid() (e.g. setting up userns gid mappings).
*/
pr_warn("Operation requires CAP_SETGID, which is not available to GID %u for operations besides approved set*gid transitions\n",
__kuid_val(cred->uid));
__kgid_val(cred->gid));
return -EPERM;
default:
/* Error, the only capabilities were checking for is CAP_SETUID/GID */
Expand Down

0 comments on commit 970ebb8

Please sign in to comment.