From nobody Fri Oct 13 23:53:50 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 4S6jyR2Nhhz4wy54; Fri, 13 Oct 2023 23:53:51 +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 4S6jyR0m4Hz3JnR; Fri, 13 Oct 2023 23:53:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697241231; 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=zz7AVoSsSrkNdW0LrOw4hoBQutc9UOMi/9VtAwEEUYg=; b=tr/sDJrgMRfSIfm/1XL4FIpdaqvEaHkZW/dVnfy3DtmHeCdSaBfDNGPxGvzJ3R1T6cdF5+ bzwsMmtaC6BeV7YUE9rLfgpkA41ZCC+WOcRGkcxu6027BdrMycaAfovaQXZd0HHUz4PMxQ T8q/7ep8I2x6JDvoGhkPo/+ICvDP8CjJSYn9P7RCo4HRTjidWw1s2/Exh0hadUK3WQL5O+ xwsEGPTmkpcRq+zJaYIVIFiHOsqIxwSOQlSslzvk78Mxs6TIORkVh0lECjdrNUdmf/8OdQ RzgyEFOpOXcKa7fGPKISwKLQo8hxcDVBGjIv9IXrg+knJDi3gh2dveh9C0Y3jA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1697241231; a=rsa-sha256; cv=none; b=QMD+ZQUKbGA2L/5ithWYXMLXbylY3Xkx3bnll8sF/Ih8BXOeE+UJx2xUuiYYZIkd/AzqNZ ORSfs3AtiBYHKrkuAx4PZmrrPE9WGPqPa+p+8URwefI7N8UmNZBKJX9c5rOVLKeP0Mf3cF 09jBU9YIr9Ab6GsELIQuiWmLhrFUfQRgMF0Jp+2EUgeHRi/E/Op3q4DYcgVvUQ0r5e1y57 V7MgXU1X0q5ZEb9Q3XZHmyPBlIr+dsa6sVoLbHoV/H2a16l8vqM2eyfGLBVyPrVdixJjdK QTiQK6Ln0K5bFjGr3ymdlr7wUIaOVYYASa6zYgNDP4vcKr9dIYljcBPz00tylg== 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=1697241231; 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=zz7AVoSsSrkNdW0LrOw4hoBQutc9UOMi/9VtAwEEUYg=; b=dnCv8lZZwXk+D135GdVxdbeZIqDlWW3tcqk4lEHlWKQpwXInppmtXPxVp+3OZSqzbSeynU shvvmBsxqeYnmcBrvxQi+kuuZmPrMSdyT4ZPY1/lubPt5ZEypZyZP/mJpSYoS1XTzdfXV0 +2Jgb34LtuVajwO5ar+DNgVbah5jifaJkcTVG4yD1KGz4MBCk6LyRtjPyB8wzmjMi1Br2Z K+g+JeMqqVv2eF/+MW2w4H+Axchd9p6n1LAWJ9dOfR1EguyYL4iN6MBDwwTsLo5q2y9bcc /Qvf1M17WP5WFbaIYTSEE/uJ9ugijM+DaPu4bP1dQh33SeVbKlYj3B4R6jERgA== 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 4S6jyQ6zqSz17c0; Fri, 13 Oct 2023 23:53: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 39DNrodX032057; Fri, 13 Oct 2023 23:53:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39DNroMH032054; Fri, 13 Oct 2023 23:53:50 GMT (envelope-from git) Date: Fri, 13 Oct 2023 23:53:50 GMT Message-Id: <202310132353.39DNroMH032054@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: 4cadd75a3b0d - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: 4cadd75a3b0d3c5d7b52f1b93c64836af8a212bc Auto-Submitted: auto-generated The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=4cadd75a3b0d3c5d7b52f1b93c64836af8a212bc commit 4cadd75a3b0d3c5d7b52f1b93c64836af8a212bc Author: Mateusz Guzik AuthorDate: 2023-10-05 12:32:29 +0000 Commit: Mateusz Guzik CommitDate: 2023-10-13 23:48:12 +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 49e66803a1d1..60e366068392 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -1751,6 +1751,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: