From nobody Wed Jan 11 21:21:40 2023 X-Original-To: dev-commits-src-main@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 4Nsgbm2S10z2rCPR; Wed, 11 Jan 2023 21:21:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nsgbm20bbz3mvP; Wed, 11 Jan 2023 21:21:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673472100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2acB04vlCxQQFzKvZZxmkAL+AeD3o3oRid43kRd8ChU=; b=yngh9hawDQuqBKU63JJ7gSNtwLx66wioe0xLramoPl6Ss/F4iVL7rB1CImfgNvq6Aeb+KF by4F7+S2hlY+1JPFRP8kwQMJ37G7WbW7j1G4IdxVm3Xn58+VxvtcUFAkcYBgtziY9+hj6z D4Ny9CLi3FRp7xbwDKdmjkL+Qzn0sfc2WvSvbG5hvMgv6wkXvALowjkmOq03vlu4qgoGkr IpOyHzzTlShTdmfm9DWHNqTeaei4uC+JjceJ3D5SBgceLh0IJ+i8vsaxK+8NGW19j+xLOQ CQmumqkkrvn+zOA23R4ZQIL7qgMeLuZKdrjCzGG3U3MCR2D1tQjhfzp4GLV4lA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673472100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2acB04vlCxQQFzKvZZxmkAL+AeD3o3oRid43kRd8ChU=; b=hHIzTsf1HDZuf0BDkVl3Dpa/RW3oBXt6e+NpkzXZHtTkPRypGTaUXuLvH5Z5+8MR0dSBE/ lfPSoAvvf36n8dWXuNTM5BfeYsDSfojiEsFYuo7Y9prp1agVwKLk+odVzIxXOHWpvbDLnl 9xNA+WPuQqG3nP/JIUmvm2rn1Tz3LFugAIc/AZfuM8+8NX9+DeKZmwPllwBsmQo7lfB/55 ugafew5PjfxSJU3uvCyqFUcfksBWMiXfIGeBAgE66EZIHxMJo7sv9JtTnUidEAplT6Ixt8 UWU8aKgzB3++J5uhnqcJwVRbtc7zA8Qb0wLAeaKFfsP5jbWO4OFR6wauhtZLVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673472100; a=rsa-sha256; cv=none; b=r9p5rZPlv7VLJ/y7/XNvMGkIRcRqIe8E6jz7diLwcAa2pg7T9jCXvtlPp3s6tKGTCoUiQX 5RPP3F8eCL7steECKCvbsyUZ97vPBtgam30w4yIIoPViS33ozZe/ZNQhLAyEASs1K1uQ53 c1QJACoRHPsos3jqsj3gXSTl4ADuYT71f0wMvLX5KW+8IEnrPt3z+oPDgcNlp2XiHoI5MF RROf1eBrkfmwfjCJbogzuy7W2K08WhI6EP7NoaJ5ZFkFGGeK/erAl6Wh0k4eyBGtkmES+X QlCKugaWUk9AHONf0ZKlK5jUvU+U7Z/1pk3pPEhh0ev/pgvRQZWPvu5rWHS99g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nsgbm13rrz137J; Wed, 11 Jan 2023 21:21:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30BLLeLQ017986; Wed, 11 Jan 2023 21:21:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30BLLeYw017985; Wed, 11 Jan 2023 21:21:40 GMT (envelope-from git) Date: Wed, 11 Jan 2023 21:21:40 GMT Message-Id: <202301112121.30BLLeYw017985@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: e3c26ce5cb41 - main - kgssapi: Increase timeout for kernel to gssd(8) upcalls List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e3c26ce5cb410e4e58e131dfea7054e0bf11e3ca Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=e3c26ce5cb410e4e58e131dfea7054e0bf11e3ca commit e3c26ce5cb410e4e58e131dfea7054e0bf11e3ca Author: Rick Macklem AuthorDate: 2023-01-11 21:20:31 +0000 Commit: Rick Macklem CommitDate: 2023-01-11 21:20:31 +0000 kgssapi: Increase timeout for kernel to gssd(8) upcalls It turns out that the underlying problem that caused a Kerberized NFS mount with the "gssname" option to fail was that the kernel upcall to the gssd(8) daemon would time out prematurely after 25 seconds. The gss_acquire_cred() GSSAPI library call takes about 27 seconds for the case where a desired_name argument is specified. A similarly long delay occurs when the gss_init_sec_context() call is made and the user principal's TGT has expired. Once the upcall timed out, the kernel code assumed that the gssd(8) daemon had died and closed the socket. Ironically, closing the socket did cause the gssd(8) daemon to terminate via a SIGPIPE signal. This patch increases the timeout to 5 minutes. Since a timeout should only occur when the gssd(8) daemon has died, a long timeout should be ok and seems to fix this problem. I still think that commit c33509d49a should remain in the system, since it allows the mount to complete quickly and not take nearly 30 seconds. PR: 268823 MFC after: 2 weeks --- sys/kgssapi/gss_impl.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/kgssapi/gss_impl.c b/sys/kgssapi/gss_impl.c index 07e10d0999c4..9b1277298e32 100644 --- a/sys/kgssapi/gss_impl.c +++ b/sys/kgssapi/gss_impl.c @@ -119,7 +119,17 @@ sys_gssd_syscall(struct thread *td, struct gssd_syscall_args *uap) */ if (cl != NULL) { int retry_count = 5; + struct timeval timo; CLNT_CONTROL(cl, CLSET_RETRIES, &retry_count); + + /* + * Set the timeout for an upcall to 5 minutes. The + * default of 25 seconds is not long enough for some + * gss_XXX() calls done by the gssd(8) daemon. + */ + timo.tv_sec = 5 * 60; + timo.tv_usec = 0; + CLNT_CONTROL(cl, CLSET_TIMEOUT, &timo); } } else cl = NULL;