aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--security/selinux/hooks.c20
-rw-r--r--security/selinux/selinuxfs.c8
2 files changed, 14 insertions, 14 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index f5df8c70a9b5..3753416eb9b9 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -1120,8 +1120,8 @@ static int file_has_perm(struct task_struct *tsk,
1120{ 1120{
1121 struct task_security_struct *tsec = tsk->security; 1121 struct task_security_struct *tsec = tsk->security;
1122 struct file_security_struct *fsec = file->f_security; 1122 struct file_security_struct *fsec = file->f_security;
1123 struct vfsmount *mnt = file->f_vfsmnt; 1123 struct vfsmount *mnt = file->f_path.mnt;
1124 struct dentry *dentry = file->f_dentry; 1124 struct dentry *dentry = file->f_path.dentry;
1125 struct inode *inode = dentry->d_inode; 1125 struct inode *inode = dentry->d_inode;
1126 struct avc_audit_data ad; 1126 struct avc_audit_data ad;
1127 int rc; 1127 int rc;
@@ -1581,7 +1581,7 @@ static int selinux_bprm_alloc_security(struct linux_binprm *bprm)
1581static int selinux_bprm_set_security(struct linux_binprm *bprm) 1581static int selinux_bprm_set_security(struct linux_binprm *bprm)
1582{ 1582{
1583 struct task_security_struct *tsec; 1583 struct task_security_struct *tsec;
1584 struct inode *inode = bprm->file->f_dentry->d_inode; 1584 struct inode *inode = bprm->file->f_path.dentry->d_inode;
1585 struct inode_security_struct *isec; 1585 struct inode_security_struct *isec;
1586 struct bprm_security_struct *bsec; 1586 struct bprm_security_struct *bsec;
1587 u32 newsid; 1587 u32 newsid;
@@ -1621,10 +1621,10 @@ static int selinux_bprm_set_security(struct linux_binprm *bprm)
1621 } 1621 }
1622 1622
1623 AVC_AUDIT_DATA_INIT(&ad, FS); 1623 AVC_AUDIT_DATA_INIT(&ad, FS);
1624 ad.u.fs.mnt = bprm->file->f_vfsmnt; 1624 ad.u.fs.mnt = bprm->file->f_path.mnt;
1625 ad.u.fs.dentry = bprm->file->f_dentry; 1625 ad.u.fs.dentry = bprm->file->f_path.dentry;
1626 1626
1627 if (bprm->file->f_vfsmnt->mnt_flags & MNT_NOSUID) 1627 if (bprm->file->f_path.mnt->mnt_flags & MNT_NOSUID)
1628 newsid = tsec->sid; 1628 newsid = tsec->sid;
1629 1629
1630 if (tsec->sid == newsid) { 1630 if (tsec->sid == newsid) {
@@ -1708,7 +1708,7 @@ static inline void flush_unauthorized_files(struct files_struct * files)
1708 than using file_has_perm, as this particular open 1708 than using file_has_perm, as this particular open
1709 file may belong to another process and we are only 1709 file may belong to another process and we are only
1710 interested in the inode-based check here. */ 1710 interested in the inode-based check here. */
1711 struct inode *inode = file->f_dentry->d_inode; 1711 struct inode *inode = file->f_path.dentry->d_inode;
1712 if (inode_has_perm(current, inode, 1712 if (inode_has_perm(current, inode,
1713 FILE__READ | FILE__WRITE, NULL)) { 1713 FILE__READ | FILE__WRITE, NULL)) {
1714 drop_tty = 1; 1714 drop_tty = 1;
@@ -2420,7 +2420,7 @@ static int selinux_inode_listsecurity(struct inode *inode, char *buffer, size_t
2420static int selinux_file_permission(struct file *file, int mask) 2420static int selinux_file_permission(struct file *file, int mask)
2421{ 2421{
2422 int rc; 2422 int rc;
2423 struct inode *inode = file->f_dentry->d_inode; 2423 struct inode *inode = file->f_path.dentry->d_inode;
2424 2424
2425 if (!mask) { 2425 if (!mask) {
2426 /* No permission to check. Existence test. */ 2426 /* No permission to check. Existence test. */
@@ -2597,7 +2597,7 @@ static int selinux_file_fcntl(struct file *file, unsigned int cmd,
2597 2597
2598 switch (cmd) { 2598 switch (cmd) {
2599 case F_SETFL: 2599 case F_SETFL:
2600 if (!file->f_dentry || !file->f_dentry->d_inode) { 2600 if (!file->f_path.dentry || !file->f_path.dentry->d_inode) {
2601 err = -EINVAL; 2601 err = -EINVAL;
2602 break; 2602 break;
2603 } 2603 }
@@ -2623,7 +2623,7 @@ static int selinux_file_fcntl(struct file *file, unsigned int cmd,
2623 case F_SETLK64: 2623 case F_SETLK64:
2624 case F_SETLKW64: 2624 case F_SETLKW64:
2625#endif 2625#endif
2626 if (!file->f_dentry || !file->f_dentry->d_inode) { 2626 if (!file->f_path.dentry || !file->f_path.dentry->d_inode) {
2627 err = -EINVAL; 2627 err = -EINVAL;
2628 break; 2628 break;
2629 } 2629 }
diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
index cd244419c980..c8bf6e172f6e 100644
--- a/security/selinux/selinuxfs.c
+++ b/security/selinux/selinuxfs.c
@@ -448,7 +448,7 @@ static ssize_t (*write_op[])(struct file *, char *, size_t) = {
448 448
449static ssize_t selinux_transaction_write(struct file *file, const char __user *buf, size_t size, loff_t *pos) 449static ssize_t selinux_transaction_write(struct file *file, const char __user *buf, size_t size, loff_t *pos)
450{ 450{
451 ino_t ino = file->f_dentry->d_inode->i_ino; 451 ino_t ino = file->f_path.dentry->d_inode->i_ino;
452 char *data; 452 char *data;
453 ssize_t rv; 453 ssize_t rv;
454 454
@@ -805,7 +805,7 @@ static ssize_t sel_read_bool(struct file *filep, char __user *buf,
805 goto out; 805 goto out;
806 } 806 }
807 807
808 inode = filep->f_dentry->d_inode; 808 inode = filep->f_path.dentry->d_inode;
809 cur_enforcing = security_get_bool_value(inode->i_ino - BOOL_INO_OFFSET); 809 cur_enforcing = security_get_bool_value(inode->i_ino - BOOL_INO_OFFSET);
810 if (cur_enforcing < 0) { 810 if (cur_enforcing < 0) {
811 ret = cur_enforcing; 811 ret = cur_enforcing;
@@ -864,7 +864,7 @@ static ssize_t sel_write_bool(struct file *filep, const char __user *buf,
864 if (new_value) 864 if (new_value)
865 new_value = 1; 865 new_value = 1;
866 866
867 inode = filep->f_dentry->d_inode; 867 inode = filep->f_path.dentry->d_inode;
868 bool_pending_values[inode->i_ino - BOOL_INO_OFFSET] = new_value; 868 bool_pending_values[inode->i_ino - BOOL_INO_OFFSET] = new_value;
869 length = count; 869 length = count;
870 870
@@ -965,7 +965,7 @@ static void sel_remove_bools(struct dentry *de)
965 file_list_lock(); 965 file_list_lock();
966 list_for_each(p, &sb->s_files) { 966 list_for_each(p, &sb->s_files) {
967 struct file * filp = list_entry(p, struct file, f_u.fu_list); 967 struct file * filp = list_entry(p, struct file, f_u.fu_list);
968 struct dentry * dentry = filp->f_dentry; 968 struct dentry * dentry = filp->f_path.dentry;
969 969
970 if (dentry->d_parent != de) { 970 if (dentry->d_parent != de) {
971 continue; 971 continue;