]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - security/commoncap.c
UBUNTU: SAUCE: Import aufs driver
[mirror_ubuntu-bionic-kernel.git] / security / commoncap.c
index 48620c93d6976eca3a9b1cc3c34cfe21a69c7a39..aeefd8f12b8484e4206f14573efa1838822f55c6 100644 (file)
@@ -660,7 +660,7 @@ static int get_file_caps(struct linux_binprm *bprm, bool *effective, bool *has_f
        if (!file_caps_enabled)
                return 0;
 
-       if (!mnt_may_suid(bprm->file->f_path.mnt))
+       if (path_nosuid(&bprm->file->f_path))
                return 0;
 
        /*
@@ -929,7 +929,7 @@ int cap_inode_setxattr(struct dentry *dentry, const char *name,
        if (strcmp(name, XATTR_NAME_CAPS) == 0)
                return 0;
 
-       if (!capable(CAP_SYS_ADMIN))
+       if (!ns_capable(dentry->d_sb->s_user_ns, CAP_SYS_ADMIN))
                return -EPERM;
        return 0;
 }
@@ -962,7 +962,7 @@ int cap_inode_removexattr(struct dentry *dentry, const char *name)
                return 0;
        }
 
-       if (!capable(CAP_SYS_ADMIN))
+       if (!ns_capable(dentry->d_sb->s_user_ns, CAP_SYS_ADMIN))
                return -EPERM;
        return 0;
 }
@@ -1330,12 +1330,14 @@ int cap_mmap_addr(unsigned long addr)
        }
        return ret;
 }
+EXPORT_SYMBOL_GPL(cap_mmap_addr);
 
 int cap_mmap_file(struct file *file, unsigned long reqprot,
                  unsigned long prot, unsigned long flags)
 {
        return 0;
 }
+EXPORT_SYMBOL_GPL(cap_mmap_file);
 
 #ifdef CONFIG_SECURITY