Commit a3b5b88e authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull crypto library fix from Eric Biggers:
 "Fix an uninitialized variable in the s390 optimized SHA-1 and SHA-2.

  Note that my librarification changes also fix this by greatly
  simplifying how the s390 optimized SHA code is integrated. However, we
  need this separate fix for 6.16 and older versions"

* tag 'libcrypto-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux:
  crypto: s390/sha - Fix uninitialized variable in SHA-1 and SHA-2
parents d006330b 68279380
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ static int s390_sha1_init(struct shash_desc *desc)
	sctx->state[4] = SHA1_H4;
	sctx->count = 0;
	sctx->func = CPACF_KIMD_SHA_1;
	sctx->first_message_part = 0;

	return 0;
}
@@ -60,6 +61,7 @@ static int s390_sha1_import(struct shash_desc *desc, const void *in)
	sctx->count = ictx->count;
	memcpy(sctx->state, ictx->state, sizeof(ictx->state));
	sctx->func = CPACF_KIMD_SHA_1;
	sctx->first_message_part = 0;
	return 0;
}

+3 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ static int sha512_init(struct shash_desc *desc)
	ctx->count = 0;
	ctx->sha512.count_hi = 0;
	ctx->func = CPACF_KIMD_SHA_512;
	ctx->first_message_part = 0;

	return 0;
}
@@ -57,6 +58,7 @@ static int sha512_import(struct shash_desc *desc, const void *in)

	memcpy(sctx->state, ictx->state, sizeof(ictx->state));
	sctx->func = CPACF_KIMD_SHA_512;
	sctx->first_message_part = 0;
	return 0;
}

@@ -97,6 +99,7 @@ static int sha384_init(struct shash_desc *desc)
	ctx->count = 0;
	ctx->sha512.count_hi = 0;
	ctx->func = CPACF_KIMD_SHA_512;
	ctx->first_message_part = 0;

	return 0;
}