Skip to content

Commit 82e13c7

Browse files
committed
Merge branch 'for-3.16' of git://linux-nfs.org/~bfields/linux
Pull nfsd bugfix from Bruce Fields: "Another regression from the xdr encoding rewrite" * 'for-3.16' of git://linux-nfs.org/~bfields/linux: NFSD: Fix crash encoding lock reply on 32-bit
2 parents 98de5ab + f98bac5 commit 82e13c7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/nfsd/nfs4xdr.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2879,6 +2879,7 @@ nfsd4_encode_lock_denied(struct xdr_stream *xdr, struct nfsd4_lock_denied *ld)
28792879
* return the conflicting open:
28802880
*/
28812881
if (conf->len) {
2882+
kfree(conf->data);
28822883
conf->len = 0;
28832884
conf->data = NULL;
28842885
goto again;
@@ -2891,6 +2892,7 @@ nfsd4_encode_lock_denied(struct xdr_stream *xdr, struct nfsd4_lock_denied *ld)
28912892
if (conf->len) {
28922893
p = xdr_encode_opaque_fixed(p, &ld->ld_clientid, 8);
28932894
p = xdr_encode_opaque(p, conf->data, conf->len);
2895+
kfree(conf->data);
28942896
} else { /* non - nfsv4 lock in conflict, no clientid nor owner */
28952897
p = xdr_encode_hyper(p, (u64)0); /* clientid */
28962898
*p++ = cpu_to_be32(0); /* length of owner name */
@@ -2907,7 +2909,7 @@ nfsd4_encode_lock(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_lo
29072909
nfserr = nfsd4_encode_stateid(xdr, &lock->lk_resp_stateid);
29082910
else if (nfserr == nfserr_denied)
29092911
nfserr = nfsd4_encode_lock_denied(xdr, &lock->lk_denied);
2910-
kfree(lock->lk_denied.ld_owner.data);
2912+
29112913
return nfserr;
29122914
}
29132915

0 commit comments

Comments
 (0)