SUNRPC: Fix xdr_decode_string_inplace() argument signage
Subsystems (3)
PATCH 6/27 SUNRPC: Fix xdr_decode_string_inplace() argument signage
xdr_decode_string_inplace() compares an incoming length to a maximum length allowed by the protocol. Make sure both sides of the comparison have the same sign.
---
include/linux/sunrpc/xdr.h | 3 ++- net/sunrpc/xdr.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)
include/linux/sunrpc/xdr.h +2 -1
@@ -112,7 +112,8 @@ struct xdr_buf {__be32 *xdr_encode_opaque_fixed (__be32 *p,const void *ptr,unsigned int len);__be32 *xdr_encode_opaque (__be32 *p,const void *ptr,unsigned int len);__be32 *xdr_encode_string (__be32 *p,const char *s); -__be32 *xdr_decode_string_inplace (__be32 *p,char **sp,int *lenp,int maxlen); +__be32 *xdr_decode_string_inplace (__be32 *p,char **sp,int *lenp, +unsigned int maxlen);__be32 *xdr_encode_netobj (__be32 *p,const struct xdr_netobj *);__be32 *xdr_decode_netobj (__be32 *p,struct xdr_netobj *);
net/sunrpc/xdr.c +1 -1
@@ -93,7 +93,7 @@ xdr_encode_string(__be32 *p, const char *string) }__be32 * -xdr_decode_string_inplace (__be32 *p,char **sp,int *lenp,int maxlen) +xdr_decode_string_inplace (__be32 *p,char **sp,int *lenp,unsigned int maxlen) {unsigned int len;
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs
Quoted 30 lines · Chuck Lever
xdr_decode_string_inplace()compares an incoming length to a maximum length allowed by the protocol. Make sure both sides of the comparison have the same sign.Signed-off-by Chuck Lever <[email protected]>---
include/linux/sunrpc/xdr.h | 3 ++- net/sunrpc/xdr.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)include/linux/sunrpc/xdr.h +2
-1@@ -112,7 +112,8 @@ struct xdr_buf {__be32 *xdr_encode_opaque_fixed (__be32 *p,const void *ptr,unsigned int len);__be32 *xdr_encode_opaque (__be32 *p,const void *ptr,unsigned int len);__be32 *xdr_encode_string (__be32 *p,const char *s); -__be32 *xdr_decode_string_inplace (__be32 *p,char **sp,int *lenp,int maxlen); +__be32 *xdr_decode_string_inplace (__be32 *p,char **sp,int *lenp, +unsigned int maxlen);__be32 *xdr_encode_netobj (__be32 *p,const struct xdr_netobj *);__be32 *xdr_decode_netobj (__be32 *p,struct xdr_netobj *);net/sunrpc/xdr.c +0
-0
net/sunrpc/xdr.c xdr_encode_string(__be32 *p, const char *string) · line 98
Quoted 7 lines
net/sunrpc/xdr.c +1
-1@@ -93,7 +93,7 @@ xdr_encode_string(__be32 *p, const char *string) }__be32 * -xdr_decode_string_inplace (__be32 *p,char **sp,int *lenp,int maxlen) +xdr_decode_string_inplace (__be32 *p,char **sp,int *lenp,unsigned int maxlen) {unsigned int len;
Nope. maxlen should be of the same type as *lenp.
Trond
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs