From: Chad Sellers <csellers@tresys.com>
To: selinux@tycho.nsa.gov
Subject: [PATCH 1/4] Bug fix in polidydb_destroy
Date: Fri, 06 Oct 2006 16:09:52 -0400 [thread overview]
Message-ID: <20061006201103.644565000@tresys.com> (raw)
In-Reply-To: 20061006200951.006196000@tresys.com
This patch fixes two bugs in policydb_destroy. Two list pointers (policydb.ocontexts[i] and policydb.genfs) were not being reset to NULL when the lists they pointed to were being freed. This caused a problem when the initial policy load failed, as the policydb being destroyed was not a temporary new policydb that was thrown away, but rather was the global (active) policydb. Consequently, later functions, particularly sys_bind->selinux_socket_bind->security_node_sid and do_rw_proc->selinux_sysctl->selinux_proc_get_sid->security_genfs_sid tried to dereference memory that had previously been freed.
Signed-off-by: Chad Sellers <csellers@tresys.com>
---
security/selinux/ss/policydb.c | 2 ++
1 file changed, 2 insertions(+)
Index: linux-2.6-discovery/security/selinux/ss/policydb.c
===================================================================
--- linux-2.6-discovery.orig/security/selinux/ss/policydb.c
+++ linux-2.6-discovery/security/selinux/ss/policydb.c
@@ -613,6 +613,7 @@ void policydb_destroy(struct policydb *p
c = c->next;
ocontext_destroy(ctmp,i);
}
+ p->ocontexts[i] = NULL;
}
g = p->genfs;
@@ -628,6 +629,7 @@ void policydb_destroy(struct policydb *p
g = g->next;
kfree(gtmp);
}
+ p->genfs = NULL;
cond_policydb_destroy(p);
--
--
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 prev parent reply other threads:[~2006-10-06 20:11 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-06 20:09 [PATCH 0/4] Validate kernel object classes and permissions Chad Sellers
2006-10-06 20:09 ` Chad Sellers [this message]
2006-10-06 20:38 ` [PATCH 1/4] Bug fix in polidydb_destroy James Morris
2006-10-06 20:09 ` [PATCH 2/4] Remove current validation mechanism Chad Sellers
2006-10-06 21:07 ` Stephen Smalley
2006-10-06 22:19 ` Chad Sellers
2006-10-06 20:09 ` [PATCH 3/4] Export object class and permission definitions Chad Sellers
2006-10-06 20:09 ` [PATCH 4/4] Validate kernel object classes and permissions Chad Sellers
2006-10-06 21:37 ` Stephen Smalley
2006-10-06 22:25 ` Chad Sellers
2006-10-10 13:25 ` Stephen Smalley
2006-10-10 14:14 ` Chad Sellers
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=20061006201103.644565000@tresys.com \
--to=csellers@tresys.com \
--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.