Commit 3d5ff529ea222461a5fa3c4df05cbdc5eb56864d

Authored by Josef Sipek
Committed by Linus Torvalds
1 parent 7ac6207b2a

[PATCH] struct path: convert selinux

Signed-off-by: Josef Sipek <jsipek@fsl.cs.sunysb.edu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 2 changed files with 14 additions and 14 deletions Side-by-side Diff

security/selinux/hooks.c
... ... @@ -1120,8 +1120,8 @@
1120 1120 {
1121 1121 struct task_security_struct *tsec = tsk->security;
1122 1122 struct file_security_struct *fsec = file->f_security;
1123   - struct vfsmount *mnt = file->f_vfsmnt;
1124   - struct dentry *dentry = file->f_dentry;
  1123 + struct vfsmount *mnt = file->f_path.mnt;
  1124 + struct dentry *dentry = file->f_path.dentry;
1125 1125 struct inode *inode = dentry->d_inode;
1126 1126 struct avc_audit_data ad;
1127 1127 int rc;
... ... @@ -1581,7 +1581,7 @@
1581 1581 static int selinux_bprm_set_security(struct linux_binprm *bprm)
1582 1582 {
1583 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 1585 struct inode_security_struct *isec;
1586 1586 struct bprm_security_struct *bsec;
1587 1587 u32 newsid;
1588 1588  
... ... @@ -1621,10 +1621,10 @@
1621 1621 }
1622 1622  
1623 1623 AVC_AUDIT_DATA_INIT(&ad, FS);
1624   - ad.u.fs.mnt = bprm->file->f_vfsmnt;
1625   - ad.u.fs.dentry = bprm->file->f_dentry;
  1624 + ad.u.fs.mnt = bprm->file->f_path.mnt;
  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 1628 newsid = tsec->sid;
1629 1629  
1630 1630 if (tsec->sid == newsid) {
... ... @@ -1708,7 +1708,7 @@
1708 1708 than using file_has_perm, as this particular open
1709 1709 file may belong to another process and we are only
1710 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 1712 if (inode_has_perm(current, inode,
1713 1713 FILE__READ | FILE__WRITE, NULL)) {
1714 1714 drop_tty = 1;
... ... @@ -2420,7 +2420,7 @@
2420 2420 static int selinux_file_permission(struct file *file, int mask)
2421 2421 {
2422 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 2425 if (!mask) {
2426 2426 /* No permission to check. Existence test. */
... ... @@ -2597,7 +2597,7 @@
2597 2597  
2598 2598 switch (cmd) {
2599 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 2601 err = -EINVAL;
2602 2602 break;
2603 2603 }
... ... @@ -2623,7 +2623,7 @@
2623 2623 case F_SETLK64:
2624 2624 case F_SETLKW64:
2625 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 2627 err = -EINVAL;
2628 2628 break;
2629 2629 }
security/selinux/selinuxfs.c
... ... @@ -448,7 +448,7 @@
448 448  
449 449 static 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 452 char *data;
453 453 ssize_t rv;
454 454  
... ... @@ -805,7 +805,7 @@
805 805 goto out;
806 806 }
807 807  
808   - inode = filep->f_dentry->d_inode;
  808 + inode = filep->f_path.dentry->d_inode;
809 809 cur_enforcing = security_get_bool_value(inode->i_ino - BOOL_INO_OFFSET);
810 810 if (cur_enforcing < 0) {
811 811 ret = cur_enforcing;
... ... @@ -864,7 +864,7 @@
864 864 if (new_value)
865 865 new_value = 1;
866 866  
867   - inode = filep->f_dentry->d_inode;
  867 + inode = filep->f_path.dentry->d_inode;
868 868 bool_pending_values[inode->i_ino - BOOL_INO_OFFSET] = new_value;
869 869 length = count;
870 870  
... ... @@ -965,7 +965,7 @@
965 965 file_list_lock();
966 966 list_for_each(p, &sb->s_files) {
967 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 970 if (dentry->d_parent != de) {
971 971 continue;