From: Paul Moore <pmoore@redhat.com>
To: selinux@tycho.nsa.gov
Cc: geert@linux-m68k.org
Subject: [PATCH] selinux: fix problems in netnode when BUG() is compiled out
Date: Wed, 05 Dec 2012 15:58:12 -0500 [thread overview]
Message-ID: <20121205205812.22105.14253.stgit@localhost> (raw)
When the BUG() macro is disabled at compile time it can cause some
problems in the SELinux netnode code: invalid return codes and
uninitialized variables. This patch fixes this by making sure we take
some corrective action after the BUG() macro.
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Paul Moore <pmoore@redhat.com>
---
security/selinux/netnode.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/security/selinux/netnode.c b/security/selinux/netnode.c
index c5454c0..9e0048a 100644
--- a/security/selinux/netnode.c
+++ b/security/selinux/netnode.c
@@ -166,6 +166,7 @@ static void sel_netnode_insert(struct sel_netnode *node)
break;
default:
BUG();
+ return;
}
/* we need to impose a limit on the growth of the hash table so check
@@ -225,6 +226,8 @@ static int sel_netnode_sid_slow(void *addr, u16 family, u32 *sid)
break;
default:
BUG();
+ ret = -EINVAL;
+ goto out;
}
if (ret != 0)
goto out;
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
next reply other threads:[~2012-12-05 20:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-05 20:58 Paul Moore [this message]
2012-12-05 20:58 ` [PATCH] selinux: fix problems in netnode when BUG() is compiled out Paul Moore
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=20121205205812.22105.14253.stgit@localhost \
--to=pmoore@redhat.com \
--cc=geert@linux-m68k.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 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.