lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250211214842.1806521-4-shyamsaini@linux.microsoft.com>
Date: Tue, 11 Feb 2025 13:48:41 -0800
From: Shyam Saini <shyamsaini@...ux.microsoft.com>
To: linux-kernel@...r.kernel.org,
	linux-modules@...r.kernel.org
Cc: code@...icks.com,
	linux@...musvillemoes.dk,
	christophe.leroy@...roup.eu,
	hch@...radead.org,
	mcgrof@...nel.org,
	frkaya@...ux.microsoft.com,
	vijayb@...ux.microsoft.com,
	petr.pavlu@...e.com,
	linux@...ssschuh.net,
	samitolvanen@...gle.com,
	da.gomez@...sung.com,
	gregkh@...uxfoundation.org,
	rafael@...nel.org,
	dakr@...nel.org
Subject: [PATCH v3 3/4] kernel: globalize lookup_or_create_module_kobject()

lookup_or_create_module_kobject() is marked as static and __init,
to make it global drop static keyword.
Since this function can be called from non-init code, use __modinit
instead of __init, __modinit marker will make it __init if
CONFIG_MODULES is not defined.

Suggested-by: Rasmus Villemoes <linux@...musvillemoes.dk>
Signed-off-by: Shyam Saini <shyamsaini@...ux.microsoft.com>
---
 include/linux/module.h | 2 ++
 kernel/params.c        | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/linux/module.h b/include/linux/module.h
index 12f8a7d4fc1c..aeaaf9e068eb 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -162,6 +162,8 @@ extern void cleanup_module(void);
 #define __INITRODATA_OR_MODULE __INITRODATA
 #endif /*CONFIG_MODULES*/
 
+struct module_kobject *lookup_or_create_module_kobject(const char *name);
+
 /* Generic info of form tag = "info" */
 #define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info)
 
diff --git a/kernel/params.c b/kernel/params.c
index 6e87aef876b2..1073f8ebd5a6 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -763,7 +763,7 @@ void destroy_params(const struct kernel_param *params, unsigned num)
 			params[i].ops->free(params[i].arg);
 }
 
-static struct module_kobject * __init lookup_or_create_module_kobject(const char *name)
+struct module_kobject __modinit * lookup_or_create_module_kobject(const char *name)
 {
 	struct module_kobject *mk;
 	struct kobject *kobj;
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ