projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'pcmcia' of git://ftp.arm.linux.org.uk/~rmk/linux-arm
[firefly-linux-kernel-4.4.55.git]
/
fs
/
exec.c
diff --git
a/fs/exec.c
b/fs/exec.c
index 1977c2a553aca711ba145d1670ea9a84fd45ea84..b06623a9347f4f206fb466c80574ec4bdd7d13fa 100644
(file)
--- a/
fs/exec.c
+++ b/
fs/exec.c
@@
-98,6
+98,12
@@
static inline void put_binfmt(struct linux_binfmt * fmt)
module_put(fmt->module);
}
module_put(fmt->module);
}
+bool path_noexec(const struct path *path)
+{
+ return (path->mnt->mnt_flags & MNT_NOEXEC) ||
+ (path->mnt->mnt_sb->s_iflags & SB_I_NOEXEC);
+}
+
#ifdef CONFIG_USELIB
/*
* Note that a shared library must be both readable and executable due to
#ifdef CONFIG_USELIB
/*
* Note that a shared library must be both readable and executable due to
@@
-132,7
+138,7
@@
SYSCALL_DEFINE1(uselib, const char __user *, library)
goto exit;
error = -EACCES;
goto exit;
error = -EACCES;
- if (
file->f_path.mnt->mnt_flags & MNT_NOEXEC
)
+ if (
path_noexec(&file->f_path)
)
goto exit;
fsnotify_open(file);
goto exit;
fsnotify_open(file);
@@
-777,7
+783,7
@@
static struct file *do_open_execat(int fd, struct filename *name, int flags)
if (!S_ISREG(file_inode(file)->i_mode))
goto exit;
if (!S_ISREG(file_inode(file)->i_mode))
goto exit;
- if (
file->f_path.mnt->mnt_flags & MNT_NOEXEC
)
+ if (
path_noexec(&file->f_path)
)
goto exit;
err = deny_write_access(file);
goto exit;
err = deny_write_access(file);