diff options
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 | |||
3283 | int rc = 0; | 3283 | int rc = 0; |
3284 | 3284 | ||
3285 | if (default_noexec && | 3285 | if (default_noexec && |
3286 | (prot & PROT_EXEC) && (!file || (!shared && (prot & PROT_WRITE)))) { | 3286 | (prot & PROT_EXEC) && (!file || IS_PRIVATE(file_inode(file)) || |
3287 | (!shared && (prot & PROT_WRITE)))) { | ||
3287 | /* | 3288 | /* |
3288 | * We are making executable an anonymous mapping or a | 3289 | * We are making executable an anonymous mapping or a |
3289 | * private file mapping that will also be writable. | 3290 | * private file mapping that will also be writable. |