From: Alexander Mikhalitsyn Date: Wed, 3 May 2023 06:43:44 +0000 (+0200) Subject: SafeSetID: fix UID printed instead of GID X-Git-Tag: xarray-6.6~278^2~1 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=970ebb8a26a120340dcbb4e6c2fb4ecfbad0d190;p=users%2Fwilly%2Fxarray.git SafeSetID: fix UID printed instead of GID 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 [PM: fix spelling errors in description, subject tweak] Signed-off-by: Paul Moore --- diff --git a/security/safesetid/lsm.c b/security/safesetid/lsm.c index e806739f7868..5be5894aa0ea 100644 --- a/security/safesetid/lsm.c +++ b/security/safesetid/lsm.c @@ -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 */