linux-modules.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] Fixup for 87b31159f78a ("module: Move all into module/")
@ 2022-02-22 10:23 Christophe Leroy
  2022-02-22 10:23 ` [PATCH 2/4] Fixup for 1df95c1b9fb2 ("module: Move latched RB-tree support to a separate file") Christophe Leroy
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Christophe Leroy @ 2022-02-22 10:23 UTC (permalink / raw)
  To: Aaron Tomlin, Luis Chamberlain, linux-modules
  Cc: Christophe Leroy, linux-kernel

Fixes: 87b31159f78a ("module: Move all into module/")
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
 kernel/Makefile        | 1 -
 kernel/module/Makefile | 4 ++++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/kernel/Makefile b/kernel/Makefile
index 3a6380975c57..04cb6932c0d3 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -29,7 +29,6 @@ KCOV_INSTRUMENT_softirq.o := n
 KCSAN_SANITIZE_softirq.o = n
 # These are called from save_stack_trace() on slub debug path,
 # and produce insane amounts of uninteresting coverage.
-KCOV_INSTRUMENT_module.o := n
 KCOV_INSTRUMENT_extable.o := n
 KCOV_INSTRUMENT_stacktrace.o := n
 # Don't self-instrument.
diff --git a/kernel/module/Makefile b/kernel/module/Makefile
index 686ca921fc8f..b57953bd47eb 100644
--- a/kernel/module/Makefile
+++ b/kernel/module/Makefile
@@ -3,6 +3,10 @@
 # Makefile for linux kernel module support
 #
 
+# These are called from save_stack_trace() on slub debug path,
+# and produce insane amounts of uninteresting coverage.
+KCOV_INSTRUMENT_main.o := n
+
 obj-$(CONFIG_MODULES) += main.o
 obj-$(CONFIG_MODULE_DECOMPRESS) += decompress.o
 obj-$(CONFIG_MODULE_SIG) += signing.o
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/4] Fixup for 1df95c1b9fb2 ("module: Move latched RB-tree support to a separate file")
  2022-02-22 10:23 [PATCH 1/4] Fixup for 87b31159f78a ("module: Move all into module/") Christophe Leroy
@ 2022-02-22 10:23 ` Christophe Leroy
  2022-02-22 10:23 ` [PATCH 3/4] Fixup for e5973a14d187 ("module: Move strict rwx " Christophe Leroy
  2022-02-22 10:23 ` [PATCH 4/4] Fixup for 54f2273e5fef ("module: Move kallsyms support into " Christophe Leroy
  2 siblings, 0 replies; 4+ messages in thread
From: Christophe Leroy @ 2022-02-22 10:23 UTC (permalink / raw)
  To: Aaron Tomlin, Luis Chamberlain, linux-modules
  Cc: Christophe Leroy, linux-kernel

Fixes: 1df95c1b9fb2 ("module: Move latched RB-tree support to a separate file")
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
 kernel/module/internal.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/module/internal.h b/kernel/module/internal.h
index 47353c2e595b..97d9faec3a9a 100644
--- a/kernel/module/internal.h
+++ b/kernel/module/internal.h
@@ -158,9 +158,9 @@ void mod_tree_remove(struct module *mod);
 struct module *mod_find(unsigned long addr);
 #else /* !CONFIG_MODULES_TREE_LOOKUP */
 
-static void mod_tree_insert(struct module *mod) { }
-static void mod_tree_remove_init(struct module *mod) { }
-static void mod_tree_remove(struct module *mod) { }
+static inline void mod_tree_insert(struct module *mod) { }
+static inline void mod_tree_remove_init(struct module *mod) { }
+static inline void mod_tree_remove(struct module *mod) { }
 static inline struct module *mod_find(unsigned long addr)
 {
 	struct module *mod;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/4] Fixup for e5973a14d187 ("module: Move strict rwx support to a separate file")
  2022-02-22 10:23 [PATCH 1/4] Fixup for 87b31159f78a ("module: Move all into module/") Christophe Leroy
  2022-02-22 10:23 ` [PATCH 2/4] Fixup for 1df95c1b9fb2 ("module: Move latched RB-tree support to a separate file") Christophe Leroy
@ 2022-02-22 10:23 ` Christophe Leroy
  2022-02-22 10:23 ` [PATCH 4/4] Fixup for 54f2273e5fef ("module: Move kallsyms support into " Christophe Leroy
  2 siblings, 0 replies; 4+ messages in thread
From: Christophe Leroy @ 2022-02-22 10:23 UTC (permalink / raw)
  To: Aaron Tomlin, Luis Chamberlain, linux-modules
  Cc: Christophe Leroy, linux-kernel

Fixes: e5973a14d187 ("module: Move strict rwx support to a separate file")
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
 kernel/module/internal.h   | 14 ++++----------
 kernel/module/strict_rwx.c | 13 +++++++------
 2 files changed, 11 insertions(+), 16 deletions(-)

diff --git a/kernel/module/internal.h b/kernel/module/internal.h
index 97d9faec3a9a..6a54a1e06f4f 100644
--- a/kernel/module/internal.h
+++ b/kernel/module/internal.h
@@ -181,22 +181,16 @@ void frob_text(const struct module_layout *layout, int (*set_memory)(unsigned lo
 #endif /* CONFIG_ARCH_HAS_STRICT_MODULE_RWX */
 
 #ifdef CONFIG_STRICT_MODULE_RWX
-void frob_rodata(const struct module_layout *layout,
-		 int (*set_memory)(unsigned long start, int num_pages));
-void frob_ro_after_init(const struct module_layout *layout,
-			int (*set_memory)(unsigned long start, int num_pages));
-void frob_writable_data(const struct module_layout *layout,
-			int (*set_memory)(unsigned long start, int num_pages));
 void module_enable_ro(const struct module *mod, bool after_init);
 void module_enable_nx(const struct module *mod);
 int module_enforce_rwx_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
 				char *secstrings, struct module *mod);
 
 #else /* !CONFIG_STRICT_MODULE_RWX */
-static void module_enable_nx(const struct module *mod) { }
-static void module_enable_ro(const struct module *mod, bool after_init) {}
-static int module_enforce_rwx_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
-				       char *secstrings, struct module *mod)
+static inline void module_enable_nx(const struct module *mod) { }
+static inline void module_enable_ro(const struct module *mod, bool after_init) {}
+static inline int module_enforce_rwx_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
+					      char *secstrings, struct module *mod)
 {
 	return 0;
 }
diff --git a/kernel/module/strict_rwx.c b/kernel/module/strict_rwx.c
index c642889f8e77..bfee740f4bc1 100644
--- a/kernel/module/strict_rwx.c
+++ b/kernel/module/strict_rwx.c
@@ -6,12 +6,13 @@
  */
 
 #include <linux/module.h>
+#include <linux/mm.h>
 #include <linux/vmalloc.h>
 #include <linux/set_memory.h>
 #include "internal.h"
 
-void frob_rodata(const struct module_layout *layout,
-		 int (*set_memory)(unsigned long start, int num_pages))
+static void frob_rodata(const struct module_layout *layout,
+			int (*set_memory)(unsigned long start, int num_pages))
 {
 	BUG_ON(!PAGE_ALIGNED(layout->base));
 	BUG_ON(!PAGE_ALIGNED(layout->text_size));
@@ -20,8 +21,8 @@ void frob_rodata(const struct module_layout *layout,
 		   (layout->ro_size - layout->text_size) >> PAGE_SHIFT);
 }
 
-void frob_ro_after_init(const struct module_layout *layout,
-			int (*set_memory)(unsigned long start, int num_pages))
+static void frob_ro_after_init(const struct module_layout *layout,
+			       int (*set_memory)(unsigned long start, int num_pages))
 {
 	BUG_ON(!PAGE_ALIGNED(layout->base));
 	BUG_ON(!PAGE_ALIGNED(layout->ro_size));
@@ -30,8 +31,8 @@ void frob_ro_after_init(const struct module_layout *layout,
 		   (layout->ro_after_init_size - layout->ro_size) >> PAGE_SHIFT);
 }
 
-void frob_writable_data(const struct module_layout *layout,
-			int (*set_memory)(unsigned long start, int num_pages))
+static void frob_writable_data(const struct module_layout *layout,
+			       int (*set_memory)(unsigned long start, int num_pages))
 {
 	BUG_ON(!PAGE_ALIGNED(layout->base));
 	BUG_ON(!PAGE_ALIGNED(layout->ro_after_init_size));
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 4/4] Fixup for 54f2273e5fef ("module: Move kallsyms support into a separate file")
  2022-02-22 10:23 [PATCH 1/4] Fixup for 87b31159f78a ("module: Move all into module/") Christophe Leroy
  2022-02-22 10:23 ` [PATCH 2/4] Fixup for 1df95c1b9fb2 ("module: Move latched RB-tree support to a separate file") Christophe Leroy
  2022-02-22 10:23 ` [PATCH 3/4] Fixup for e5973a14d187 ("module: Move strict rwx " Christophe Leroy
@ 2022-02-22 10:23 ` Christophe Leroy
  2 siblings, 0 replies; 4+ messages in thread
From: Christophe Leroy @ 2022-02-22 10:23 UTC (permalink / raw)
  To: Aaron Tomlin, Luis Chamberlain, linux-modules
  Cc: Christophe Leroy, linux-kernel

Fixes: 54f2273e5fef ("module: Move kallsyms support into a separate file")
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
 kernel/module/internal.h | 7 ++++---
 kernel/module/kallsyms.c | 3 +--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/kernel/module/internal.h b/kernel/module/internal.h
index 6a54a1e06f4f..fecfa590c149 100644
--- a/kernel/module/internal.h
+++ b/kernel/module/internal.h
@@ -212,12 +212,13 @@ static inline void kmemleak_load_module(const struct module *mod,
 					const struct load_info *info) { }
 #endif /* CONFIG_DEBUG_KMEMLEAK */
 
-#ifdef CONFIG_KALLSYMS
-#ifdef CONFIG_STACKTRACE_BUILD_ID
+#if defined(CONFIG_KALLSYMS) && defined(CONFIG_STACKTRACE_BUILD_ID)
 void init_build_id(struct module *mod, const struct load_info *info);
-#else /* !CONFIG_STACKTRACE_BUILD_ID */
+#else
 static inline void init_build_id(struct module *mod, const struct load_info *info) { }
 #endif
+
+#ifdef CONFIG_KALLSYMS
 void layout_symtab(struct module *mod, struct load_info *info);
 void add_kallsyms(struct module *mod, const struct load_info *info);
 unsigned long find_kallsyms_symbol_value(struct module *mod, const char *name);
diff --git a/kernel/module/kallsyms.c b/kernel/module/kallsyms.c
index 6c8f1f390cf5..2ee8d2e67068 100644
--- a/kernel/module/kallsyms.c
+++ b/kernel/module/kallsyms.c
@@ -171,8 +171,7 @@ void add_kallsyms(struct module *mod, const struct load_info *info)
 	Elf_Shdr *symsec = &info->sechdrs[info->index.sym];
 
 	/* Set up to point into init section. */
-	mod->kallsyms = (struct mod_kallsyms __rcu *)mod->init_layout.base +
-		info->mod_kallsyms_init_off;
+	mod->kallsyms = (void __rcu *)mod->init_layout.base + info->mod_kallsyms_init_off;
 
 	/* The following is safe since this pointer cannot change */
 	rcu_dereference_sched(mod->kallsyms)->symtab = (void *)symsec->sh_addr;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-02-22 10:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-22 10:23 [PATCH 1/4] Fixup for 87b31159f78a ("module: Move all into module/") Christophe Leroy
2022-02-22 10:23 ` [PATCH 2/4] Fixup for 1df95c1b9fb2 ("module: Move latched RB-tree support to a separate file") Christophe Leroy
2022-02-22 10:23 ` [PATCH 3/4] Fixup for e5973a14d187 ("module: Move strict rwx " Christophe Leroy
2022-02-22 10:23 ` [PATCH 4/4] Fixup for 54f2273e5fef ("module: Move kallsyms support into " Christophe Leroy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).