diff options
| -rw-r--r-- | security/selinux/hooks.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 29c39e0b03ed..79f2c2cb68ad 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
| @@ -1822,12 +1822,12 @@ static inline int may_rename(struct inode *old_dir, | |||
| 1822 | 1822 | ||
| 1823 | ad.u.dentry = new_dentry; | 1823 | ad.u.dentry = new_dentry; |
| 1824 | av = DIR__ADD_NAME | DIR__SEARCH; | 1824 | av = DIR__ADD_NAME | DIR__SEARCH; |
| 1825 | if (new_dentry->d_inode) | 1825 | if (d_is_positive(new_dentry)) |
| 1826 | av |= DIR__REMOVE_NAME; | 1826 | av |= DIR__REMOVE_NAME; |
| 1827 | rc = avc_has_perm(sid, new_dsec->sid, SECCLASS_DIR, av, &ad); | 1827 | rc = avc_has_perm(sid, new_dsec->sid, SECCLASS_DIR, av, &ad); |
| 1828 | if (rc) | 1828 | if (rc) |
| 1829 | return rc; | 1829 | return rc; |
| 1830 | if (new_dentry->d_inode) { | 1830 | if (d_is_positive(new_dentry)) { |
| 1831 | new_isec = new_dentry->d_inode->i_security; | 1831 | new_isec = new_dentry->d_inode->i_security; |
| 1832 | new_is_dir = S_ISDIR(new_dentry->d_inode->i_mode); | 1832 | new_is_dir = S_ISDIR(new_dentry->d_inode->i_mode); |
| 1833 | rc = avc_has_perm(sid, new_isec->sid, | 1833 | rc = avc_has_perm(sid, new_isec->sid, |
