NFSD: Fix .pc_release method for NFSv2
authorChuck Lever <chuck.lever@oracle.com>
Thu, 1 Oct 2020 22:59:44 +0000 (18:59 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Fri, 2 Oct 2020 13:37:42 +0000 (09:37 -0400)
commit1841b9b61492e35234bdca8a5737a0e5df770f27
treebbf2665767867df7a1096b6703b0d55edaacfdf9
parent7cf8357043bb828444cd9f4296f595bdbf68fa87
NFSD: Fix .pc_release method for NFSv2

nfsd_release_fhandle() assumes that rqstp->rq_resp always points to
an nfsd_fhandle struct. In fact, no NFSv2 procedure uses struct
nfsd_fhandle as its response structure.

So far that has been "safe" to do because the res structs put the
resp->fh field at that same offset as struct nfsd_fhandle. I don't
think that's a guarantee, though, and there is certainly nothing
preventing a developer from altering the fields in those structures.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfsproc.c
fs/nfsd/nfsxdr.c
fs/nfsd/xdr.h