Skip to contentSkip to conversation

NFS: NFSv2/v3 clients should never be setting NFS_CAP_XATTR

PATCH New [email protected] 1 participant 1 message Feb 23, 2022

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 1/1 NFS: NFSv2/v3 clients should never be setting NFS_CAP_XATTR

From: Trond Myklebust <[email protected]>

Ensure that we always initialise the 'xattr_support' field in struct nfs_fsinfo, so that nfs_server_set_fsinfo() doesn't declare our NFSv2/v3 client to be capable of supporting the NFSv4.2 xattr protocol by setting the NFS_CAP_XATTR capability.

This configuration can cause nfs_do_access() to set access mode bits that are unsupported by the NFSv3 ACCESS call, which may confuse spec-compliant servers.

Fixes b78ef845c35d ("NFSv4.2: query the server for extended attribute support")
---
 fs/nfs/nfs3xdr.c | 1 +
 fs/nfs/proc.c    | 1 +
 2 files changed, 2 insertions(+)
fs/nfs/nfs3xdr.c +1 -0
index feb6e2e36138..296320f91579 100644
@@ -2229,6 +2229,7 @@ static int decode_fsinfo3resok(struct xdr_stream *xdr,
 	/* ignore properties */
 	result->lease_time = 0;
 	result->change_attr_type = NFS4_CHANGE_TYPE_IS_UNDEFINED;
+	result->xattr_support = 0;
 	return 0;
 }
 
fs/nfs/proc.c +1 -0
index 73dcaa99fa9b..e3570c656b0f 100644
@@ -92,6 +92,7 @@ nfs_proc_get_root(struct nfs_server *server, struct nfs_fh *fhandle,
 	info->maxfilesize = 0x7FFFFFFF;
 	info->lease_time = 0;
 	info->change_attr_type = NFS4_CHANGE_TYPE_IS_UNDEFINED;
+	info->xattr_support = 0;
 	return 0;
 }
 
Signature · 1 line
2.35.1