git: 0ed72563c53b - releng/15.1 - gssd: Fix unix credential squashing when accepting a context
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 17 Nov 2026 17:08:08 UTC
The branch releng/15.1 has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=0ed72563c53b815b6633167c987c78425523ee61
commit 0ed72563c53b815b6633167c987c78425523ee61
Author: Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2026-10-27 14:31:32 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2026-11-16 21:21:08 +0000
gssd: Fix unix credential squashing when accepting a context
gssd_accept_sec_context_lucid_v1_1_svc() handles context acceptance when
MIT Kerberos is in use. Its last operation is to map the Kerberos
principal to a local credential subsequently used by the NFS server for
the authenticated session.
If it fails to resolve the principal to a local user, it is supposed to
squash the client's credentials. However, it failed to set the UID
field, which will end up set to zero, corresponding to the root user on
the server. As a result, an authenticated principal that doesn't map to
a local user ends up being treated as UID 0.
Fix this. Use names for the nobody user and group.
Approved by: so
Security: FreeBSD-SA-26:78.gssd
Security: CVE-2026-101315
Reported by: Erik Power
Reported by: SecBuddyF, Tencent KeenLab
Reviewed by: rmacklem, cy
Fixes: e3ac01e18eb3 ("kgssapi: Fix the kgssapi so that it can use MIT Kerberos")
Sponsored by: The FreeBSD Foundation
---
usr.sbin/gssd/gssd.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/usr.sbin/gssd/gssd.c b/usr.sbin/gssd/gssd.c
index 54d2062dd29a..a939312633c1 100644
--- a/usr.sbin/gssd/gssd.c
+++ b/usr.sbin/gssd/gssd.c
@@ -28,6 +28,7 @@
*/
#include <sys/param.h>
+#include <sys/conf.h>
#include <sys/stat.h>
#include <sys/linker.h>
#include <sys/module.h>
@@ -951,7 +952,8 @@ gssd_accept_sec_context_lucid_v1_1_svc(accept_sec_context_lucid_v1_args *argp,
result->gidlist.gidlist_val[i] =
groups[i];
} else {
- result->gid = 65534;
+ result->uid = UID_NOBODY;
+ result->gid = GID_NOBODY;
result->gidlist.gidlist_len = 0;
result->gidlist.gidlist_val = NULL;
gssd_verbose_out("gssd_pname_to_uid: mapped"
@@ -1184,7 +1186,7 @@ gssd_pname_to_uid_1_svc(pname_to_uid_args *argp, pname_to_uid_res *result, struc
" to uid=%d, gid=%d\n", (int)result->uid,
(int)result->gid);
} else {
- result->gid = 65534;
+ result->gid = GID_NOBODY;
result->gidlist.gidlist_len = 0;
result->gidlist.gidlist_val = NULL;
gssd_verbose_out("gssd_pname_to_uid: mapped"