Netdev List
 help / color / mirror / Atom feed
From: Paul Moore <pmoore@redhat.com>
To: netdev@vger.kernel.org, selinux@tycho.nsa.gov
Cc: Janak Desai <Janak.Desai@gtri.gatech.edu>
Subject: [PATCH] netlabel: fix a problem with netlbl_secattr_catmap_setrng()
Date: Mon, 28 Mar 2016 11:10:38 -0400	[thread overview]
Message-ID: <145917783800.9565.7759086668991534988.stgit@localhost> (raw)

From: Janak Desai <Janak.Desai@gtri.gatech.edu>

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 |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/netlabel/netlabel_kapi.c b/net/netlabel/netlabel_kapi.c
index 28cddc8..1325776 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,

             reply	other threads:[~2016-03-28 15:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-28 15:10 Paul Moore [this message]
2016-03-28 15:17 ` [PATCH] netlabel: fix a problem with netlbl_secattr_catmap_setrng() Paul Moore
2016-03-28 15:41   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=145917783800.9565.7759086668991534988.stgit@localhost \
    --to=pmoore@redhat.com \
    --cc=Janak.Desai@gtri.gatech.edu \
    --cc=netdev@vger.kernel.org \
    --cc=selinux@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox