Hello Neil,
I found a bug in svc_udp_recvfrom() and fixed it.
rq_arg.head[0].iov_len and rq_arg.page_len will be set to
wrong value when length of date is smaller than PAGE_SIZE.
Thank you,
Hirokazu Takahashi.
--- net/sunrpc/svcsock.c.BUG Thu Nov 14 22:09:36 2030
+++ net/sunrpc/svcsock.c Fri Nov 15 11:24:34 2030
@@ -572,10 +572,15 @@ svc_udp_recvfrom(struct svc_rqst *rqstp)
return 0;
}
-
rqstp->rq_arg.len = len;
- rqstp->rq_arg.page_len = len - rqstp->rq_arg.head[0].iov_len;
- rqstp->rq_argused += (rqstp->rq_arg.page_len + PAGE_SIZE - 1)/ PAGE_SIZE;
+ if (len <= rqstp->rq_arg.head[0].iov_len) {
+ rqstp->rq_arg.head[0].iov_len = len;
+ rqstp->rq_arg.page_len = 0;
+ } else {
+ rqstp->rq_arg.page_len = len - rqstp->rq_arg.head[0].iov_len;
+ rqstp->rq_argused += (rqstp->rq_arg.page_len + PAGE_SIZE - 1)/ PAGE_SIZE;
+ }
+
rqstp->rq_prot = IPPROTO_UDP;
/* Get sender address */
-------------------------------------------------------
This sf.net email is sponsored by: To learn the basics of securing
your web site with SSL, click here to get a FREE TRIAL of a Thawte
Server Certificate: http://www.gothawte.com/rd524.html
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs
On Friday November 15, [email protected] wrote:
> Hello Neil,
>
> I found a bug in svc_udp_recvfrom() and fixed it.
> rq_arg.head[0].iov_len and rq_arg.page_len will be set to
> wrong value when length of date is smaller than PAGE_SIZE.
Thanks. I have added
rqstp->rq_arg.page_base = 0;
for uniformity with the tcp code.
NeilBrown
-------------------------------------------------------
This sf.net email is sponsored by: To learn the basics of securing
your web site with SSL, click here to get a FREE TRIAL of a Thawte
Server Certificate: http://www.gothawte.com/rd524.html
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs