summaryrefslogtreecommitdiff
path: root/security/selinux/netnode.c
diff options
context:
space:
mode:
authorPaul Moore <pmoore@redhat.com>2013-07-24 01:38:38 +0400
committerEric Paris <eparis@redhat.com>2013-07-25 21:03:27 +0400
commitb04eea886409de7460b5727b5931fb0bd417275f (patch)
tree3be19b6275c41fc53aad1e1842723e43245a78b2 /security/selinux/netnode.c
parentb43e725d8d386bf2092473953b525aaae71b6c28 (diff)
downloadlinux-b04eea886409de7460b5727b5931fb0bd417275f.tar.xz
selinux: fix problems in netnode when BUG() is compiled out
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> Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'security/selinux/netnode.c')
-rw-r--r--security/selinux/netnode.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/security/selinux/netnode.c b/security/selinux/netnode.c
index c5454c0477c3..03a72c32afd7 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,7 @@ static int sel_netnode_sid_slow(void *addr, u16 family, u32 *sid)
break;
default:
BUG();
+ ret = -EINVAL;
}
if (ret != 0)
goto out;