Merge tag 'x86_mm_for_6.2_v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
[linux-2.6-microblaze.git] / arch / x86 / kernel / kprobes / core.c
index 01b8d95..6629968 100644 (file)
@@ -43,6 +43,7 @@
 #include <linux/objtool.h>
 #include <linux/vmalloc.h>
 #include <linux/pgtable.h>
+#include <linux/set_memory.h>
 
 #include <asm/text-patching.h>
 #include <asm/cacheflush.h>
@@ -51,7 +52,6 @@
 #include <asm/alternative.h>
 #include <asm/insn.h>
 #include <asm/debugreg.h>
-#include <asm/set_memory.h>
 #include <asm/ibt.h>
 
 #include "common.h"
@@ -414,17 +414,11 @@ void *alloc_insn_page(void)
        if (!page)
                return NULL;
 
-       /*
-        * First make the page read-only, and only then make it executable to
-        * prevent it from being W+X in between.
-        */
-       set_memory_ro((unsigned long)page, 1);
-
        /*
         * TODO: Once additional kernel code protection mechanisms are set, ensure
         * that the page was not maliciously altered and it is still zeroed.
         */
-       set_memory_x((unsigned long)page, 1);
+       set_memory_rox((unsigned long)page, 1);
 
        return page;
 }