From nobody Tue May 28 02:23:37 2024 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 4VpGXV1dj8z5LJNQ; Tue, 28 May 2024 02:23:38 +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 4VpGXV0j8Yz4PvZ; Tue, 28 May 2024 02:23:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716863018; 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=lGKyUShqLkp6+zO+GQ6sxj5mJHqiWojxvCop1jRY3lM=; b=kdE13afAGobM7oLHMQmQrXiPqirswVFs5suolnDoLnoG/QHnN/R62bjXeN6iyhmPzALUrD QW8DYk5yCdzckAdGN5R/ewsge+0ulKeoRH5MiG6HmGx8oG4cv1h6W65DlZaP+mc3lYjM0q 8YBznMjDPoWl30PIxrrQ4a1WAUHEIwMvC1kL3Z5yDvwwmQleviYoZJQXfafGunMqSEAnfd eMJVM2Qkpp5BTYUZrTYnJ+jOd3uodrIl0MAxIOeOxrMWK8YK4uyC1MPV41BJKPrUFE0Gvt /UOnAAOZjOOl4zGuWBiJYvkx9MAYTAAuZ8ZGwD5kPrRyOxUKpejHY8RuLAopnw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716863018; a=rsa-sha256; cv=none; b=l+H+Yiyn/LL3V7E6H+grxng56pAWSc+nfpMfSBRJvnNwTjXdFxB9leV80U0nPAXuIrSUzv Y5KSSHQmqGv46eSRDkmRvM4n6F7tSd9x5ER52tZeZpNdnHK5/EbTf2TWaAgRwFeUbaHrDu pzW4F7ZEnKUPO1BDaUcycJYbfDBkbd5N9cSd+dAAs6F8HoZNNND6o6Ldl7mkRyDeTl60T2 4bWkYoVTKlQZVbTOFzgtp+gLlxUF71d2GwTSonZSaGHSdxSjFte4i6kRJJy20ZPJXQANhj uKHf6b89ORUwNvflgllFvyZ0ygv0ZceAylL5/PGx65DYfWNG1u/MG6gJ8mkLew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716863018; 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=lGKyUShqLkp6+zO+GQ6sxj5mJHqiWojxvCop1jRY3lM=; b=mUk4vwURxT9PE2P+ymNPV9v5uSduymykrLoBMcOGGF+0xHNimsFL50jk0lpq22THBBMCOt G4uYZuHY2OsIbz3ClrBnaJ/E9G9e991VvwJxiKMIVXMoH0VVZSSTkdNYhrkoAlGappFEkj 3uCc6TTU/RDps7kVLKL+Beyv3Zz/cdRaSHgWr5CXBpR8TFfr1dWcCiuf19/Mgj0ua1o+t/ u3BztzFc0ODuiDjuTZ9gadIunlE3JU5Tk8hNW+UvbyS+yNIkIo8WhggzyuyIdTGBj0bQL4 rkDvQRrORhfMJLt9Csn4tMMpCjaFLxx6ILyzdrk/lBl7JASKvhCRlYxqbweuAg== 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 4VpGXV0JTgz18dw; Tue, 28 May 2024 02:23:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44S2NbeY011261; Tue, 28 May 2024 02:23:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44S2Nbv3011258; Tue, 28 May 2024 02:23:37 GMT (envelope-from git) Date: Tue, 28 May 2024 02:23:37 GMT Message-Id: <202405280223.44S2Nbv3011258@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: 6c9170e0afc4 - main - svc.c: Check for a non-NULL xp_socket 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: 6c9170e0afc4ebec81ba88a6370ebf6cb55520ba Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=6c9170e0afc4ebec81ba88a6370ebf6cb55520ba commit 6c9170e0afc4ebec81ba88a6370ebf6cb55520ba Author: Rick Macklem AuthorDate: 2024-05-28 02:22:04 +0000 Commit: Rick Macklem CommitDate: 2024-05-28 02:22:04 +0000 svc.c: Check for a non-NULL xp_socket Commit a16ff32f04b5 added support to the kernel RPC to set TCP_USE_DDP. However, for the unusual case of a NFSv4.1/4.2 non-NULL callback, the xp_socket field of SVCXPRT is NULL, since it uses the same socket as the client->server connection. This patch adds the check for this to avoid crashes. This only affects NFSv4.1/4.2 mounts where either pNFS or delegations are in use. MFC after: 3 days --- sys/rpc/svc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/rpc/svc.c b/sys/rpc/svc.c index 99678f693a3e..f94e744d40f4 100644 --- a/sys/rpc/svc.c +++ b/sys/rpc/svc.c @@ -996,6 +996,7 @@ svc_getreq(SVCXPRT *xprt, struct svc_req **rqstp_ret) * enable TLS offload first. */ if (xprt->xp_doneddp == 0 && r->rq_proc != NULLPROC && + xprt->xp_socket != NULL && atomic_cmpset_int(&xprt->xp_doneddp, 0, 1)) { if (xprt->xp_socket->so_proto->pr_protocol == IPPROTO_TCP) {