mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephan Mueller <sm@eperm.de>
To: "Richard W.M. Jones" <rjones@redhat.com>
Cc: linux-kernel@vger.kernel.org, corbet@lwn.net,
	herbert@gondor.apana.org.au, davem@davemloft.net,
	linux-doc@vger.kernel.org, linux-crypto@vger.kernel.org
Subject: Re: [PATCH] crypto: Add a flag allowing the self-tests to be disabled at runtime.
Date: Fri, 29 Apr 2016 12:59:57 +0200	[thread overview]
Message-ID: <1716181.h8M5zx62aT@tauon.atsec.com> (raw)
In-Reply-To: <1461924463-1678-2-git-send-email-rjones@redhat.com>

Am Freitag, 29. April 2016, 11:07:43 schrieb Richard W.M. Jones:

Hi Richard,

> Running self-tests for a short-lived KVM VM takes 28ms on my laptop.
> This commit adds a flag 'cryptomgr.notests' which allows them to be
> disabled.
> 
> Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
> ---
>  Documentation/kernel-parameters.txt | 3 +++
>  crypto/testmgr.c                    | 9 +++++++++
>  2 files changed, 12 insertions(+)
> 
> diff --git a/Documentation/kernel-parameters.txt
> b/Documentation/kernel-parameters.txt index 0b3de80..d4d5fb7 100644
> --- a/Documentation/kernel-parameters.txt
> +++ b/Documentation/kernel-parameters.txt
> @@ -826,6 +826,9 @@ bytes respectively. Such letter suffixes can also be
> entirely omitted. It will be ignored when crashkernel=X,high is not used
>  			or memory reserved is below 4G.
> 
> +	cryptomgr.notests
> +                        [KNL] Disable crypto self-tests
> +
>  	cs89x0_dma=	[HW,NET]
>  			Format: <dma>
> 
> diff --git a/crypto/testmgr.c b/crypto/testmgr.c
> index b86883a..dc613f2 100644
> --- a/crypto/testmgr.c
> +++ b/crypto/testmgr.c
> @@ -35,6 +35,10 @@
> 
>  #include "internal.h"
> 
> +static bool notests;
> +module_param(notests, bool, 0644);
> +MODULE_PARM_DESC(notests, "disable crypto self-tests");
> +
>  #ifdef CONFIG_CRYPTO_MANAGER_DISABLE_TESTS
> 
>  /* a perfect nop */
> @@ -3868,6 +3872,11 @@ int alg_test(const char *driver, const char *alg, u32
> type, u32 mask) int j;
>  	int rc;
> 
> +	if (notests) {

What about if (!fips_enabled && notests) ?

I am not sure whether the kernel should prevent mistakes in user space. A 
mistake would be when setting fips=1 and notests=1 as the FIPS mode mandates 
the self tests.

> +		pr_info("alg: self-tests disabled\n");
> +		return 0;
> +	}
> +
>  	alg_test_descs_check_order();
> 
>  	if ((type & CRYPTO_ALG_TYPE_MASK) == CRYPTO_ALG_TYPE_CIPHER) {


Ciao
Stephan
-- 
| Nimm das Recht weg -                                             |
|  was ist dann der Staat noch anderes als eine große Räuberbande? |

  reply	other threads:[~2016-04-29 11:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-29 10:07 Richard W.M. Jones
2016-04-29 10:07 ` Richard W.M. Jones
2016-04-29 10:59   ` Stephan Mueller [this message]
2016-04-29 11:04     ` Richard W.M. Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1716181.h8M5zx62aT@tauon.atsec.com \
    --to=sm@eperm.de \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjones@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®