linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/5] crypto: dh - input validation fixes
@ 2017-11-06  2:30 Eric Biggers
  2017-11-06  2:30 ` [PATCH v2 1/5] crypto: dh - Fix double free of ctx->p Eric Biggers
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Eric Biggers @ 2017-11-06  2:30 UTC (permalink / raw)
  To: linux-crypto, Herbert Xu
  Cc: Giovanni Cabiddu, Salvatore Benedetto, Tudor-Dan Ambarus,
	Mat Martineau, Stephan Mueller, qat-linux, keyrings, Eric Biggers

This series fixes several corner cases in the Diffie-Hellman key
exchange implementations:

1. With the software DH implementation, using a large buffer for 'g'
   caused a double free.
2. With CONFIG_DEBUG_SG=y and the software DH implementation, setting 'p'
   to 0 caused a BUG_ON().
3. With the QAT DH implementation, setting 'key' or 'g' larger than 'p'
   caused a buffer underflow.

Note that in kernels configured with CONFIG_KEY_DH_OPERATIONS=y, these
bugs are reachable by unprivileged users via KEYCTL_DH_COMPUTE.

Patches 4 and 5 are cleanup only.

Eric Biggers (5):
  crypto: dh - Fix double free of ctx->p
  crypto: dh - Don't permit 'p' to be 0
  crypto: dh - Don't permit 'key' or 'g' size longer than 'p'
  crypto: qat - Clean up error handling in qat_dh_set_secret()
  crypto: dh - Remove pointless checks for NULL 'p' and 'g'

 crypto/dh.c                                   | 36 ++++++++++-----------------
 crypto/dh_helper.c                            | 16 ++++++++++++
 drivers/crypto/qat/qat_common/qat_asym_algs.c | 18 ++++++--------
 3 files changed, 37 insertions(+), 33 deletions(-)

-- 
2.15.0

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

end of thread, other threads:[~2017-11-10 11:38 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-06  2:30 [PATCH v2 0/5] crypto: dh - input validation fixes Eric Biggers
2017-11-06  2:30 ` [PATCH v2 1/5] crypto: dh - Fix double free of ctx->p Eric Biggers
2017-11-06  8:55   ` Tudor Ambarus
2017-11-06  2:30 ` [PATCH v2 2/5] crypto: dh - Don't permit 'p' to be 0 Eric Biggers
2017-11-06  2:30 ` [PATCH v2 3/5] crypto: dh - Don't permit 'key' or 'g' size longer than 'p' Eric Biggers
2017-11-06 10:29   ` Tudor Ambarus
2017-11-06  2:30 ` [PATCH v2 4/5] crypto: qat - Clean up error handling in qat_dh_set_secret() Eric Biggers
2017-11-06  2:30 ` [PATCH v2 5/5] crypto: dh - Remove pointless checks for NULL 'p' and 'g' Eric Biggers
2017-11-06 10:29   ` Tudor Ambarus
2017-11-10 11:36 ` [PATCH v2 0/5] crypto: dh - input validation fixes 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).