Page MenuHomeFreeBSD

D38051.diff
No OneTemporary

D38051.diff

diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c
--- a/sys/fs/tmpfs/tmpfs_vnops.c
+++ b/sys/fs/tmpfs/tmpfs_vnops.c
@@ -1029,6 +1029,15 @@
}
}
+ /*
+ * Avoid manipulating '.' and '..' entries.
+ */
+ if ((fcnp->cn_flags & ISDOTDOT) != 0 ||
+ (fcnp->cn_namelen == 1 && fcnp->cn_nameptr[0] == '.')) {
+ error = EINVAL;
+ goto out_locked;
+ }
+
if (tvp != NULL)
vn_seqc_write_begin(tvp);
vn_seqc_write_begin(tdvp);
@@ -1044,8 +1053,7 @@
de = tmpfs_dir_lookup(fdnode, fnode, fcnp);
/*
- * Entry can disappear before we lock fdvp,
- * also avoid manipulating '.' and '..' entries.
+ * Entry can disappear before we lock fdvp.
*/
if (de == NULL) {
if ((fcnp->cn_flags & ISDOTDOT) != 0 ||

File Metadata

Mime Type
text/plain
Expires
Tue, Feb 11, 11:08 AM (12 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16593967
Default Alt Text
D38051.diff (741 B)

Event Timeline