diff options
author | James Morris <james.l.morris@oracle.com> | 2015-07-11 01:13:45 +0200 |
---|---|---|
committer | James Morris <james.l.morris@oracle.com> | 2015-07-11 01:13:45 +0200 |
commit | 3dbbbe0eb6e949409d215f660cfad782aa541a4b (patch) | |
tree | 455a263e0155b7096cc5766a86c71fbc9879e08a /security/selinux/hooks.c | |
parent | Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm6... (diff) | |
parent | selinux: fix mprotect PROT_EXEC regression caused by mm change (diff) | |
download | linux-3dbbbe0eb6e949409d215f660cfad782aa541a4b.tar.xz linux-3dbbbe0eb6e949409d215f660cfad782aa541a4b.zip |
Merge branch 'upstream' of git://git.infradead.org/users/pcmoore/selinux into for-linus2
Diffstat (limited to 'security/selinux/hooks.c')
-rw-r--r-- | security/selinux/hooks.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 623108199641..564079c5c49d 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -3283,7 +3283,8 @@ static int file_map_prot_check(struct file *file, unsigned long prot, int shared int rc = 0; if (default_noexec && - (prot & PROT_EXEC) && (!file || (!shared && (prot & PROT_WRITE)))) { + (prot & PROT_EXEC) && (!file || IS_PRIVATE(file_inode(file)) || + (!shared && (prot & PROT_WRITE)))) { /* * We are making executable an anonymous mapping or a * private file mapping that will also be writable. |