Skip to contentSkip to conversation

knfsd: nfs3svc_decode_writeargs assumes data follows header

RFC PATCH In review Tom Tucker 2 participants 2 messages May 18, 2007

Subsystems (2)
lore
Share & tools
lore

Tom Tucker

author
#0 lore raw

RFC PATCH 6/15 knfsd: nfs3svc_decode_writeargs assumes data follows header

The nfs3svc_decode_writeargs routine assumes that the data for an NFS write comes inline with the header when it verifies the message. Since the data for the write does not appear immediately following the header when RDMA is the transport, this check had to be modified.

---

 fs/nfsd/nfs3xdr.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/nfsd/nfs3xdr.c +1 -1
index 7e4bb0a..0f08c4b 100644
@@ -400,7 +400,7 @@ nfs3svc_decode_writeargs(struct svc_rqst
 	rqstp->rq_vec[v].iov_len = len;
 	args->vlen = v+1;
 
-	return args->count == args->len && rqstp->rq_vec[0].iov_len > 0;
+	return args->count == args->len && rqstp->rq_arg.len > hdr;
 }
 
 int

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

#1 lore raw
Quoted 17 lines · Tom Tucker

The nfs3svc_decode_writeargs routine assumes that the data for an NFS write comes inline with the header when it verifies the message. Since the data for the write does not appear immediately following the header when RDMA is the transport, this check had to be modified.

---

 fs/nfsd/nfs3xdr.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/nfsd/nfs3xdr.c +0 -0
index 7e4bb0a..0f08c4b 100644

fs/nfsd/nfs3xdr.c nfs3svc_decode_writeargs(struct svc_rqst · line 404

Quoted 6 lines
fs/nfsd/nfs3xdr.c +1 -1
@@ -400,7 +400,7 @@ nfs3svc_decode_writeargs(struct svc_rqst
 	rqstp->rq_vec[v].iov_len = len;
 	args->vlen = v+1;
 
-	return args->count == args->len && rqstp->rq_vec[0].iov_len > 0;
+	return args->count == args->len && rqstp->rq_arg.len > hdr;
 }

You'll want to rebase against at least v2.6.22-rc1; see f34b9568.

--b.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs