@@ -22,6 +22,7 @@
#include <linux/ptrace.h> /* user_enable_single_step */
#include <linux/kdebug.h> /* notifier mechanism */
#include <linux/percpu-rwsem.h>
+#include <linux/userprocess.h>
#include <linux/task_work.h>
#include <linux/shmem_fs.h>
#include <linux/khugepaged.h>
@@ -1662,6 +1663,7 @@ static const struct vm_special_mapping xol_mapping = {
static int xol_add_vma(struct mm_struct *mm, struct xol_area *area)
{
struct vm_area_struct *vma;
+ unsigned long vm_flags;
int ret;
if (mmap_write_lock_killable(mm))
@@ -1682,8 +1684,10 @@ static int xol_add_vma(struct mm_struct *mm, struct xol_area *area)
}
}
+ vm_flags = VM_EXEC|VM_MAYEXEC|VM_DONTCOPY|VM_IO;
+ vm_flags |= mseal_system_mappings();
vma = _install_special_mapping(mm, area->vaddr, PAGE_SIZE,
- VM_EXEC|VM_MAYEXEC|VM_DONTCOPY|VM_IO,
+ vm_flags,
&xol_mapping);
if (IS_ERR(vma)) {
ret = PTR_ERR(vma);