diff options
| author | Ingo Molnar <mingo@elte.hu> | 2008-12-12 11:53:43 +0100 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2008-12-12 11:53:43 +0100 |
| commit | e18d7af85296cb6999aae171e8a9f8612bea5ae0 (patch) | |
| tree | 97a675ecc17bef2f710c50f5ea2a480df0e362c0 /security/selinux/hooks.c | |
| parent | 3555105333ae55414d0fe051557bd7dc590f5255 (diff) | |
| parent | 8b1fae4e4200388b64dd88065639413cb3f1051c (diff) | |
| download | olio-linux-3.10-e18d7af85296cb6999aae171e8a9f8612bea5ae0.tar.xz olio-linux-3.10-e18d7af85296cb6999aae171e8a9f8612bea5ae0.zip | |
Merge commit 'v2.6.28-rc8' into x86/mm
Diffstat (limited to 'security/selinux/hooks.c')
| -rw-r--r-- | security/selinux/hooks.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 3e3fde7c1d2..f85597a4d73 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -2126,14 +2126,16 @@ static inline void flush_unauthorized_files(struct files_struct *files) tty = get_current_tty(); if (tty) { file_list_lock(); - file = list_entry(tty->tty_files.next, typeof(*file), f_u.fu_list); - if (file) { + if (!list_empty(&tty->tty_files)) { + struct inode *inode; + /* Revalidate access to controlling tty. Use inode_has_perm on the tty inode directly rather than using file_has_perm, as this particular open file may belong to another process and we are only interested in the inode-based check here. */ - struct inode *inode = file->f_path.dentry->d_inode; + file = list_first_entry(&tty->tty_files, struct file, f_u.fu_list); + inode = file->f_path.dentry->d_inode; if (inode_has_perm(current, inode, FILE__READ | FILE__WRITE, NULL)) { drop_tty = 1; |