mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-10-22 23:13:01 +02:00
This push fixes a buffer overflows in qat and chelsio.
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEn51F/lCuNhUwmDeSxycdCkmxi6cFAmh66A8ACgkQxycdCkmx i6f3KA//ZyVL8dK8Az77b7OFXj29nXAAiIdcqoTMQ/YP2b2j3FTk4wEg/nPp4RZ7 RHfYY8uw8uTPHJ8tQfmDu/eBWlnpRkaahdbkF7s6rPNotnPMdEeJPy+YAD7lkM4j pjK7HVgB0/niwd91bgB8D0YSVYRCgB9ccCVoDvq4OdGV+mA5F9nWVFvBlC64ffNS Q/Y19+X75ednkQhWb8QJ4Um+Q4EaxZk7bzL+bJ7wEJP6RlkvBuu45PHW7rqhgHdX X8xz6i3QfhKNWuE7vgt2ssms/WkOjR6RsmVIWdxbLrXrz594BojyDELEkS+tVsIh T650waL1jdFnRykWo8rKd5RMuJdMcjUpDLvULjtco2DV3JrelDKAHQabX4iLFdg5 xy4edMc0Diku1FC36d0fFLfyAMi8eXk/NABM3ST5aYW2jHZuKBDgdifivE73ecR4 rM6pGCiozkZe7dKllNdDU+lY7N1maeewhYEVhWn6oN+x9in1C8zGYMMOhdDjFe52 BeZ1EOj2ycDgItSN7GFufwAFKV6WSYQl25qX9fGz1rJ6wQmuA1hSdeH9fXiaSUAb NlB+pZ8pHqWs5qL79YNd0qrtjjKvo59FRT+JmjA7tDx+pyhUEPiJzsahQqwY2arH GH3MbDB62PN6x9036wG+XRBl155SCcmQzUZoOQ51y9VBr042cOw= =z7vq -----END PGP SIGNATURE----- Merge tag 'v6.16-p7' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 Pull crypto fixes from Herbert Xu: "This fixes buffer overflows in qat and chelsio" * tag 'v6.16-p7' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: qat - Use crypto_shash_export_core crypto: chelsio - Use crypto_shash_export_core
This commit is contained in:
commit
27c2570359
|
@ -314,30 +314,30 @@ static int chcr_compute_partial_hash(struct shash_desc *desc,
|
|||
if (digest_size == SHA1_DIGEST_SIZE) {
|
||||
error = crypto_shash_init(desc) ?:
|
||||
crypto_shash_update(desc, iopad, SHA1_BLOCK_SIZE) ?:
|
||||
crypto_shash_export(desc, (void *)&sha1_st);
|
||||
crypto_shash_export_core(desc, &sha1_st);
|
||||
memcpy(result_hash, sha1_st.state, SHA1_DIGEST_SIZE);
|
||||
} else if (digest_size == SHA224_DIGEST_SIZE) {
|
||||
error = crypto_shash_init(desc) ?:
|
||||
crypto_shash_update(desc, iopad, SHA256_BLOCK_SIZE) ?:
|
||||
crypto_shash_export(desc, (void *)&sha256_st);
|
||||
crypto_shash_export_core(desc, &sha256_st);
|
||||
memcpy(result_hash, sha256_st.state, SHA256_DIGEST_SIZE);
|
||||
|
||||
} else if (digest_size == SHA256_DIGEST_SIZE) {
|
||||
error = crypto_shash_init(desc) ?:
|
||||
crypto_shash_update(desc, iopad, SHA256_BLOCK_SIZE) ?:
|
||||
crypto_shash_export(desc, (void *)&sha256_st);
|
||||
crypto_shash_export_core(desc, &sha256_st);
|
||||
memcpy(result_hash, sha256_st.state, SHA256_DIGEST_SIZE);
|
||||
|
||||
} else if (digest_size == SHA384_DIGEST_SIZE) {
|
||||
error = crypto_shash_init(desc) ?:
|
||||
crypto_shash_update(desc, iopad, SHA512_BLOCK_SIZE) ?:
|
||||
crypto_shash_export(desc, (void *)&sha512_st);
|
||||
crypto_shash_export_core(desc, &sha512_st);
|
||||
memcpy(result_hash, sha512_st.state, SHA512_DIGEST_SIZE);
|
||||
|
||||
} else if (digest_size == SHA512_DIGEST_SIZE) {
|
||||
error = crypto_shash_init(desc) ?:
|
||||
crypto_shash_update(desc, iopad, SHA512_BLOCK_SIZE) ?:
|
||||
crypto_shash_export(desc, (void *)&sha512_st);
|
||||
crypto_shash_export_core(desc, &sha512_st);
|
||||
memcpy(result_hash, sha512_st.state, SHA512_DIGEST_SIZE);
|
||||
} else {
|
||||
error = -EINVAL;
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
#include <linux/crypto.h>
|
||||
#include <crypto/internal/aead.h>
|
||||
#include <crypto/internal/cipher.h>
|
||||
#include <crypto/internal/hash.h>
|
||||
#include <crypto/internal/skcipher.h>
|
||||
#include <crypto/aes.h>
|
||||
#include <crypto/sha1.h>
|
||||
#include <crypto/sha2.h>
|
||||
#include <crypto/hash.h>
|
||||
#include <crypto/hmac.h>
|
||||
#include <crypto/algapi.h>
|
||||
#include <crypto/authenc.h>
|
||||
|
@ -154,19 +154,19 @@ static int qat_alg_do_precomputes(struct icp_qat_hw_auth_algo_blk *hash,
|
|||
|
||||
switch (ctx->qat_hash_alg) {
|
||||
case ICP_QAT_HW_AUTH_ALGO_SHA1:
|
||||
if (crypto_shash_export(shash, &ctx->sha1))
|
||||
if (crypto_shash_export_core(shash, &ctx->sha1))
|
||||
return -EFAULT;
|
||||
for (i = 0; i < digest_size >> 2; i++, hash_state_out++)
|
||||
*hash_state_out = cpu_to_be32(ctx->sha1.state[i]);
|
||||
break;
|
||||
case ICP_QAT_HW_AUTH_ALGO_SHA256:
|
||||
if (crypto_shash_export(shash, &ctx->sha256))
|
||||
if (crypto_shash_export_core(shash, &ctx->sha256))
|
||||
return -EFAULT;
|
||||
for (i = 0; i < digest_size >> 2; i++, hash_state_out++)
|
||||
*hash_state_out = cpu_to_be32(ctx->sha256.state[i]);
|
||||
break;
|
||||
case ICP_QAT_HW_AUTH_ALGO_SHA512:
|
||||
if (crypto_shash_export(shash, &ctx->sha512))
|
||||
if (crypto_shash_export_core(shash, &ctx->sha512))
|
||||
return -EFAULT;
|
||||
for (i = 0; i < digest_size >> 3; i++, hash512_state_out++)
|
||||
*hash512_state_out = cpu_to_be64(ctx->sha512.state[i]);
|
||||
|
@ -190,19 +190,19 @@ static int qat_alg_do_precomputes(struct icp_qat_hw_auth_algo_blk *hash,
|
|||
|
||||
switch (ctx->qat_hash_alg) {
|
||||
case ICP_QAT_HW_AUTH_ALGO_SHA1:
|
||||
if (crypto_shash_export(shash, &ctx->sha1))
|
||||
if (crypto_shash_export_core(shash, &ctx->sha1))
|
||||
return -EFAULT;
|
||||
for (i = 0; i < digest_size >> 2; i++, hash_state_out++)
|
||||
*hash_state_out = cpu_to_be32(ctx->sha1.state[i]);
|
||||
break;
|
||||
case ICP_QAT_HW_AUTH_ALGO_SHA256:
|
||||
if (crypto_shash_export(shash, &ctx->sha256))
|
||||
if (crypto_shash_export_core(shash, &ctx->sha256))
|
||||
return -EFAULT;
|
||||
for (i = 0; i < digest_size >> 2; i++, hash_state_out++)
|
||||
*hash_state_out = cpu_to_be32(ctx->sha256.state[i]);
|
||||
break;
|
||||
case ICP_QAT_HW_AUTH_ALGO_SHA512:
|
||||
if (crypto_shash_export(shash, &ctx->sha512))
|
||||
if (crypto_shash_export_core(shash, &ctx->sha512))
|
||||
return -EFAULT;
|
||||
for (i = 0; i < digest_size >> 3; i++, hash512_state_out++)
|
||||
*hash512_state_out = cpu_to_be64(ctx->sha512.state[i]);
|
||||
|
|
Loading…
Reference in New Issue
Block a user