From nobody Sun Oct 17 08:45:21 2021 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 EE90E17F335E; Sun, 17 Oct 2021 08:45:21 +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 4HXD9F6Q9fz3Htj; Sun, 17 Oct 2021 08:45:21 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 BD0761F38; Sun, 17 Oct 2021 08:45:21 +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 19H8jLQI006819; Sun, 17 Oct 2021 08:45:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19H8jL6x006818; Sun, 17 Oct 2021 08:45:21 GMT (envelope-from git) Date: Sun, 17 Oct 2021 08:45:21 GMT Message-Id: <202110170845.19H8jL6x006818@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 1045352f1503 - main - cache: only assert on flags when dealing with EMPTYPATH 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: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1045352f150346ba422b3a3ce6344fc694bc3aa4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=1045352f150346ba422b3a3ce6344fc694bc3aa4 commit 1045352f150346ba422b3a3ce6344fc694bc3aa4 Author: Mateusz Guzik AuthorDate: 2021-10-17 08:40:16 +0000 Commit: Mateusz Guzik CommitDate: 2021-10-17 08:42:47 +0000 cache: only assert on flags when dealing with EMPTYPATH Reported by: syzbot+bd48ee0843206a09e6b8@syzkaller.appspotmail.com Fixes: 7dd419cabc6bb9e0 ("cache: add empty path support") --- sys/kern/vfs_cache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index c1a3b0dab1e8..656f446b7394 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -4787,13 +4787,14 @@ cache_fplookup_emptypath(struct cache_fpl *fpl) tvp_seqc = fpl->tvp_seqc; MPASS(*cnp->cn_pnbuf == '\0'); - MPASS((cnp->cn_flags & (LOCKPARENT | WANTPARENT)) == 0); if (__predict_false((cnp->cn_flags & EMPTYPATH) == 0)) { cache_fpl_smr_exit(fpl); return (cache_fpl_handled_error(fpl, ENOENT)); } + MPASS((cnp->cn_flags & (LOCKPARENT | WANTPARENT)) == 0); + tvs = vget_prep_smr(tvp); cache_fpl_smr_exit(fpl); if (__predict_false(tvs == VGET_NONE)) {