diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-04-13 13:49:47 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-04-13 13:50:52 -0400 |
commit | e847469bf77a1d339274074ed068d461f0c872bc (patch) | |
tree | 4e5e9b3fea923432d6745ed1369100d2b941af0d | |
parent | 72094e43e3af5020510f920321d71f1798fa896d (diff) |
lockd: fix the endianness bug
comparing be32 values for < is not doing the right thing...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/lockd/clnt4xdr.c | 2 | ||||
-rw-r--r-- | fs/lockd/clntxdr.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/fs/lockd/clnt4xdr.c b/fs/lockd/clnt4xdr.c index 3ddcbb1c0a43..13ad1539fbf2 100644 --- a/fs/lockd/clnt4xdr.c +++ b/fs/lockd/clnt4xdr.c | |||
@@ -241,7 +241,7 @@ static int decode_nlm4_stat(struct xdr_stream *xdr, __be32 *stat) | |||
241 | p = xdr_inline_decode(xdr, 4); | 241 | p = xdr_inline_decode(xdr, 4); |
242 | if (unlikely(p == NULL)) | 242 | if (unlikely(p == NULL)) |
243 | goto out_overflow; | 243 | goto out_overflow; |
244 | if (unlikely(*p > nlm4_failed)) | 244 | if (unlikely(ntohl(*p) > ntohl(nlm4_failed))) |
245 | goto out_bad_xdr; | 245 | goto out_bad_xdr; |
246 | *stat = *p; | 246 | *stat = *p; |
247 | return 0; | 247 | return 0; |
diff --git a/fs/lockd/clntxdr.c b/fs/lockd/clntxdr.c index 3d35e3e80c1c..d269ada7670e 100644 --- a/fs/lockd/clntxdr.c +++ b/fs/lockd/clntxdr.c | |||
@@ -236,7 +236,7 @@ static int decode_nlm_stat(struct xdr_stream *xdr, | |||
236 | p = xdr_inline_decode(xdr, 4); | 236 | p = xdr_inline_decode(xdr, 4); |
237 | if (unlikely(p == NULL)) | 237 | if (unlikely(p == NULL)) |
238 | goto out_overflow; | 238 | goto out_overflow; |
239 | if (unlikely(*p > nlm_lck_denied_grace_period)) | 239 | if (unlikely(ntohl(*p) > ntohl(nlm_lck_denied_grace_period))) |
240 | goto out_enum; | 240 | goto out_enum; |
241 | *stat = *p; | 241 | *stat = *p; |
242 | return 0; | 242 | return 0; |