[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>
This commit is contained in:
parent
ddccef3b5e
commit
851f8a6906
@ -833,6 +833,8 @@ static int security_compute_sid(u32 ssid,
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
context_init(&newcontext);
|
||||||
|
|
||||||
POLICY_RDLOCK;
|
POLICY_RDLOCK;
|
||||||
|
|
||||||
scontext = sidtab_search(&sidtab, ssid);
|
scontext = sidtab_search(&sidtab, ssid);
|
||||||
@ -850,8 +852,6 @@ static int security_compute_sid(u32 ssid,
|
|||||||
goto out_unlock;
|
goto out_unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
context_init(&newcontext);
|
|
||||||
|
|
||||||
/* Set the user identity. */
|
/* Set the user identity. */
|
||||||
switch (specified) {
|
switch (specified) {
|
||||||
case AVTAB_TRANSITION:
|
case AVTAB_TRANSITION:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user