* [patch 1/1] selinux: fix tty locking
@ 2006-08-24 13:13 Stephen Smalley
2006-08-24 14:08 ` Alan Cox
2006-08-24 15:02 ` James Morris
0 siblings, 2 replies; 3+ messages in thread
From: Stephen Smalley @ 2006-08-24 13:13 UTC (permalink / raw)
To: Andrew Morton; +Cc: lkml, Eric Paris, James Morris, Alan Cox
Take tty_mutex when accessing ->signal->tty in selinux code.
Noted by Alan Cox. Longer term, we are looking at refactoring the code to provide better encapsulation of the tty layer, but this is a simple fix that addresses the immediate bug.
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
---
security/selinux/hooks.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 5d1b8c7..4b0f904 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -1711,10 +1711,12 @@ static inline void flush_unauthorized_fi
{
struct avc_audit_data ad;
struct file *file, *devnull = NULL;
- struct tty_struct *tty = current->signal->tty;
+ struct tty_struct *tty;
struct fdtable *fdt;
long j = -1;
+ mutex_lock(&tty_mutex);
+ tty = current->signal->tty;
if (tty) {
file_list_lock();
file = list_entry(tty->tty_files.next, typeof(*file), f_u.fu_list);
@@ -1734,6 +1736,7 @@ static inline void flush_unauthorized_fi
}
file_list_unlock();
}
+ mutex_unlock(&tty_mutex);
/* Revalidate access to inherited open files. */
--
Stephen Smalley
National Security Agency
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [patch 1/1] selinux: fix tty locking
2006-08-24 13:13 [patch 1/1] selinux: fix tty locking Stephen Smalley
@ 2006-08-24 14:08 ` Alan Cox
2006-08-24 15:02 ` James Morris
1 sibling, 0 replies; 3+ messages in thread
From: Alan Cox @ 2006-08-24 14:08 UTC (permalink / raw)
To: Stephen Smalley; +Cc: Andrew Morton, lkml, Eric Paris, James Morris
Ar Iau, 2006-08-24 am 09:13 -0400, ysgrifennodd Stephen Smalley:
> Take tty_mutex when accessing ->signal->tty in selinux code.
> Noted by Alan Cox. Longer term, we are looking at refactoring the code to provide better encapsulation of the tty layer, but this is a simple fix that addresses the immediate bug.
>
> Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Acked-by: Alan Cox <alan@redhat.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch 1/1] selinux: fix tty locking
2006-08-24 13:13 [patch 1/1] selinux: fix tty locking Stephen Smalley
2006-08-24 14:08 ` Alan Cox
@ 2006-08-24 15:02 ` James Morris
1 sibling, 0 replies; 3+ messages in thread
From: James Morris @ 2006-08-24 15:02 UTC (permalink / raw)
To: Stephen Smalley; +Cc: Andrew Morton, lkml, Eric Paris, Alan Cox
On Thu, 24 Aug 2006, Stephen Smalley wrote:
> Take tty_mutex when accessing ->signal->tty in selinux code.
> Noted by Alan Cox. Longer term, we are looking at refactoring the code to provide better encapsulation of the tty layer, but this is a simple fix that addresses the immediate bug.
>
> Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Acked-by: James Morris <jmorris@namei.org>
--
James Morris
<jmorris@namei.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-08-24 15:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-24 13:13 [patch 1/1] selinux: fix tty locking Stephen Smalley
2006-08-24 14:08 ` Alan Cox
2006-08-24 15:02 ` James Morris
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®