Skip to content

Draft: modules: wait do_free_init correctly

Upstream Status: linux-next

Conflicts: include for linux/moduleloader.h in init/main.c due to missing upstream commits for related to module subsystem. kernel/module.c was renamed to kernel/module/main.c in upstream. Getting the module subsystem up to date with what's upstream is going to require backporting at least 90 commits, and more risk, so I went with the simple approach.

commit 1792e2651c94a487326ec79f439388d884698498 (HEAD -> master) Author: Changbin Du changbin.du@huawei.com Date: Mon Jan 29 10:03:04 2024 +0800

modules: wait do_free_init correctly

The commit 1a7b7d922081 ("modules: Use vmalloc special flag") moves
do_free_init() into a global workqueue instead of call_rcu(). So now 
rcu_barrier() can not ensure that do_free_init has completed. We should
wait it via flush_work().

Without this fix, we still could encounter false positive reports in
W+X checking, and rcu synchronization is unnecessary.

Fixes: 1a7b7d922081 ("modules: Use vmalloc special flag")
Signed-off-by: Changbin Du <changbin.du@huawei.com>
Cc: Xiaoyi Su <suxiaoyi@huawei.com>

Signed-off-by: Brian Masney bmasney@redhat.com

Merge request reports