X-Git-Url: https://bbs.cooldavid.org/git/?a=blobdiff_plain;f=security%2Fselinux%2Fhooks.c;h=4796ddd4e721ae454a02563d713aa235870ece02;hb=d996b62a8df1d935b01319bf8defb95b5709f7b8;hp=bd7da0f0ccf3f58a72784c1ed0e2042eb8cd1b38;hpb=ee2ffa0dfdd2db19705f2ba1c6a4c0bfe8122dd8;p=net-next-2.6.git diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index bd7da0f0ccf..4796ddd4e72 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -2172,6 +2172,7 @@ static inline void flush_unauthorized_files(const struct cred *cred, if (tty) { spin_lock(&tty_files_lock); if (!list_empty(&tty->tty_files)) { + struct tty_file_private *file_priv; struct inode *inode; /* Revalidate access to controlling tty. @@ -2179,7 +2180,9 @@ static inline void flush_unauthorized_files(const struct cred *cred, 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. */ - file = list_first_entry(&tty->tty_files, struct file, f_u.fu_list); + file_priv = list_first_entry(&tty->tty_files, + struct tty_file_private, list); + file = file_priv->file; inode = file->f_path.dentry->d_inode; if (inode_has_perm(cred, inode, FILE__READ | FILE__WRITE, NULL)) {