Merge tag 'mm-stable-2024-03-13-20-04' of git://git.kernel.org/pub/scm/linux/kernel...
[sfrench/cifs-2.6.git] / init / main.c
index d002f30f7f24c99e124149cea43f613c15818fbe..390b3a16683940bff7cf0e3f65be52b42ce2b9bc 100644 (file)
@@ -88,6 +88,7 @@
 #include <linux/sched/task_stack.h>
 #include <linux/context_tracking.h>
 #include <linux/random.h>
+#include <linux/moduleloader.h>
 #include <linux/list.h>
 #include <linux/integrity.h>
 #include <linux/proc_ns.h>
 #include <linux/stackdepot.h>
 #include <linux/randomize_kstack.h>
 #include <linux/pidfs.h>
+#include <linux/ptdump.h>
 #include <net/net_namespace.h>
 
 #include <asm/io.h>
@@ -1406,12 +1408,13 @@ static void mark_readonly(void)
        if (IS_ENABLED(CONFIG_STRICT_KERNEL_RWX) && rodata_enabled) {
                /*
                 * load_module() results in W+X mappings, which are cleaned
-                * up with call_rcu().  Let's make sure that queued work is
+                * up with init_free_wq. Let's make sure that queued work is
                 * flushed so that we don't hit false positives looking for
                 * insecure pages which are W+X.
                 */
-               rcu_barrier();
+               flush_module_init_free_work();
                mark_rodata_ro();
+               debug_checkwx();
                rodata_test();
        } else if (IS_ENABLED(CONFIG_STRICT_KERNEL_RWX)) {
                pr_info("Kernel memory protection disabled.\n");