mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 10:01:39 -05:00
Merge tag 'nfsd-6.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux
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
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -1083,6 +1083,7 @@ static int gss_read_proxy_verf(struct svc_rqst *rqstp,
|
||||
}
|
||||
|
||||
length = min_t(unsigned int, inlen, (char *)xdr->end - (char *)xdr->p);
|
||||
if (length)
|
||||
memcpy(page_address(in_token->pages[0]), xdr->p, length);
|
||||
inlen -= length;
|
||||
|
||||
|
||||
@@ -841,6 +841,9 @@ static int svc_rdma_copy_inline_range(struct svc_rqst *rqstp,
|
||||
for (page_no = 0; page_no < numpages; page_no++) {
|
||||
unsigned int page_len;
|
||||
|
||||
if (head->rc_curpage >= rqstp->rq_maxpages)
|
||||
return -EINVAL;
|
||||
|
||||
page_len = min_t(unsigned int, remaining,
|
||||
PAGE_SIZE - head->rc_pageoff);
|
||||
|
||||
@@ -848,7 +851,7 @@ static int svc_rdma_copy_inline_range(struct svc_rqst *rqstp,
|
||||
head->rc_page_count++;
|
||||
|
||||
dst = page_address(rqstp->rq_pages[head->rc_curpage]);
|
||||
memcpy(dst + head->rc_curpage, src + offset, page_len);
|
||||
memcpy((unsigned char *)dst + head->rc_pageoff, src + offset, page_len);
|
||||
|
||||
head->rc_readbytes += page_len;
|
||||
head->rc_pageoff += page_len;
|
||||
@@ -860,7 +863,7 @@ static int svc_rdma_copy_inline_range(struct svc_rqst *rqstp,
|
||||
offset += page_len;
|
||||
}
|
||||
|
||||
return -EINVAL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user