aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2026-10-27 14:31:32 +0000
committerMark Johnston <markj@FreeBSD.org>2026-11-17 16:57:22 +0000
commit9bbbb1a74dc2b47c0d6660c5c9f130e31643cfda (patch)
tree316dc8c4fea2b41756d0f993967252294c440455
parentfb12aee5f42c8f598cfe18588fad9a7fd1240b56 (diff)
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
-rw-r--r--usr.sbin/gssd/gssd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/gssd/gssd.c b/usr.sbin/gssd/gssd.c
index 5a00dbdd7c97..711e10624155 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>
@@ -939,7 +940,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"
@@ -1172,7 +1174,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"