Merge tag 'mm-stable-2024-03-13-20-04' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-microblaze.git] / kernel / module / main.c
index 689def7..e1e8a7a 100644 (file)
@@ -2489,6 +2489,11 @@ static void do_free_init(struct work_struct *w)
        }
 }
 
+void flush_module_init_free_work(void)
+{
+       flush_work(&init_free_wq);
+}
+
 #undef MODULE_PARAM_PREFIX
 #define MODULE_PARAM_PREFIX "module."
 /* Default value for module->async_probe_requested */
@@ -2595,8 +2600,8 @@ static noinline int do_init_module(struct module *mod)
         * Note that module_alloc() on most architectures creates W+X page
         * mappings which won't be cleaned up until do_free_init() runs.  Any
         * code such as mark_rodata_ro() which depends on those mappings to
-        * be cleaned up needs to sync with the queued work - ie
-        * rcu_barrier()
+        * be cleaned up needs to sync with the queued work by invoking
+        * flush_module_init_free_work().
         */
        if (llist_add(&freeinit->node, &init_free_list))
                schedule_work(&init_free_wq);