diff options
author | Janak Desai <Janak.Desai@gtri.gatech.edu> | 2016-03-28 11:09:46 -0400 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2016-04-05 16:10:47 -0400 |
commit | 341e0cb593a2b7ec86dd6ca96c68eadc3f6fe1e6 (patch) | |
tree | 5b34d982d7c646e30c26dc89f5de4d93b5695b9d /net/netlabel | |
parent | 9735a22799b9214d17d3c231fe377fc852f042e9 (diff) | |
download | linux-341e0cb593a2b7ec86dd6ca96c68eadc3f6fe1e6.tar.bz2 |
netlabel: fix a problem with netlbl_secattr_catmap_setrng()
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>
Diffstat (limited to 'net/netlabel')
-rw-r--r-- | net/netlabel/netlabel_kapi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netlabel/netlabel_kapi.c b/net/netlabel/netlabel_kapi.c index 28cddc85b700..1325776daa27 100644 --- a/net/netlabel/netlabel_kapi.c +++ b/net/netlabel/netlabel_kapi.c @@ -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, |