linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] LSM: SafeSetID: fix UID printed instead of GID
@ 2023-05-03  6:43 Alexander Mikhalitsyn
  2023-05-18 18:59 ` Paul Moore
  0 siblings, 1 reply; 8+ messages in thread
From: Alexander Mikhalitsyn @ 2023-05-03  6:43 UTC (permalink / raw)
  To: mortonm
  Cc: penguin-kernel, Alexander Mikhalitsyn, Paul Moore, James Morris,
	Serge E. Hallyn, linux-security-module, linux-kernel

pr_warn message clearly says that GID should be printed,
but we have UID there. Let's fix that.

Found accidentaly during the work on isolated user namespaces.

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
---
v2: __kuid_val -> __kgid_val
---
 security/safesetid/lsm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 */
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-07-04 18:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-03  6:43 [PATCH v2] LSM: SafeSetID: fix UID printed instead of GID Alexander Mikhalitsyn
2023-05-18 18:59 ` Paul Moore
2023-06-06 18:50   ` Aleksandr Mikhalitsyn
2023-06-06 21:13     ` Paul Moore
2023-06-08 18:34       ` Paul Moore
2023-06-21  0:30         ` Paul Moore
2023-06-21  7:37           ` Aleksandr Mikhalitsyn
2023-07-04 18:24             ` Micah Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).