From nobody Sun Jan 08 15:52:46 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NqhRt4bR5z2pGLn; Sun, 8 Jan 2023 15:52:58 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NqhRt2GHcz447V; Sun, 8 Jan 2023 15:52:58 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pf1-x42a.google.com with SMTP id i65so992117pfc.0; Sun, 08 Jan 2023 07:52:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=28uGTxx3uzN/Qy8FkDM3QwsX4YR5WTZT2WtavMyc7s4=; b=Z8HMUfcp0guI2TgLxHRVvFXCbfMu3LqWL6w+Gr9AO8jDKbtzMTe5GXIUX5qbEmQt9Z xuX98pej9j4mFwQX3Pf9RFc7nuC3m0ObfjaUT5ImMo+dMADDgPaC+2S7J/Ci4hhYOcWg KUgqbH3yAs9E2B7uInFafff7fT41jMrTv6OOvrIijn0tK0Xg14p0yaRtWDKbknO0g7zd kXV/BHnS8rGPwmjyghxrJOjee3e3zdVkUf+rwrmc9DkwF/kqPVs24n/biSL/SP2i+HR1 OlRNaOC/7DDESb5EX37yZnHL+ujpzAYsDbm/yCv2aYiq95SAxvJnCtOnmt824yJw+z7z 7sNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=28uGTxx3uzN/Qy8FkDM3QwsX4YR5WTZT2WtavMyc7s4=; b=1c5S0DIJSxKJ9l80boNjNbNZaci3JL0AmVcXL/9yeTVa+skVHi7QXo1mneJiR2Qi3w jJAzs1ckNqmDil1FjbvhwVrVawg+P1S5SznxXtNZd9CbKcNsUVhPg8U96AMuKfp+O5NX q2ciTM/oxRcWodA+tck9hoYDpfYyWPM2NI3ScWhTVGGRCqdfGXTuKIpsSx5Eu2LyY0sc OvvBuEj4M+UgoMOWDegGkvmdubvHIDVMP4N4a6fp8vS/BWFcRWRs2mmrC7uZekHhqM7s nn1kVgWhGkgkSBjVQicXpFlf4paPSZwJyn3Zv5/xgBo2HkJ+aO0POHccL+2trsD/3UVr fcsQ== X-Gm-Message-State: AFqh2kotGJr0dEkcGMi2tni3zQ08Mz4nkBjQR0AQtoqaftvxNxjhUYkt Oe1csvf0vD2wv/t0JPxUpbDcrLZvZQfjxWPrFVfCIbI= X-Google-Smtp-Source: AMrXdXvQii3FYOwIxtw8FBvUDUgnDGRUX4fi20iLdViyVKEeg+NJO4bXFfu1uHWUOpQQK369xlaYlGZgzTL7brA2J6E= X-Received: by 2002:a63:5060:0:b0:481:b7b1:1e44 with SMTP id q32-20020a635060000000b00481b7b11e44mr4569538pgl.47.1673193177045; Sun, 08 Jan 2023 07:52:57 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202301072150.307LokNm093592@gitrepo.freebsd.org> In-Reply-To: From: Rick Macklem Date: Sun, 8 Jan 2023 07:52:46 -0800 Message-ID: Subject: Re: git: c33509d49a6f - main - gssd: Fix handling of the gssname= NFS mount option To: Benjamin Kaduk Cc: Rick Macklem , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4NqhRt2GHcz447V X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Sat, Jan 7, 2023 at 6:04 PM Benjamin Kaduk wrote: > > CAUTION: This email originated from outside of the University of Guelph. Do not click links or open attachments unless you recognize the sender and know the content is safe. If in doubt, forward suspicious emails to IThelp@uoguelph.ca > > On Sat, Jan 7, 2023 at 1:50 PM Rick Macklem wrote: >> >> The branch main has been updated by rmacklem: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=c33509d49a6fdcf86ef280a78f428d3cb7012c4a >> >> commit c33509d49a6fdcf86ef280a78f428d3cb7012c4a >> Author: Rick Macklem >> AuthorDate: 2023-01-07 21:49:25 +0000 >> Commit: Rick Macklem >> CommitDate: 2023-01-07 21:49:25 +0000 >> >> gssd: Fix handling of the gssname= NFS mount option >> >> If an NFS mount using "sec=krb5[ip],gssname=" is >> done, the gssd daemon fails. There is a long delay >> (several seconds) in the gss_acquire_cred() call and then >> it returns success, but the credentials returned are >> junk. >> >> I have no idea how long this has been broken, due to some >> change in the Heimdal gssapi library call, but I suspect >> it has been quite some time. >> >> Anyhow, it turns out that replacing the "desired_name" >> argument with GSS_C_NO_NAME fixes the problem. >> Replacing the argument should not be a problem, since the >> TGT for the host based initiator credential in the default >> keytab file should be the only TGT in the gssd'd credential >> cache (which is not the one for uid 0). >> >> I will try and determine if FreeBSD13 and/or FreeBSD12 >> needs this same fix and will MFC if they need the fix. >> >> This problem only affected Kerberized NFS mounts when the >> "gssname" mount option was used. Other Kerberized NFS >> mount cases already used GSS_C_NO_NAME and work ok. >> A workaround if you do not have this patch is to do a >> "kinit -k host/FQDN" as root on the machine, followed by >> the Kerberized NFS mount without the "gssname" mount >> option. >> > > > Hi Rick, > > This doesn't seem like a good long-term fix. > If we're going to have a gssname argument, we should actually make > it take effect, rather than silently ignoring it, which is what using GSS_C_NO_NAME > does (it indicates the use of "any credential", which ends up meaning the > default credential when used on a GSS initiator). > The gssname argument still does take effect. The code in gssd.c does essentially a "kinit -k " into a specific credential cache (/tmp/krb5cc_gssd or close to that). Then the gss_acquire_cred() uses that credential cache, which should never have any other TGT in it. > It should be possible to inspect the "junk" credential from gss_acquire_cred() > and learn more about what happened (perhaps a non-kerberos mechanismm was > picked, or the name was in the wrong format) using various gss_inquire_*() calls, > as a diagnostic measure. Unfortunately I don't anticipate having a huge amount of time > to put into it anytime soon... I suspect the problem might be that "desired_name" appears to be in the Kerberos form (host/nfs-client.domain) and not the GSSAPI form (host@nfs-client.domain), but I'm not sure how the code in gssd.c could change it? Maybe it can (re)import the name after replacing the '/' with a '@', but I have not tried this. As above, I think the fix is ok, rick > > Thanks, > > Ben