Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Oct 2023 23:53:50 GMT
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 4cadd75a3b0d - stable/13 - vfs cache: denote a known bug in cache_remove_cnp
Message-ID:  <202310132353.39DNroMH032054@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by mjg:

URL: https://cgit.FreeBSD.org/src/commit/?id=4cadd75a3b0d3c5d7b52f1b93c64836af8a212bc

commit 4cadd75a3b0d3c5d7b52f1b93c64836af8a212bc
Author:     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2023-10-05 12:32:29 +0000
Commit:     Mateusz Guzik <mjg@FreeBSD.org>
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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202310132353.39DNroMH032054>