Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F150215459
D43818.id134102.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
993 B
Referenced Files
None
Subscribers
None
D43818.id134102.diff
View Options
diff --git a/sys/fs/unionfs/union_subr.c b/sys/fs/unionfs/union_subr.c
--- a/sys/fs/unionfs/union_subr.c
+++ b/sys/fs/unionfs/union_subr.c
@@ -916,7 +916,21 @@
goto unionfs_mkshadowdir_abort;
unionfs_create_uppervattr_core(ump, &lva, &va, td);
+ /*
+ * Temporarily NUL-terminate the current pathname component.
+ * This function may be called during lookup operations in which
+ * the current pathname component is not the leaf, meaning that
+ * the NUL terminator is some distance beyond the end of the current
+ * component. This *should* be fine, as cn_namelen will still
+ * correctly indicate the length of only the current component,
+ * but ZFS in particular does not respect cn_namelen in its VOP_MKDIR
+ * implementation.
+ */
+ char *pathend = &nd.ni_cnd.cn_nameptr[nd.ni_cnd.cn_namelen];
+ char pathterm = *pathend;
+ *pathend = '\0';
error = VOP_MKDIR(udvp, &uvp, &nd.ni_cnd, &va);
+ *pathend = pathterm;
if (!error) {
unionfs_node_update(unp, uvp, td);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Mar 31, 8:07 AM (44 m, 23 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30628319
Default Alt Text
D43818.id134102.diff (993 B)
Attached To
Mode
D43818: unionfs: workaround underlying FS failing to respect cn_namelen
Attached
Detach File
Event Timeline
Log In to Comment