From nobody Mon Oct 09 23:19:14 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 4S4FNM3S2vz4whMq; Mon, 9 Oct 2023 23:19:15 +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 4S4FNL4dztz3WJT; Mon, 9 Oct 2023 23:19:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696893554; 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=v6/rZqrqrUUKeDGTtnecXlX5yYBi7BrnglZfjJI3CAk=; b=j8a86IbmAbuLkkNmjmgT6YsAzyOQVdswgr+o/jKba/3f76z0U34qtDb7L25RmWCmqJQzX5 SGdbYK++3s+oOhkOuG2npTSCc1EoRKPJ8a+vzTIMg2dN/LL9jly0HD/iYWWLglPaZJqOr8 g7xWuxpAr7FwpGW1k6t8txjhTo6Oalwtax4qOYTbZELoLm6Imaus0t5oIfopfgV+9Gg19f 1KzSbfol9mAFF87y4sTaAuzPxyxByoRImXwH58HYcxBA3dGmg/Gk/4vq8RAVPVxZVrEec8 shIY67RD9ljuJgyTeJ5Gj08grvyJeaaBbe8dAjBONf4jztsgMogOriDsnEDd/g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696893554; a=rsa-sha256; cv=none; b=MMMZI4r7HLcpKeY5piJoQ062/hOnu4F93JyyMxrqIXV8Uohw63iUBAOfuACJ1R7u4rA/0J UyKnC8ufvv0fpgd/G1cAU3YN+J4i3q7g/csGkKff9MKzasg6cOcuBRIXKMiPcoZyhNkBUd VuGGPAdeHwkfLeu+0LzTeTzGxYUbSm+E4/Hw7F/UE7opwW6gS5qf4OxSZKdg1QFYnrIxy9 cUGjop1FMx0Omv+9gvkZRKo6cLKEMlpOPvNmj5kl/PmPo04eqCae5rRH+kPfrDzb2XbD7W 4U1ae7v6arqO6ZAOqqZSiGR4Y6vYETQi8XSTncJKNL7f2xtQ0wmhBJAxLcOKuQ== 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=1696893554; 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=v6/rZqrqrUUKeDGTtnecXlX5yYBi7BrnglZfjJI3CAk=; b=SQG7nfZ2NLV50R7FQV8oC6QjkXN+f5BWsKokfRW3XTC8ielDOQUzwZ8IQFYnGlAhqTLcfj Ds5aEnSNONn/K9iUAOCI2td7yR6x6S8LV3vrr0Rz5No4GE9BKLgeeJRTSIjQ0M1PwdN5CI poSRRlgJMRkL57H1zpT7q4oLgzq6iApT7hQtGmH/sfN0fGHkXW1EYqTP6ayGnyYXiliFyC GUUBhrsBuZfQoOYFyKdCib8Kdtp3kKmMT479izRQ/QLaFF7t0Ad3cHCE+v5A10BR842DUt rsqN6vCcZc+tYfQ63Q7u+SjGM095jx24X/hqmHMe5J1Hhl9XUS9sjMA0zd6uhg== 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 4S4FNL23PXzlN; Mon, 9 Oct 2023 23:19:14 +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 399NJEV2072797; Mon, 9 Oct 2023 23:19:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 399NJE7u072794; Mon, 9 Oct 2023 23:19:14 GMT (envelope-from git) Date: Mon, 9 Oct 2023 23:19:14 GMT Message-Id: <202310092319.399NJE7u072794@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 99bfb6998b00 - stable/14 - vfs cache: denote a known bug in cache_remove_cnp 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: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 99bfb6998b00ac8edd1395d76d199ddee62d24a0 Auto-Submitted: auto-generated The branch stable/14 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=99bfb6998b00ac8edd1395d76d199ddee62d24a0 commit 99bfb6998b00ac8edd1395d76d199ddee62d24a0 Author: Mateusz Guzik AuthorDate: 2023-10-05 12:32:29 +0000 Commit: Mateusz Guzik CommitDate: 2023-10-09 23:19:00 +0000 vfs cache: denote a known bug in cache_remove_cnp (cherry picked from commit cd2105d691f446f7dbddf5965d82b9e9103bc8d2) --- sys/kern/vfs_cache.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 44295e12ee59..115d0bdd3993 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -1747,6 +1747,15 @@ retry_dotdot: return (1); } + /* + * XXX note that access here is completely unlocked with no provisions + * to keep the hash allocated. If one is sufficiently unlucky a + * parallel cache resize can reallocate the hash, unmap backing pages + * and cause the empty check below to fault. + * + * Fixing this has epsilon priority, but can be done with no overhead + * for this codepath with sufficient effort. + */ hash = cache_get_hash(cnp->cn_nameptr, cnp->cn_namelen, dvp); blp = HASH2BUCKETLOCK(hash); retry: