From nobody Thu Oct 05 12:44:50 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 4S1WVB4g7hz4wZp1; Thu, 5 Oct 2023 12:44:50 +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 4S1WVB41Gjz4CYb; Thu, 5 Oct 2023 12:44:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696509890; 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=1rl8tUNqrMM1534FurhcO+jWmTw5C+unksvZUGJaT10=; b=ImXQEEnGZPSUAT16X4s+dXhREwq8R/o66X9wEk43mkqYZchUrwCqjFU7a1nSOi225v/qjB O/5MYIPlTmHsL7cRzRAcptKDxTMPmKkOPMQChpM2/KUazmqg8WuJhhdx920fDuZPjDiv24 92EOn1tyHm7LGp85is9tz2gcx0FBDqUWLJ0KoAjhIzFyfdEZsemhn9uiNH2CfK6U5CgYyo J4MYTOff8eWdBU6F1RklOfbvi0R0Bk7et6mLQrHHmFbwmPqPW9xzH4eRknjJQCNsxpwAxM bAf+gsaHxXwMakG9t791klWvmMFZTum44jMNVrmz1wcA43xvugBMoIlJTDbUyg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696509890; a=rsa-sha256; cv=none; b=pwRn5soMdGJrYhoeWUlUOzpL0XEOE80Y9YtBk9nP0Iou3w5BP89mRAe0UPlyD4q0AJ9Ejo GRV65SFPVvIqtRTaepwwAhXtB8v0HBQM1L3kB1ETYjTVdUm8b2DcsuDPLLP8KqgtSdLiKJ 5h8UfZZpWSYNbQb6L3iKVvfJvmuWhbqnf1rS5QzdZxxQlo6PsF3Y3gHDOCWfr0URDQ7RiR Dn8q0SpMjY3HYbQyszd4UA4Njvlynkw8Fc1xoue3/ET7xMIwK1C0cWRwqZjUIWfh22JvAE hWwp3OPcLIB/3oRcRHg8n+oZ6fprkvBzvb9cYgdgEShLqilUOMgjuZboixxPsA== 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=1696509890; 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=1rl8tUNqrMM1534FurhcO+jWmTw5C+unksvZUGJaT10=; b=io2FP73KaT3wTMHC+Hodd7dzQJUXgnHeedNRD9qH1yEgMmlq6rY2VVHazjdJdB0mE3Byxm GObh3C5eD3vAOKr8d9Qp3BWCWjN4tUDPmUgvoYYaTovukRNl92o9+fqOzqihKp9hT5SxMq jMgf9JGaEBc3jIEIMrqPJwp/QwoWA8ailAYDwwECMQVAuw33W178AhR/YN3wCKDUPq7hy5 Nm02gPMfHeS3hkBjM4MMnXB98rfmJbVzfWneV0dnFbYmWfX6LGES6ek7sFT6/qi4fUekMa 2eimY4IuZmkl/5Wlvw55AWcwl1geo1O3KXrTtND7eArFDbQzKKxlOKwitJv6QA== 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 4S1WVB34Lkz1KlB; Thu, 5 Oct 2023 12:44:50 +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 395CioLa027461; Thu, 5 Oct 2023 12:44:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 395CioXl027458; Thu, 5 Oct 2023 12:44:50 GMT (envelope-from git) Date: Thu, 5 Oct 2023 12:44:50 GMT Message-Id: <202310051244.395CioXl027458@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: cd2105d691f4 - main - vfs cache: denote a known bug in cache_remove_cnp 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: cd2105d691f446f7dbddf5965d82b9e9103bc8d2 Auto-Submitted: auto-generated The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=cd2105d691f446f7dbddf5965d82b9e9103bc8d2 commit cd2105d691f446f7dbddf5965d82b9e9103bc8d2 Author: Mateusz Guzik AuthorDate: 2023-10-05 12:32:29 +0000 Commit: Mateusz Guzik CommitDate: 2023-10-05 12:44:43 +0000 vfs cache: denote a known bug in cache_remove_cnp --- 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 560ff7d441c0..cc2f405d5281 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -1822,6 +1822,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: