summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2016-01-10 08:35:23 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-01-28 02:13:28 +0300
commit4a510969374ab8853451c337e43d28fb864e43fd (patch)
tree7868ef29c68bd7265dcf6fe5b2ab4088abeb7842 /security
parent527ffc11e1c0aa049b3a831d6f07ed98e06a0819 (diff)
downloadlinux-4a510969374ab8853451c337e43d28fb864e43fd.tar.xz
tty: Make tty_files_lock per-tty
Access to tty->tty_files list is always per-tty, never for all ttys simultaneously. Replace global tty_files_lock spinlock with per-tty ->files_lock. Initialize when the ->tty_files list is inited, in alloc_tty_struct(). Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'security')
-rw-r--r--security/selinux/hooks.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index f8110cfd80ff..8010bc5391c3 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -2415,7 +2415,7 @@ static inline void flush_unauthorized_files(const struct cred *cred,
tty = get_current_tty();
if (tty) {
- spin_lock(&tty_files_lock);
+ spin_lock(&tty->files_lock);
if (!list_empty(&tty->tty_files)) {
struct tty_file_private *file_priv;
@@ -2430,7 +2430,7 @@ static inline void flush_unauthorized_files(const struct cred *cred,
if (file_path_has_perm(cred, file, FILE__READ | FILE__WRITE))
drop_tty = 1;
}
- spin_unlock(&tty_files_lock);
+ spin_unlock(&tty->files_lock);
tty_kref_put(tty);
}
/* Reset controlling tty. */