linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Documentation: crypto: add info about "fips=" boot option
@ 2021-03-30  4:00 Randy Dunlap
  2021-03-30  4:37 ` Herbert Xu
  0 siblings, 1 reply; 4+ messages in thread
From: Randy Dunlap @ 2021-03-30  4:00 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, Dexuan Cui, linux-crypto, Eric Biggers, Herbert Xu,
	David S. Miller, Jonathan Corbet, linux-doc

Having just seen a report of using "fips=1" on the kernel command line,
I could not find it documented anywhere, so add some help for it.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Dexuan Cui <decui@microsoft.com>
Cc: linux-crypto@vger.kernel.org
Cc: Eric Biggers <ebiggers@kernel.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: linux-doc@vger.kernel.org
---
Updates/corrections welcome.

 Documentation/admin-guide/kernel-parameters.txt |   15 ++++++++++++++
 1 file changed, 15 insertions(+)

--- linux-next-20210329.orig/Documentation/admin-guide/kernel-parameters.txt
+++ linux-next-20210329/Documentation/admin-guide/kernel-parameters.txt
@@ -1370,6 +1370,21 @@
 			See Documentation/admin-guide/sysctl/net.rst for
 			fb_tunnels_only_for_init_ns
 
+	fips=		Format: { 0 | 1}
+			Use to disable (0) or enable (1) FIPS mode.
+			If enabled, any process that is waiting on the
+			'fips_fail_notif_chain' will be notified of fips
+			failures.
+			This setting can also be modified via sysctl at
+			/proc/sysctl/crypto/fips_enabled, i.e.,
+			crypto.fips_enabled.
+			If fips_enabled = 1, some crypto tests are skipped.
+			It can also effect which ECC curve is used.
+			If fips_enabled = 1 and a test fails, it will cause a
+			kernel panic.
+			If fips_enabled = 1, RSA test requires a key size of
+			2K or larger.
+
 	floppy=		[HW]
 			See Documentation/admin-guide/blockdev/floppy.rst.
 

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

* Re: [PATCH] Documentation: crypto: add info about "fips=" boot option
  2021-03-30  4:00 [PATCH] Documentation: crypto: add info about "fips=" boot option Randy Dunlap
@ 2021-03-30  4:37 ` Herbert Xu
  2021-03-30  5:00   ` Randy Dunlap
  0 siblings, 1 reply; 4+ messages in thread
From: Herbert Xu @ 2021-03-30  4:37 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: linux-kernel, Dexuan Cui, linux-crypto, Eric Biggers,
	David S. Miller, Jonathan Corbet, linux-doc

On Mon, Mar 29, 2021 at 09:00:01PM -0700, Randy Dunlap wrote:
>
> +			If fips_enabled = 1, some crypto tests are skipped.

I don't think any tests are skipped.  It does however disable
many algorithms by essentially failing them at the testing stage.

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

* Re: [PATCH] Documentation: crypto: add info about "fips=" boot option
  2021-03-30  4:37 ` Herbert Xu
@ 2021-03-30  5:00   ` Randy Dunlap
  2021-03-30  5:02     ` Herbert Xu
  0 siblings, 1 reply; 4+ messages in thread
From: Randy Dunlap @ 2021-03-30  5:00 UTC (permalink / raw)
  To: Herbert Xu
  Cc: linux-kernel, Dexuan Cui, linux-crypto, Eric Biggers,
	David S. Miller, Jonathan Corbet, linux-doc

On 3/29/21 9:37 PM, Herbert Xu wrote:
> On Mon, Mar 29, 2021 at 09:00:01PM -0700, Randy Dunlap wrote:
>>
>> +			If fips_enabled = 1, some crypto tests are skipped.
> 
> I don't think any tests are skipped.  It does however disable
> many algorithms by essentially failing them at the testing stage.

That statement was based on crypto/testmgr.c (in 4 places):

		if (fips_enabled && template[i].fips_skip)
			continue;

and

	if (fips_enabled && vec->fips_skip)
		return 0;

and

		if (fips_enabled && !alg_test_descs[i].fips_allowed)
			goto non_fips_alg;

and

	if (fips_enabled && ((i >= 0 && !alg_test_descs[i].fips_allowed) ||
			     (j >= 0 && !alg_test_descs[j].fips_allowed)))
		goto non_fips_alg;


so it appears (at least to me) that there are some methods (infrastructure)
for tests to be skipped, but maybe none are actually using that possiblilty.

In any case, I don't mind dropping that part of the documentation.

thanks.
-- 
~Randy


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

* Re: [PATCH] Documentation: crypto: add info about "fips=" boot option
  2021-03-30  5:00   ` Randy Dunlap
@ 2021-03-30  5:02     ` Herbert Xu
  0 siblings, 0 replies; 4+ messages in thread
From: Herbert Xu @ 2021-03-30  5:02 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: linux-kernel, Dexuan Cui, linux-crypto, Eric Biggers,
	David S. Miller, Jonathan Corbet, linux-doc

On Mon, Mar 29, 2021 at 10:00:45PM -0700, Randy Dunlap wrote:
> On 3/29/21 9:37 PM, Herbert Xu wrote:
> > On Mon, Mar 29, 2021 at 09:00:01PM -0700, Randy Dunlap wrote:
> >>
> >> +			If fips_enabled = 1, some crypto tests are skipped.
> > 
> > I don't think any tests are skipped.  It does however disable
> > many algorithms by essentially failing them at the testing stage.
> 
> That statement was based on crypto/testmgr.c (in 4 places):
> 
> 		if (fips_enabled && template[i].fips_skip)
> 			continue;

By skipping the test, the algorithm effectively fails the self-test
and therefore is disabled.

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

end of thread, other threads:[~2021-03-30  5:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-30  4:00 [PATCH] Documentation: crypto: add info about "fips=" boot option Randy Dunlap
2021-03-30  4:37 ` Herbert Xu
2021-03-30  5:00   ` Randy Dunlap
2021-03-30  5:02     ` Herbert Xu

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).