Commit 9740f1d8 authored by Al Viro's avatar Al Viro Committed by Greg Kroah-Hartman

lockd: fix the endianness bug

commit e847469b upstream.

comparing be32 values for < is not doing the right thing...
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d434e3ec
...@@ -241,7 +241,7 @@ static int decode_nlm4_stat(struct xdr_stream *xdr, __be32 *stat) ...@@ -241,7 +241,7 @@ static int decode_nlm4_stat(struct xdr_stream *xdr, __be32 *stat)
p = xdr_inline_decode(xdr, 4); p = xdr_inline_decode(xdr, 4);
if (unlikely(p == NULL)) if (unlikely(p == NULL))
goto out_overflow; goto out_overflow;
if (unlikely(*p > nlm4_failed)) if (unlikely(ntohl(*p) > ntohl(nlm4_failed)))
goto out_bad_xdr; goto out_bad_xdr;
*stat = *p; *stat = *p;
return 0; return 0;
......
...@@ -236,7 +236,7 @@ static int decode_nlm_stat(struct xdr_stream *xdr, ...@@ -236,7 +236,7 @@ static int decode_nlm_stat(struct xdr_stream *xdr,
p = xdr_inline_decode(xdr, 4); p = xdr_inline_decode(xdr, 4);
if (unlikely(p == NULL)) if (unlikely(p == NULL))
goto out_overflow; goto out_overflow;
if (unlikely(*p > nlm_lck_denied_grace_period)) if (unlikely(ntohl(*p) > ntohl(nlm_lck_denied_grace_period)))
goto out_enum; goto out_enum;
*stat = *p; *stat = *p;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment