Skip to content

Commit 18180a4

Browse files
committed
NFSD: Fix nfsd4_encode_fattr4() crasher
Ensure that args.acl is initialized early. It is used in an unconditional call to kfree() on the way out of nfsd4_encode_fattr4(). Reported-by: Scott Mayhew <[email protected]> Fixes: 83ab867 ("NFSD: Add struct nfsd4_fattr_args") Signed-off-by: Chuck Lever <[email protected]>
1 parent 8ddb714 commit 18180a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/nfsd/nfs4xdr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3515,6 +3515,7 @@ nfsd4_encode_fattr4(struct svc_rqst *rqstp, struct xdr_stream *xdr,
35153515
args.exp = exp;
35163516
args.dentry = dentry;
35173517
args.ignore_crossmnt = (ignore_crossmnt != 0);
3518+
args.acl = NULL;
35183519

35193520
/*
35203521
* Make a local copy of the attribute bitmap that can be modified.
@@ -3573,7 +3574,6 @@ nfsd4_encode_fattr4(struct svc_rqst *rqstp, struct xdr_stream *xdr,
35733574
} else
35743575
args.fhp = fhp;
35753576

3576-
args.acl = NULL;
35773577
if (attrmask[0] & FATTR4_WORD0_ACL) {
35783578
err = nfsd4_get_nfs4_acl(rqstp, dentry, &args.acl);
35793579
if (err == -EOPNOTSUPP)

0 commit comments

Comments
 (0)