[patch 1/1] selinux: fix bug in security_compute_sid

From: Stephen Smalley
Date: Tue Jul 25 2006 - 10:09:41 EST


From: Venkat Yekkirala <vyekkirala@xxxxxxxxxxxxx>

Initializes newcontext sooner to allow for its destruction in all cases.
Please apply for 2.6.18.

Signed-off-by: Venkat Yekkirala <vyekkirala@xxxxxxxxxxxxx>
Signed-off-by: Stephen Smalley <sds@xxxxxxxxxxxxx>

---

security/selinux/ss/services.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff -X /home/sds/dontdiff -rup linux-2.6.18-rc2-git2/security/selinux/ss/services.c linux-2.6.18-rc2-git2-x/security/selinux/ss/services.c
--- linux-2.6.18-rc2-git2/security/selinux/ss/services.c 2006-07-24 11:25:49.000000000 -0400
+++ linux-2.6.18-rc2-git2-x/security/selinux/ss/services.c 2006-07-25 08:11:58.000000000 -0400
@@ -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:

--
Stephen Smalley
National Security Agency

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/