]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
crypto: fips - replace simple_strtol with kstrtoint to improve fips_enable
authorThorsten Blum <thorsten.blum@linux.dev>
Mon, 15 Sep 2025 22:12:45 +0000 (00:12 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 17 Oct 2025 08:03:57 +0000 (16:03 +0800)
commit33eea63ff9c6abf26236dcad41165d3cc499d905
tree8dfa6aa564386d082e3243bc52e59b20ff46de21
parent1a098379f28b05996603888ff7dd508e5773d5d9
crypto: fips - replace simple_strtol with kstrtoint to improve fips_enable

Replace simple_strtol() with the recommended kstrtoint() for parsing the
'fips=' boot parameter. Unlike simple_strtol(), which returns a long,
kstrtoint() converts the string directly to an integer and avoids
implicit casting.

Check the return value of kstrtoint() and reject invalid values. This
adds error handling while preserving existing behavior for valid values,
and removes use of the deprecated simple_strtol() helper.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/fips.c