]> git.karo-electronics.de Git - linux-beck.git/commitdiff
netlabel: fix a problem with netlbl_secattr_catmap_setrng()
authorJanak Desai <Janak.Desai@gtri.gatech.edu>
Mon, 28 Mar 2016 15:09:46 +0000 (11:09 -0400)
committerPaul Moore <paul@paul-moore.com>
Tue, 5 Apr 2016 20:10:47 +0000 (16:10 -0400)
We try to be clever and set large chunks of the bitmap at once, when
possible; unfortunately we weren't very clever when we wrote the code
and messed up the if-conditional.  Fix this bug and restore proper
operation.

Signed-off-by: Janak Desai <Janak.Desai@gtri.gatech.edu>
Signed-off-by: Paul Moore <paul@paul-moore.com>
net/netlabel/netlabel_kapi.c

index 28cddc85b7005aa6b6afa7b2c22f8f88a5b7fa46..1325776daa278a1c812a5c184038eb6e69c4b5ba 100644 (file)
@@ -677,7 +677,7 @@ int netlbl_catmap_setrng(struct netlbl_lsm_catmap **catmap,
        u32 spot = start;
 
        while (rc == 0 && spot <= end) {
-               if (((spot & (BITS_PER_LONG - 1)) != 0) &&
+               if (((spot & (BITS_PER_LONG - 1)) == 0) &&
                    ((end - spot) > BITS_PER_LONG)) {
                        rc = netlbl_catmap_setlong(catmap,
                                                   spot,