aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2023-10-05 12:32:29 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2023-10-09 23:19:00 +0000
commit99bfb6998b00ac8edd1395d76d199ddee62d24a0 (patch)
tree9e281a0ac26b12eaa2e90ed990bfb400648dc0dd
parentb206bfb92c1f522c85ef1db44d42431e6c0d9334 (diff)
downloadsrc-99bfb6998b00ac8edd1395d76d199ddee62d24a0.tar.gz
src-99bfb6998b00ac8edd1395d76d199ddee62d24a0.zip
vfs cache: denote a known bug in cache_remove_cnp
(cherry picked from commit cd2105d691f446f7dbddf5965d82b9e9103bc8d2)
-rw-r--r--sys/kern/vfs_cache.c9
1 files changed, 9 insertions, 0 deletions
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: