From nobody Thu Jan 12 03:01:17 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 4Nsq7y3gz3z2qlK5; Thu, 12 Jan 2023 03:01:34 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) (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 4Nsq7x31nJz3Cdd; Thu, 12 Jan 2023 03:01:33 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=ST22VIv2; spf=pass (mx1.freebsd.org: domain of rick.macklem@gmail.com designates 2607:f8b0:4864:20::52e as permitted sender) smtp.mailfrom=rick.macklem@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-pg1-x52e.google.com with SMTP id 78so11880887pgb.8; Wed, 11 Jan 2023 19:01:33 -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=QVlrMQQBUEald2LBYCaeY+E4KhPjPTmDj5iBeV5lhW8=; b=ST22VIv2mSGLg6dHWV3jthtl5tXIKiOMaz8q06VFTZIIT92qy3Qt33Ctmmxxoxnb8d WE+pHsgKasswefvn82s+jGrSsMSg2g5YLPsD/KCZ4Lk3B+6EUCE+p6AYNVlUtrmMFY3U 75FPSqapHxe1jqVO8brlBmcA7fIuBOmGmlEIlaEYlxX/QrIS6CDXJNWJbZQzAGkYR6Yq MZkhhIj9l7sb3rXbngUZguKTLtWFA7JLGlrbEJ9TXvK94S9caMUnUKw8/RQW2KjS+t1Y gSsr3vEF0p3cj6zo47gJiY6Svdz283df1G6fLcIlyUz4aiVZonP/zfvZ3Hkb8+d0A5XC 3P8w== 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=QVlrMQQBUEald2LBYCaeY+E4KhPjPTmDj5iBeV5lhW8=; b=ajPDO7QmjbgAHVbHQik5BKbKdYV+ZUP9E25wCVN+PhQMEeA20fJ7NOpm1FRrlRPVyc +GipfRQXpFRs2cLnYrTm2BHnVLdiAvdeFgoV32BIfW2lNb0/5l5wl1/fQTBTFSeFTiVd ioS1ClVDeoIwTg4zesvp/kxYVtiAvO5yXxg6LunrjIqcCmjD2+IUIaz8CU/id3bbB/2W 3b9hU8SB9g/mtMw6JwyztmF2isa2T5d4kBeYV5e/EnJt4Y2pgLUVl0UNE6SHYx+btBIX hyCi1n3xLGYu7PuJfCYKhMXlnPoELTg985iijWDIf9ZDrgr170n0l2UoiiwbWQbbw4zS L2aA== X-Gm-Message-State: AFqh2koAySu2tyVVGjjNe505pv4pv0F2fAEuKZ07SXPeQmzz2pJ7+rP/ ij5jcgjvEYnPHqAB5YjOpDlieGJNBM5W7fGyvA== X-Google-Smtp-Source: AMrXdXuRhZO/IufM33YLrO05CLdL4w/nMDhdH9ZIwrmMLji61ZL8pa6IHnQPev5+hhFyPJMaLmE/b9/YrPScnKpr6KY= X-Received: by 2002:a05:6a00:7c1:b0:587:df39:fb19 with SMTP id n1-20020a056a0007c100b00587df39fb19mr1489182pfu.39.1673492492284; Wed, 11 Jan 2023 19:01:32 -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: Wed, 11 Jan 2023 19:01:17 -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-Spamd-Result: default: False [-4.00 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::52e:from]; TAGGED_FROM(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; MID_RHS_MATCH_FROMTLD(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; FREEMAIL_FROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; DKIM_TRACE(0.00)[gmail.com:+]; FROM_EQ_ENVFROM(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Queue-Id: 4Nsq7x31nJz3Cdd X-Spamd-Bar: --- 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). > I have reverted this patch. I found out that the long delay was caused by a misconfigured DNS (I did not have "dns" in /etc/nsswitch.conf, but did have a /etc/resolv.conf file and no route to the DNS server). I have done another commit which increases the timeout for the kernel to gssd(8) daemon upcall so that the mount does complete after about 30 seconds for this case of a misconfigured DNS and the gssd(8) daemon no longer terminates due to an upcall timeout. Thanks go to Ben for indicating that this needed further investigation. rick > 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... > > Thanks, > > Ben