aboutsummaryrefslogtreecommitdiffstats
path: root/mm/filemap.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/filemap.c')
-rw-r--r--mm/filemap.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/mm/filemap.c b/mm/filemap.c
index 4fb1546bbad6..79f24a969cb4 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1627,12 +1627,18 @@ int __remove_suid(struct dentry *dentry, int kill)
1627 1627
1628int remove_suid(struct dentry *dentry) 1628int remove_suid(struct dentry *dentry)
1629{ 1629{
1630 int kill = should_remove_suid(dentry); 1630 int killsuid = should_remove_suid(dentry);
1631 int killpriv = security_inode_need_killpriv(dentry);
1632 int error = 0;
1631 1633
1632 if (unlikely(kill)) 1634 if (killpriv < 0)
1633 return __remove_suid(dentry, kill); 1635 return killpriv;
1636 if (killpriv)
1637 error = security_inode_killpriv(dentry);
1638 if (!error && killsuid)
1639 error = __remove_suid(dentry, killsuid);
1634 1640
1635 return 0; 1641 return error;
1636} 1642}
1637EXPORT_SYMBOL(remove_suid); 1643EXPORT_SYMBOL(remove_suid);
1638 1644