mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
[PATCH] take noexec checks to very few callers that care
Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
e56b6a5dda
commit
30524472c2
3 changed files with 17 additions and 9 deletions
|
|
@ -118,6 +118,10 @@ asmlinkage long sys_uselib(const char __user * library)
|
|||
if (!S_ISREG(nd.path.dentry->d_inode->i_mode))
|
||||
goto exit;
|
||||
|
||||
error = -EACCES;
|
||||
if (nd.path.mnt->mnt_flags & MNT_NOEXEC)
|
||||
goto exit;
|
||||
|
||||
error = vfs_permission(&nd, MAY_READ | MAY_EXEC | MAY_OPEN);
|
||||
if (error)
|
||||
goto exit;
|
||||
|
|
@ -668,6 +672,9 @@ struct file *open_exec(const char *name)
|
|||
if (!S_ISREG(nd.path.dentry->d_inode->i_mode))
|
||||
goto out_path_put;
|
||||
|
||||
if (nd.path.mnt->mnt_flags & MNT_NOEXEC)
|
||||
goto out_path_put;
|
||||
|
||||
err = vfs_permission(&nd, MAY_EXEC | MAY_OPEN);
|
||||
if (err)
|
||||
goto out_path_put;
|
||||
|
|
|
|||
Loading…
Reference in a new issue