From nobody Sun May 01 20:42:41 2022 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 C512F1ABD7CA; Sun, 1 May 2022 20:42:41 +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 4KrypT4rWZz3tRQ; Sun, 1 May 2022 20:42:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651437761; 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=e9+nHBESj0htn019EiRtst2+Qyxo/6SJ6mUV4mEqDS8=; b=vVh0NcUhS8JiU2mQQOp/Wi1nwWfb2RqrB+6jjw1WhYuagLFGlVyZN/OdpyM1I+kF+BIBFY tblJT3PFOnyW/5WvfgJwXRnuT7v7AMI/TbohOfg0W6xAh+OPgJj8PkzZKabs5rRqCCU572 2GL378lve/w+xck0HzDbJkXfDEtvQuoi4fR4p8NGOGHSFjpcUmSQ8WehHWrfQ/6Rql/ODx kq9cKt529XE4W6uRZPQhWXiH8qmDQr5gYGVKHuCRrAKD80f5x5i9ejXssEUDRZGTkJUxoX e+DmJHgInjrQmvoeaLvWkyBCcK3pc9kExk4ZsMQZxqwtk5a057tHX1EQwmcGlg== 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 7C8971C8AE; Sun, 1 May 2022 20:42:41 +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 241Kgfqn033650; Sun, 1 May 2022 20:42:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 241Kgfnh033649; Sun, 1 May 2022 20:42:41 GMT (envelope-from git) Date: Sun, 1 May 2022 20:42:41 GMT Message-Id: <202205012042.241Kgfnh033649@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: 47d75c29f551 - main - nfsd: Add a sanity check to SecinfoNoname for file type 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 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: 47d75c29f5510ad844f0bc7fbc07d481ebb7fd9e Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651437761; 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=e9+nHBESj0htn019EiRtst2+Qyxo/6SJ6mUV4mEqDS8=; b=iNKYTO2Q4RfMWH35Ygj+MzfUNA2wHT5rwy0UbdWQZo8ZGzqmkYAhngGIG/bqpxEQSkpq4A 2USrmfdICufDRS9HiCE5gBkwZzupP/LfTK0cZ+slQVgVUQiVELSIC5aB58RjjvDYC/z8bA hjA9FH+CXK7y8t9PZ0ePo6fQcsSmHOMo1s0TN0mkfZQQKnuuKmEvY0qHbi31S+F70mdp7C EiVDvrCPBavJNv2kTChApoPWPHVNgaiy19XQDqfnxMurHUXO6b7My3iIcnWDRxG+wcwauc VYKmmoClnvWMZy1uCXhwdYnokGt1SEgPLEElV3a3UBcBxTvTbWnns/AB2U/LYA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1651437761; a=rsa-sha256; cv=none; b=w28q03k8GUIc7zzCfnLp5vJx9q/IJo11kfUyRqEe5ysX4SLRBmudoBr+8UH5of/hTzurxQ PjGxxQA+6PSz/kDAIUi7UPlJbosHLVq/EJah5K+pWPnmc2/NQuTZU+8x4uE+4qZjf8Vgxw o6DAF09V8xx9cBXOBtceWE/ru3lf1sqkO9L4XztBZYjirTWArSgAGKCAl8KHBG7oOSO3LC aTt3x0LVENDNxVVDh2eVa8i+i5e2GmUPVp2g5vt9yC/HxAgQ49CmrsFJUuHQzdSSsFWst6 lq/dc276L+qyIMH8K53UfWjpmJHoMpbTndReZgTDOf5zsHDfCHN/yijamnMZsQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=47d75c29f5510ad844f0bc7fbc07d481ebb7fd9e commit 47d75c29f5510ad844f0bc7fbc07d481ebb7fd9e Author: Rick Macklem AuthorDate: 2022-05-01 20:41:31 +0000 Commit: Rick Macklem CommitDate: 2022-05-01 20:41:31 +0000 nfsd: Add a sanity check to SecinfoNoname for file type Robert Morris reported that, for the case of SecinfoNoname with the Parent option, providing a non-directory could cause a crash. This patch adds a sanity check for v_type == VDIR for this case, to avoid the crash. Reported by: rtm@lcs.mit.edu PR: 260300 MFC after: 2 weeks --- sys/fs/nfsserver/nfs_nfsdserv.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c index 21d8fe05c0ad..3f896effd8ce 100644 --- a/sys/fs/nfsserver/nfs_nfsdserv.c +++ b/sys/fs/nfsserver/nfs_nfsdserv.c @@ -3822,6 +3822,11 @@ nfsrvd_secinfononame(struct nfsrv_descript *nd, int isdgram, fhstyle = fxdr_unsigned(int, *tl); switch (fhstyle) { case NFSSECINFONONAME_PARENT: + if (dp->v_type != VDIR) { + vput(dp); + nd->nd_repstat = NFSERR_NOTDIR; + goto nfsmout; + } NFSNAMEICNDSET(&named.ni_cnd, nd->nd_cred, LOOKUP, LOCKLEAF | SAVESTART); nfsvno_setpathbuf(&named, &bufp, &hashp);