summaryrefslogtreecommitdiff
path: root/security/selinux
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2006-08-02 22:15:21 +0400
committerJohn W. Linville <linville@tuxdriver.com>2006-08-02 22:15:21 +0400
commitebf572b448757190027d8ee34e73deb989ec7b60 (patch)
tree2320a92b1aed2c9475e291d75c92616af75e195a /security/selinux
parent48c86da1a211ef13bbfb1c8f2e35dda44a66b8a1 (diff)
parent49b1e3ea19b1c95c2f012b8331ffb3b169e4c042 (diff)
downloadlinux-ebf572b448757190027d8ee34e73deb989ec7b60.tar.xz
Merge branch 'from-linus' into bcm43xx
Diffstat (limited to 'security/selinux')
-rw-r--r--security/selinux/ss/policydb.c12
-rw-r--r--security/selinux/ss/services.c4
2 files changed, 12 insertions, 4 deletions
diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c
index 0111990ba837..f03960e697ce 100644
--- a/security/selinux/ss/policydb.c
+++ b/security/selinux/ss/policydb.c
@@ -644,10 +644,18 @@ void policydb_destroy(struct policydb *p)
kfree(lra);
for (rt = p->range_tr; rt; rt = rt -> next) {
- kfree(lrt);
+ if (lrt) {
+ ebitmap_destroy(&lrt->range.level[0].cat);
+ ebitmap_destroy(&lrt->range.level[1].cat);
+ kfree(lrt);
+ }
lrt = rt;
}
- kfree(lrt);
+ if (lrt) {
+ ebitmap_destroy(&lrt->range.level[0].cat);
+ ebitmap_destroy(&lrt->range.level[1].cat);
+ kfree(lrt);
+ }
if (p->type_attr_map) {
for (i = 0; i < p->p_types.nprim; i++)
diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c
index d2e80e62ff0c..85e429884393 100644
--- a/security/selinux/ss/services.c
+++ b/security/selinux/ss/services.c
@@ -833,6 +833,8 @@ static int security_compute_sid(u32 ssid,
goto out;
}
+ context_init(&newcontext);
+
POLICY_RDLOCK;
scontext = sidtab_search(&sidtab, ssid);
@@ -850,8 +852,6 @@ static int security_compute_sid(u32 ssid,
goto out_unlock;
}
- context_init(&newcontext);
-
/* Set the user identity. */
switch (specified) {
case AVTAB_TRANSITION: