提交 851f8a69 编写于 作者: V Venkat Yekkirala 提交者: Linus Torvalds

[PATCH] selinux: fix bug in security_compute_sid

Initializes newcontext sooner to allow for its destruction in all cases.
Signed-off-by: NVenkat Yekkirala <vyekkirala@TrustedCS.com>
Signed-off-by: NStephen Smalley <sds@tycho.nsa.gov>
Acked-by: NJames Morris <jmorris@namei.org>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 ddccef3b
......@@ -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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册