Commit ccd1cdca authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull nfsd fixes from Chuck Lever:
 "A set of NFSD fixes that arrived just a bit late for the 6.19 merge
  window.

  Regression fixes:
   - Mark variable __maybe_unused to avoid W=1 build break

  Stable fixes:
   - NFSv4 file creation neglects setting ACL
   - Clear TIME_DELEG in the suppattr_exclcreat bitmap
   - Clear SECLABEL in the suppattr_exclcreat bitmap
   - Fix memory leak in nfsd_create_serv error paths
   - Bound check rq_pages index in inline path
   - Return 0 on success from svc_rdma_copy_inline_range
   - Use rc_pageoff for memcpy byte offset
   - Avoid NULL deref on zero length gss_token in gss_read_proxy_verf"

* tag 'nfsd-6.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux:
  NFSD: NFSv4 file creation neglects setting ACL
  NFSD: Clear TIME_DELEG in the suppattr_exclcreat bitmap
  NFSD: Clear SECLABEL in the suppattr_exclcreat bitmap
  nfsd: fix memory leak in nfsd_create_serv error paths
  nfsd: Mark variable __maybe_unused to avoid W=1 build break
  svcrdma: bound check rq_pages index in inline path
  svcrdma: return 0 on success from svc_rdma_copy_inline_range
  svcrdma: use rc_pageoff for memcpy byte offset
  SUNRPC: svcauth_gss: avoid NULL deref on zero length gss_token in gss_read_proxy_verf
parents ce93692d 913f7cf7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1024,7 +1024,7 @@ exp_rootfh(struct net *net, struct auth_domain *clp, char *name,
{
	struct svc_export	*exp;
	struct path		path;
	struct inode		*inode;
	struct inode		*inode __maybe_unused;
	struct svc_fh		fh;
	int			err;
	struct nfsd_net		*nn = net_generic(net, nfsd_net_id);
+5 −0
Original line number Diff line number Diff line
@@ -3375,6 +3375,11 @@ static __be32 nfsd4_encode_fattr4_suppattr_exclcreat(struct xdr_stream *xdr,
	u32 supp[3];

	memcpy(supp, nfsd_suppattrs[resp->cstate.minorversion], sizeof(supp));
	if (!IS_POSIXACL(d_inode(args->dentry)))
		supp[0] &= ~FATTR4_WORD0_ACL;
	if (!args->contextsupport)
		supp[2] &= ~FATTR4_WORD2_SECURITY_LABEL;

	supp[0] &= NFSD_SUPPATTR_EXCLCREAT_WORD0;
	supp[1] &= NFSD_SUPPATTR_EXCLCREAT_WORD1;
	supp[2] &= NFSD_SUPPATTR_EXCLCREAT_WORD2;
+7 −1
Original line number Diff line number Diff line
@@ -547,8 +547,14 @@ static inline bool nfsd_attrs_supported(u32 minorversion, const u32 *bmval)
#define NFSD_SUPPATTR_EXCLCREAT_WORD1 \
	(NFSD_WRITEABLE_ATTRS_WORD1 & \
	 ~(FATTR4_WORD1_TIME_ACCESS_SET | FATTR4_WORD1_TIME_MODIFY_SET))
/*
 * The FATTR4_WORD2_TIME_DELEG attributes are not to be allowed for
 * OPEN(create) with EXCLUSIVE4_1. It doesn't make sense to set a
 * delegated timestamp on a new file.
 */
#define NFSD_SUPPATTR_EXCLCREAT_WORD2 \
	NFSD_WRITEABLE_ATTRS_WORD2
	(NFSD_WRITEABLE_ATTRS_WORD2 & \
	~(FATTR4_WORD2_TIME_DELEG_ACCESS | FATTR4_WORD2_TIME_DELEG_MODIFY))

extern int nfsd4_is_junction(struct dentry *dentry);
extern int register_cld_notifier(void);
+4 −1
Original line number Diff line number Diff line
@@ -615,12 +615,15 @@ int nfsd_create_serv(struct net *net)
	serv = svc_create_pooled(nfsd_programs, ARRAY_SIZE(nfsd_programs),
				 &nn->nfsd_svcstats,
				 nfsd_max_blksize, nfsd);
	if (serv == NULL)
	if (serv == NULL) {
		percpu_ref_exit(&nn->nfsd_net_ref);
		return -ENOMEM;
	}

	error = svc_bind(serv, net);
	if (error < 0) {
		svc_destroy(&serv);
		percpu_ref_exit(&nn->nfsd_net_ref);
		return error;
	}
	spin_lock(&nfsd_notifier_lock);
+2 −1
Original line number Diff line number Diff line
@@ -67,7 +67,8 @@ static inline bool nfsd_attrs_valid(struct nfsd_attrs *attrs)
	struct iattr *iap = attrs->na_iattr;

	return (iap->ia_valid || (attrs->na_seclabel &&
		attrs->na_seclabel->len));
		attrs->na_seclabel->len) ||
		attrs->na_pacl || attrs->na_dpacl);
}

__be32		nfserrno (int errno);
Loading