From f13bff1b6d55de341f37a24781df5a1253377db3 Mon Sep 17 00:00:00 2001 From: Petr Pavlu Date: Tue, 19 Aug 2025 14:13:37 +0200 Subject: module: Remove unused __INIT*_OR_MODULE macros Remove the __INIT_OR_MODULE, __INITDATA_OR_MODULE and __INITRODATA_OR_MODULE macros. These were introduced in commit 8b5a10fc6fd0 ("x86: properly annotate alternatives.c"). Only __INITRODATA_OR_MODULE was ever used, in arch/x86/kernel/alternative.c. In 2011, commit dc326fca2b64 ("x86, cpu: Clean up and unify the NOP selection infrastructure") removed this usage. Signed-off-by: Petr Pavlu Reviewed-by: Aaron Tomlin Reviewed-by: Daniel Gomez Reviewed-by: Sami Tolvanen Signed-off-by: Sami Tolvanen --- include/linux/module.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'include/linux') diff --git a/include/linux/module.h b/include/linux/module.h index d80c3ea57472..fda5f2669c42 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -151,16 +151,10 @@ extern void cleanup_module(void); #define __init_or_module #define __initdata_or_module #define __initconst_or_module -#define __INIT_OR_MODULE .text -#define __INITDATA_OR_MODULE .data -#define __INITRODATA_OR_MODULE .section ".rodata","a",%progbits #else #define __init_or_module __init #define __initdata_or_module __initdata #define __initconst_or_module __initconst -#define __INIT_OR_MODULE __INIT -#define __INITDATA_OR_MODULE __INITDATA -#define __INITRODATA_OR_MODULE __INITRODATA #endif /*CONFIG_MODULES*/ struct module_kobject *lookup_or_create_module_kobject(const char *name); -- cgit v1.2.3 From 1ae719a43b0336678172b3eb55c5187816f9a130 Mon Sep 17 00:00:00 2001 From: Coiby Xu Date: Mon, 1 Dec 2025 11:06:05 +0800 Subject: module: Only declare set_module_sig_enforced when CONFIG_MODULE_SIG=y Currently if set_module_sig_enforced is called with CONFIG_MODULE_SIG=n e.g. [1], it can lead to a linking error, ld: security/integrity/ima/ima_appraise.o: in function `ima_appraise_measurement': security/integrity/ima/ima_appraise.c:587:(.text+0xbbb): undefined reference to `set_module_sig_enforced' This happens because the actual implementation of set_module_sig_enforced comes from CONFIG_MODULE_SIG but both the function declaration and the empty stub definition are tied to CONFIG_MODULES. So bind set_module_sig_enforced to CONFIG_MODULE_SIG instead. This allows (future) users to call set_module_sig_enforced directly without the "if IS_ENABLED(CONFIG_MODULE_SIG)" safeguard. Note this issue hasn't caused a real problem because all current callers of set_module_sig_enforced e.g. security/integrity/ima/ima_efi.c use "if IS_ENABLED(CONFIG_MODULE_SIG)" safeguard. [1] https://lore.kernel.org/lkml/20250928030358.3873311-1-coxu@redhat.com/ Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202510030029.VRKgik99-lkp@intel.com/ Reviewed-by: Aaron Tomlin Reviewed-by: Daniel Gomez Signed-off-by: Coiby Xu Signed-off-by: Sami Tolvanen --- include/linux/module.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'include/linux') diff --git a/include/linux/module.h b/include/linux/module.h index fda5f2669c42..20ddfd97630d 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -764,8 +764,6 @@ static inline bool is_livepatch_module(struct module *mod) #endif } -void set_module_sig_enforced(void); - void module_for_each_mod(int(*func)(struct module *mod, void *data), void *data); #else /* !CONFIG_MODULES... */ @@ -860,10 +858,6 @@ static inline bool module_requested_async_probing(struct module *module) } -static inline void set_module_sig_enforced(void) -{ -} - /* Dereference module function descriptor */ static inline void *dereference_module_function_descriptor(struct module *mod, void *ptr) @@ -919,6 +913,8 @@ static inline bool retpoline_module_ok(bool has_retpoline) #ifdef CONFIG_MODULE_SIG bool is_module_sig_enforced(void); +void set_module_sig_enforced(void); + static inline bool module_sig_ok(struct module *module) { return module->sig_ok; @@ -929,6 +925,10 @@ static inline bool is_module_sig_enforced(void) return false; } +static inline void set_module_sig_enforced(void) +{ +} + static inline bool module_sig_ok(struct module *module) { return true; -- cgit v1.2.3 From b68758e6f4307179247126b7641fa7ba7109c820 Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Sun, 14 Dec 2025 12:23:57 -0800 Subject: modules: moduleparam.h: fix kernel-doc comments Fix kernel-doc comments to prevent kernel-doc warnings: Warning: include/linux/moduleparam.h:364 function parameter 'arg' not described in '__core_param_cb' Warning: include/linux/moduleparam.h:395 No description found for return value of 'parameq' Warning: include/linux/moduleparam.h:405 No description found for return value of 'parameqn' Signed-off-by: Randy Dunlap Reviewed-by: Petr Pavlu [Sami: Clarified the commit message] Signed-off-by: Sami Tolvanen --- include/linux/moduleparam.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'include/linux') diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index 915f32f7d888..c03db3c2fd40 100644 --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h @@ -355,8 +355,8 @@ static inline void kernel_param_unlock(struct module *mod) /** * __core_param_cb - similar like core_param, with a set/get ops instead of type. * @name: the name of the cmdline and sysfs parameter (often the same as var) - * @var: the variable * @ops: the set & get operations for this parameter. + * @arg: the variable * @perm: visibility in sysfs * * Ideally this should be called 'core_param_cb', but the name has been @@ -390,7 +390,7 @@ static inline void kernel_param_unlock(struct module *mod) * @name1: parameter name 1 * @name2: parameter name 2 * - * Returns true if the two parameter names are equal. + * Returns: true if the two parameter names are equal. * Dashes (-) are considered equal to underscores (_). */ extern bool parameq(const char *name1, const char *name2); @@ -402,6 +402,10 @@ extern bool parameq(const char *name1, const char *name2); * @n: the length to compare * * Similar to parameq(), except it compares @n characters. + * + * Returns: true if the first @n characters of the two parameter names + * are equal. + * Dashes (-) are considered equal to underscores (_). */ extern bool parameqn(const char *name1, const char *name2, size_t n); -- cgit v1.2.3