mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Nicolai Stange <nstange@suse.de>
Cc: "Stephan Müller" <smueller@chronox.de>,
	"David S. Miller" <davem@davemloft.net>,
	"Torsten Duwe" <duwe@suse.de>,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 0/6] crypto: DRBG - improve 'nopr' reseeding
Date: Fri, 26 Nov 2021 13:31:05 +0800	[thread overview]
Message-ID: <20211126053105.GA17477@gondor.apana.org.au> (raw)
In-Reply-To: <20211115141809.11420-1-nstange@suse.de>

On Mon, Nov 15, 2021 at 03:18:03PM +0100, Nicolai Stange wrote:
> Hi all,
> 
> v1 can be found here:
> 
>   https://lore.kernel.org/r/20211025092525.12805-1-nstange@suse.de
> 
> The changes between v1 and v2 are summarized below.
> 
> 
> Cover letter reproduced 1:1 from v1:
> 
> This patchset aims at (hopefully) improving the DRBG code related to
> reseeding from get_random_bytes() a bit:
> - Replace the asynchronous random_ready_callback based DRBG reseeding
>   logic with a synchronous solution leveraging rng_is_initialized(). This
>   move simplifies the code IMO and, as a side-effect, would enable DRBG
>   users to rely on wait_for_random_bytes() to sync properly with
>   drbg_generate(), if desired. Implemented by patches 1-5/6.
> - Make the 'nopr' DRBGs to reseed themselves every 5min from
>   get_random_bytes(). This achieves at least kind of a partial prediction
>   resistance over the time domain at almost no extra cost. Implemented
>   by patch 6/6, the preceding patches in this series are a prerequisite
>   for this.
> 
> Tested with and without fips_enabled in a x86_64 VM, both with
> random.trust_cpu=on and off. As confirmed with a couple of debugging
> printks() (added for testing only, not included in this series), DRBGs
> have been instantiated with and without rng_is_initialized() evaluating
> to true each during my tests and the patched DRBG reseeding code worked as
> intended in either case.
> 
> Applies to current herbert/cryptodev-2.6.git master.
> 
> 
> Changes between v1 and v2:
> - 4/6: remove redundant goto statement, spotted by Stephan.
> 
> For the unmodified rest, I added Stephan's Reviewed-bys he granted in
> reply to v1.
> 
> Many thanks for your comments and remarks!
> 
> Nicolai
> 
> Nicolai Stange (6):
>   crypto: DRBG - prepare for more fine-grained tracking of seeding state
>   crypto: DRBG - track whether DRBG was seeded with
>     !rng_is_initialized()
>   crypto: DRBG - move dynamic ->reseed_threshold adjustments to
>     __drbg_seed()
>   crypto: DRBG - make reseeding from get_random_bytes() synchronous
>   crypto: DRBG - make drbg_prepare_hrng() handle jent instantiation
>     errors
>   crypto: DRBG - reseed 'nopr' drbgs periodically from
>     get_random_bytes()
> 
>  crypto/drbg.c         | 143 +++++++++++++++++++++---------------------
>  include/crypto/drbg.h |  11 +++-
>  2 files changed, 80 insertions(+), 74 deletions(-)

All applied.  Thanks.
-- 
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

      parent reply	other threads:[~2021-11-26  5:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-15 14:18 Nicolai Stange
2021-11-15 14:18 ` [PATCH v2 1/6] crypto: DRBG - prepare for more fine-grained tracking of seeding state Nicolai Stange
2021-11-15 14:18 ` [PATCH v2 2/6] crypto: DRBG - track whether DRBG was seeded with !rng_is_initialized() Nicolai Stange
2021-11-15 14:18 ` [PATCH v2 3/6] crypto: DRBG - move dynamic ->reseed_threshold adjustments to __drbg_seed() Nicolai Stange
2021-11-15 14:18 ` [PATCH v2 4/6] crypto: DRBG - make reseeding from get_random_bytes() synchronous Nicolai Stange
2021-11-15 14:18 ` [PATCH v2 5/6] crypto: DRBG - make drbg_prepare_hrng() handle jent instantiation errors Nicolai Stange
2021-11-15 14:18 ` [PATCH v2 6/6] crypto: DRBG - reseed 'nopr' drbgs periodically from get_random_bytes() Nicolai Stange
2021-11-26  5:31 ` Herbert Xu [this message]

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=20211126053105.GA17477@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=davem@davemloft.net \
    --cc=duwe@suse.de \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nstange@suse.de \
    --cc=smueller@chronox.de \
    /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®