aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux/ss
diff options
context:
space:
mode:
authorVenkat Yekkirala <vyekkirala@trustedcs.com>2006-07-30 06:03:18 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-31 16:28:38 -0400
commit851f8a6906b71f7a19043d4d722dd4ffab7aeafc (patch)
tree2d1c8c23b1ab70095f442f93ecb5629c273390ee /security/selinux/ss
parentddccef3b5ec906ff181171e8ffad4fcb996792fd (diff)
[PATCH] selinux: fix bug in security_compute_sid
Initializes newcontext sooner to allow for its destruction in all cases. Signed-off-by: Venkat Yekkirala <vyekkirala@TrustedCS.com> Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov> Acked-by: James Morris <jmorris@namei.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'security/selinux/ss')
-rw-r--r--security/selinux/ss/services.c4
1 files changed, 2 insertions, 2 deletions
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,
833 goto out; 833 goto out;
834 } 834 }
835 835
836 context_init(&newcontext);
837
836 POLICY_RDLOCK; 838 POLICY_RDLOCK;
837 839
838 scontext = sidtab_search(&sidtab, ssid); 840 scontext = sidtab_search(&sidtab, ssid);
@@ -850,8 +852,6 @@ static int security_compute_sid(u32 ssid,
850 goto out_unlock; 852 goto out_unlock;
851 } 853 }
852 854
853 context_init(&newcontext);
854
855 /* Set the user identity. */ 855 /* Set the user identity. */
856 switch (specified) { 856 switch (specified) {
857 case AVTAB_TRANSITION: 857 case AVTAB_TRANSITION: