Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d0aab7d4 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull crypto fixes from Herbert Xu:
 "This fixes a couple of places in the crypto code that were doing
  interruptible sleeps dangerously. They have been converted to use
  non-interruptible sleeps.

  This also fixes a bug in asymmetric_keys where it would trigger a
  use-after-free if a request returned EBUSY due to a full device queue"

* 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: gcm - wait for crypto op not signal safe
  crypto: drbg - wait for crypto op not signal safe
  crypto: asymmetric_keys - handle EBUSY due to backlog correctly
parents b29794ec f3ad5870
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -141,7 +141,7 @@ int public_key_verify_signature(const struct public_key *pkey,
	 * signature and returns that to us.
	 */
	ret = crypto_akcipher_verify(req);
	if (ret == -EINPROGRESS) {
	if ((ret == -EINPROGRESS) || (ret == -EBUSY)) {
		wait_for_completion(&compl.completion);
		ret = compl.err;
	}
+2 −3
Original line number Diff line number Diff line
@@ -1767,9 +1767,8 @@ static int drbg_kcapi_sym_ctr(struct drbg_state *drbg,
			break;
		case -EINPROGRESS:
		case -EBUSY:
			ret = wait_for_completion_interruptible(
				&drbg->ctr_completion);
			if (!ret && !drbg->ctr_async_err) {
			wait_for_completion(&drbg->ctr_completion);
			if (!drbg->ctr_async_err) {
				reinit_completion(&drbg->ctr_completion);
				break;
			}
+2 −4
Original line number Diff line number Diff line
@@ -152,9 +152,7 @@ static int crypto_gcm_setkey(struct crypto_aead *aead, const u8 *key,

	err = crypto_skcipher_encrypt(&data->req);
	if (err == -EINPROGRESS || err == -EBUSY) {
		err = wait_for_completion_interruptible(
			&data->result.completion);
		if (!err)
		wait_for_completion(&data->result.completion);
		err = data->result.err;
	}