* [patch][selinux] Fix clearing of new personality bit on security transitions
@ 2004-07-27 16:21 Stephen Smalley
2004-07-28 7:37 ` Ingo Molnar
0 siblings, 1 reply; 2+ messages in thread
From: Stephen Smalley @ 2004-07-27 16:21 UTC (permalink / raw)
To: Andrew Morton, Linus Torvalds
Cc: Ingo Molnar, James Morris, Chris Wright, lkml
This patch against 2.6.8-rc2-bk6 moves the clearing of the new
personality bit from selinux_bprm_apply_creds (called from
compute_creds) to selinux_bprm_set_security (called from
prepare_binprm). This ensures that the bit is cleared at the same point
in exec processing as for setuid/setgid binaries, prior to setting up
the new image. Please apply.
Signed-off-by: Stephen Smalley <sds@epoch.ncsc.mil>
security/selinux/hooks.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
--- linux-2.6.7/security/selinux/hooks.c.orig 2004-07-27 11:42:12.347833384 -0400
+++ linux-2.6.7/security/selinux/hooks.c 2004-07-27 11:43:12.748651064 -0400
@@ -1685,6 +1685,9 @@ static int selinux_bprm_set_security(str
if (rc)
return rc;
+ /* Clear any possibly unsafe personality bits on exec: */
+ current->personality &= ~PER_CLEAR_ON_SETID;
+
/* Set the security field to the new SID. */
bsec->sid = newsid;
}
@@ -1895,9 +1898,6 @@ static void selinux_bprm_apply_creds(str
task_unlock(current);
}
- /* Clear any possibly unsafe personality bits on exec: */
- current->personality &= ~PER_CLEAR_ON_SETID;
-
/* Close files for which the new task SID is not authorized. */
flush_unauthorized_files(current->files);
--
Stephen Smalley <sds@epoch.ncsc.mil>
National Security Agency
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [patch][selinux] Fix clearing of new personality bit on security transitions
2004-07-27 16:21 [patch][selinux] Fix clearing of new personality bit on security transitions Stephen Smalley
@ 2004-07-28 7:37 ` Ingo Molnar
0 siblings, 0 replies; 2+ messages in thread
From: Ingo Molnar @ 2004-07-28 7:37 UTC (permalink / raw)
To: Stephen Smalley
Cc: Andrew Morton, Linus Torvalds, James Morris, Chris Wright, lkml
* Stephen Smalley <sds@epoch.ncsc.mil> wrote:
> This patch against 2.6.8-rc2-bk6 moves the clearing of the new
> personality bit from selinux_bprm_apply_creds (called from
> compute_creds) to selinux_bprm_set_security (called from
> prepare_binprm). This ensures that the bit is cleared at the same point
> in exec processing as for setuid/setgid binaries, prior to setting up
> the new image. Please apply.
>
> Signed-off-by: Stephen Smalley <sds@epoch.ncsc.mil>
yeah, thanks for the fix.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Ingo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-07-28 7:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-27 16:21 [patch][selinux] Fix clearing of new personality bit on security transitions Stephen Smalley
2004-07-28 7:37 ` Ingo Molnar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®