* [PATCH] netlabel: fix a problem with netlbl_secattr_catmap_setrng()
@ 2016-03-28 15:10 Paul Moore
2016-03-28 15:17 ` Paul Moore
0 siblings, 1 reply; 3+ messages in thread
From: Paul Moore @ 2016-03-28 15:10 UTC (permalink / raw)
To: netdev, selinux; +Cc: Janak Desai
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,
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] netlabel: fix a problem with netlbl_secattr_catmap_setrng()
2016-03-28 15:10 [PATCH] netlabel: fix a problem with netlbl_secattr_catmap_setrng() Paul Moore
@ 2016-03-28 15:17 ` Paul Moore
2016-03-28 15:41 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Paul Moore @ 2016-03-28 15:17 UTC (permalink / raw)
To: netdev; +Cc: selinux, Janak Desai, Paul Moore
On Mon, Mar 28, 2016 at 11:10 AM, Paul Moore <pmoore@redhat.com> wrote:
> 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(-)
DaveM, I'm planning on carrying this in selinux#next unless you really
want to this to go to Linus via the netdev tree.
> 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,
>
--
paul moore
www.paul-moore.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] netlabel: fix a problem with netlbl_secattr_catmap_setrng()
2016-03-28 15:17 ` Paul Moore
@ 2016-03-28 15:41 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2016-03-28 15:41 UTC (permalink / raw)
To: paul; +Cc: netdev, selinux, Janak.Desai, pmoore
From: Paul Moore <paul@paul-moore.com>
Date: Mon, 28 Mar 2016 11:17:28 -0400
> On Mon, Mar 28, 2016 at 11:10 AM, Paul Moore <pmoore@redhat.com> wrote:
>> 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(-)
>
> DaveM, I'm planning on carrying this in selinux#next unless you really
> want to this to go to Linus via the netdev tree.
I'm fine with it going via your tree, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-03-28 15:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-28 15:10 [PATCH] netlabel: fix a problem with netlbl_secattr_catmap_setrng() Paul Moore
2016-03-28 15:17 ` Paul Moore
2016-03-28 15:41 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.