aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
Diffstat (limited to 'security')
-rw-r--r--security/selinux/hooks.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 312537d48050..692e3cc8ce23 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -3271,7 +3271,8 @@ static int file_map_prot_check(struct file *file, unsigned long prot, int shared
3271 int rc = 0; 3271 int rc = 0;
3272 3272
3273 if (default_noexec && 3273 if (default_noexec &&
3274 (prot & PROT_EXEC) && (!file || (!shared && (prot & PROT_WRITE)))) { 3274 (prot & PROT_EXEC) && (!file || IS_PRIVATE(file_inode(file)) ||
3275 (!shared && (prot & PROT_WRITE)))) {
3275 /* 3276 /*
3276 * We are making executable an anonymous mapping or a 3277 * We are making executable an anonymous mapping or a
3277 * private file mapping that will also be writable. 3278 * private file mapping that will also be writable.