]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
lockd: fix the endianness bug
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 13 Apr 2012 17:49:47 +0000 (13:49 -0400)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 11 May 2012 12:14:15 +0000 (13:14 +0100)
commit e847469bf77a1d339274074ed068d461f0c872bc upstream.

comparing be32 values for < is not doing the right thing...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/lockd/clnt4xdr.c
fs/lockd/clntxdr.c

index f848b52c67b19e565567168a2bd5810fcc5f0a6c..046bb77c60131fd2bebdbfde16fc2f939f70ea4f 100644 (file)
@@ -241,7 +241,7 @@ static int decode_nlm4_stat(struct xdr_stream *xdr, __be32 *stat)
        p = xdr_inline_decode(xdr, 4);
        if (unlikely(p == NULL))
                goto out_overflow;
-       if (unlikely(*p > nlm4_failed))
+       if (unlikely(ntohl(*p) > ntohl(nlm4_failed)))
                goto out_bad_xdr;
        *stat = *p;
        return 0;
index 180ac34feb9a8630e3bbeff633b06d858a1420f8..36057cedac62f0f3fc13e333fe845a72c980474a 100644 (file)
@@ -236,7 +236,7 @@ static int decode_nlm_stat(struct xdr_stream *xdr,
        p = xdr_inline_decode(xdr, 4);
        if (unlikely(p == NULL))
                goto out_overflow;
-       if (unlikely(*p > nlm_lck_denied_grace_period))
+       if (unlikely(ntohl(*p) > ntohl(nlm_lck_denied_grace_period)))
                goto out_enum;
        *stat = *p;
        return 0;