Linux cryptographic layer development
 help / color / mirror / Atom feed
* [PATCH v3 0/3] crypto: drbg - revamp locking
@ 2015-04-18 17:35 Stephan Mueller
  2015-04-18 17:35 ` [PATCH v3 1/3] crypto: drbg - fix drbg_generate return val check Stephan Mueller
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Stephan Mueller @ 2015-04-18 17:35 UTC (permalink / raw)
  To: herbert; +Cc: linux-crypto

Hi,

the current implementation of the DRBG generates a shadow copy of its
DRBG state for each incoming request. The idea is that only a short
term lock is needed to spawn the shadow copy. The drawback is that
if multiple parallel requests come in, the generated DRBG shadow
states only differ by a high-resolution timer that was mixed in during
the shadow state generation.

This patch now removes this shadow state and introduces a mutex
to serialize all requests to one DRBG instance.

The patch was fully CAVS tested and demonstrates that the DRBG still
complies with the standard.

Changes v2:
* fix return code check of drbg_generate in drbg_generate_long
* move mutex_init to drbg_kcapi_init to ensure the mutex is initialized
  only during the instantiation of a DRBG and during a reset
* merge the patch for replacing the spinlock with a mutex and the removal
  of the shadow copy generation as both patches cannot stand alone and would
  therefore break bisection
* drop patch that fixes the memory release (Herbert: you mentioned the patch
  is applied but it is not yet in the repo -- this patch is vital as otherwise
  AES192 now breaks without the shadow copy operation)

Changes v3:
* patch for fixing the return code handling in drbg_generate_long did not
  cover all code paths -- now the issue should be truly fixed

Stephan Mueller (3):
  crypto: drbg - fix drbg_generate return val check
  crypto: drbg - replace spinlock with mutex
  crypto: drbg - leave cipher handles operational

 crypto/drbg.c         | 166 +++++++++++---------------------------------------
 include/crypto/drbg.h |   4 +-
 2 files changed, 36 insertions(+), 134 deletions(-)

-- 
2.1.0

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

end of thread, other threads:[~2015-04-20  0:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-18 17:35 [PATCH v3 0/3] crypto: drbg - revamp locking Stephan Mueller
2015-04-18 17:35 ` [PATCH v3 1/3] crypto: drbg - fix drbg_generate return val check Stephan Mueller
2015-04-18 17:36 ` [PATCH v3 2/3] crypto: drbg - replace spinlock with mutex Stephan Mueller
2015-04-18 17:37 ` [PATCH v3 3/3] crypto: drbg - leave cipher handles operational Stephan Mueller
2015-04-19  5:49 ` [PATCH v3 0/3] crypto: drbg - revamp locking Herbert Xu
2015-04-19 15:35   ` Stephan Mueller
2015-04-20  0:23     ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox