diff options
| author | Mark Brown <[email protected]> | 2015-10-12 18:09:27 +0100 | 
|---|---|---|
| committer | Mark Brown <[email protected]> | 2015-10-12 18:09:27 +0100 | 
| commit | 79828b4fa835f73cdaf4bffa48696abdcbea9d02 (patch) | |
| tree | 5e0fa7156acb75ba603022bc807df8f2fedb97a8 /fs/exec.c | |
| parent | 721b51fcf91898299d96f4b72cb9434cda29dce6 (diff) | |
| parent | 8c1a9d6323abf0fb1e5dad96cf3f1c783505ea5a (diff) | |
Merge remote-tracking branch 'asoc/fix/rt5645' into asoc-fix-rt5645
Diffstat (limited to 'fs/exec.c')
| -rw-r--r-- | fs/exec.c | 10 | 
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/exec.c b/fs/exec.c index 1977c2a553ac..b06623a9347f 100644 --- 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);  } +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 @@ -132,7 +138,7 @@ SYSCALL_DEFINE1(uselib, const char __user *, library)  		goto exit;  	error = -EACCES; -	if (file->f_path.mnt->mnt_flags & MNT_NOEXEC) +	if (path_noexec(&file->f_path))  		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 (file->f_path.mnt->mnt_flags & MNT_NOEXEC) +	if (path_noexec(&file->f_path))  		goto exit;  	err = deny_write_access(file);  |