summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorVenkat Yekkirala <vyekkirala@trustedcs.com>2006-07-30 03:03:18 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-31 13:28:38 -0700
commit851f8a6906b71f7a19043d4d722dd4ffab7aeafc (patch)
tree2d1c8c23b1ab70095f442f93ecb5629c273390ee /security
parentddccef3b5ec906ff181171e8ffad4fcb996792fd (diff)
downloadlwn-851f8a6906b71f7a19043d4d722dd4ffab7aeafc.tar.gz
lwn-851f8a6906b71f7a19043d4d722dd4ffab7aeafc.zip
[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')
-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,
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: