vfs: Commit to never having exectuables on proc and sysfs.
[firefly-linux-kernel-4.4.55.git] / security / security.c
index 595fffab48b0a27077efa75ec9dd64e6983ae2d9..062f3c997fdc32a585c0ac02f72a108fee094f53 100644 (file)
@@ -776,7 +776,7 @@ static inline unsigned long mmap_prot(struct file *file, unsigned long prot)
         * ditto if it's not on noexec mount, except that on !MMU we need
         * NOMMU_MAP_EXEC (== VM_MAYEXEC) in this case
         */
-       if (!(file->f_path.mnt->mnt_flags & MNT_NOEXEC)) {
+       if (!path_noexec(&file->f_path)) {
 #ifndef CONFIG_MMU
                if (file->f_op->mmap_capabilities) {
                        unsigned caps = file->f_op->mmap_capabilities(file);