DivestOS/Patches/Linux_CVEs/CVE-2016-10044/ANY/0003.patch

23 lines
542 B
Diff
Raw Normal View History

2017-10-29 22:14:37 -04:00
diff --git a/fs/aio.c b/fs/aio.c
index 9798d4e..0f2c38f 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -35,6 +35,7 @@
#include <linux/eventfd.h>
#include <linux/blkdev.h>
#include <linux/compat.h>
+#include <linux/personality.h>
#include <asm/kmap_types.h>
#include <asm/uaccess.h>
@@ -153,6 +154,9 @@
unsigned long size, populate;
int nr_pages;
+ if (current->personality & READ_IMPLIES_EXEC)
+ return -EPERM;
+
/* Compensate for the ring buffer's head/tail overlap entry */
nr_events += 2; /* 1 is required, 2 for good luck */