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>] [day] [month] [year] [list]
Message-Id: <20251208095010.2712698-1-pengcan@kylinos.cn>
Date: Mon,  8 Dec 2025 17:50:10 +0800
From: Can Peng <pengcan@...inos.cn>
To: herbert@...dor.apana.org.au,
	davem@...emloft.net
Cc: linux-crypto@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Can Peng <pengcan@...inos.cn>
Subject: [PATCH 1/1] crypto: fips: annotate fips_enable() with __init to free init memory after boot

The fips_enable() function is only invoked early during kernel boot via the
__setup() macro ("fips=" command line parameter), and is never used again
after initialization completes.

Annotating it with __init places the function in the .init.text section,
allowing the kernel to free its memory after init (when freeing_initmem()
runs), reducing runtime memory footprint.

This is a standard practice for setup/early-parse functions and has no
functional impact — the parsing logic, return values, and fips mode
setting behavior remain unchanged.

Signed-off-by: Can Peng <pengcan@...inos.cn>
---
 crypto/fips.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crypto/fips.c b/crypto/fips.c
index 65d2bc070a26..c59711248d95 100644
--- a/crypto/fips.c
+++ b/crypto/fips.c
@@ -22,7 +22,7 @@ ATOMIC_NOTIFIER_HEAD(fips_fail_notif_chain);
 EXPORT_SYMBOL_GPL(fips_fail_notif_chain);
 
 /* Process kernel command-line parameter at boot time. fips=0 or fips=1 */
-static int fips_enable(char *str)
+static int __init fips_enable(char *str)
 {
 	if (kstrtoint(str, 0, &fips_enabled))
 		return 0;
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ