Commit b20c8122 authored by Stephen Smalley's avatar Stephen Smalley Committed by Linus Torvalds
Browse files

[PATCH] selinux: fix tty locking

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: default avatarStephen Smalley <>
Acked-by: default avatarAlan Cox <>
Acked-by: default avatarJames Morris <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent bc7e982b
......@@ -1689,10 +1689,12 @@ static inline void flush_unauthorized_files(struct files_struct * files)
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;
tty = current->signal->tty;
if (tty) {
file = list_entry(tty->, typeof(*file), f_u.fu_list);
......@@ -1712,6 +1714,7 @@ static inline void flush_unauthorized_files(struct files_struct * files)
/* Revalidate access to inherited open files. */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment