Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+12 -12
+5 -5
drivers/crypto/chelsio/chcr_algo.c
··· 314 314 if (digest_size == SHA1_DIGEST_SIZE) { 315 315 error = crypto_shash_init(desc) ?: 316 316 crypto_shash_update(desc, iopad, SHA1_BLOCK_SIZE) ?: 317 - crypto_shash_export(desc, (void *)&sha1_st); 317 + crypto_shash_export_core(desc, &sha1_st); 318 318 memcpy(result_hash, sha1_st.state, SHA1_DIGEST_SIZE); 319 319 } else if (digest_size == SHA224_DIGEST_SIZE) { 320 320 error = crypto_shash_init(desc) ?: 321 321 crypto_shash_update(desc, iopad, SHA256_BLOCK_SIZE) ?: 322 - crypto_shash_export(desc, (void *)&sha256_st); 322 + crypto_shash_export_core(desc, &sha256_st); 323 323 memcpy(result_hash, sha256_st.state, SHA256_DIGEST_SIZE); 324 324 325 325 } else if (digest_size == SHA256_DIGEST_SIZE) { 326 326 error = crypto_shash_init(desc) ?: 327 327 crypto_shash_update(desc, iopad, SHA256_BLOCK_SIZE) ?: 328 - crypto_shash_export(desc, (void *)&sha256_st); 328 + crypto_shash_export_core(desc, &sha256_st); 329 329 memcpy(result_hash, sha256_st.state, SHA256_DIGEST_SIZE); 330 330 331 331 } else if (digest_size == SHA384_DIGEST_SIZE) { 332 332 error = crypto_shash_init(desc) ?: 333 333 crypto_shash_update(desc, iopad, SHA512_BLOCK_SIZE) ?: 334 - crypto_shash_export(desc, (void *)&sha512_st); 334 + crypto_shash_export_core(desc, &sha512_st); 335 335 memcpy(result_hash, sha512_st.state, SHA512_DIGEST_SIZE); 336 336 337 337 } else if (digest_size == SHA512_DIGEST_SIZE) { 338 338 error = crypto_shash_init(desc) ?: 339 339 crypto_shash_update(desc, iopad, SHA512_BLOCK_SIZE) ?: 340 - crypto_shash_export(desc, (void *)&sha512_st); 340 + crypto_shash_export_core(desc, &sha512_st); 341 341 memcpy(result_hash, sha512_st.state, SHA512_DIGEST_SIZE); 342 342 } else { 343 343 error = -EINVAL;
+7 -7
drivers/crypto/intel/qat/qat_common/qat_algs.c
··· 5 5 #include <linux/crypto.h> 6 6 #include <crypto/internal/aead.h> 7 7 #include <crypto/internal/cipher.h> 8 + #include <crypto/internal/hash.h> 8 9 #include <crypto/internal/skcipher.h> 9 10 #include <crypto/aes.h> 10 11 #include <crypto/sha1.h> 11 12 #include <crypto/sha2.h> 12 - #include <crypto/hash.h> 13 13 #include <crypto/hmac.h> 14 14 #include <crypto/algapi.h> 15 15 #include <crypto/authenc.h> ··· 154 154 155 155 switch (ctx->qat_hash_alg) { 156 156 case ICP_QAT_HW_AUTH_ALGO_SHA1: 157 - if (crypto_shash_export(shash, &ctx->sha1)) 157 + if (crypto_shash_export_core(shash, &ctx->sha1)) 158 158 return -EFAULT; 159 159 for (i = 0; i < digest_size >> 2; i++, hash_state_out++) 160 160 *hash_state_out = cpu_to_be32(ctx->sha1.state[i]); 161 161 break; 162 162 case ICP_QAT_HW_AUTH_ALGO_SHA256: 163 - if (crypto_shash_export(shash, &ctx->sha256)) 163 + if (crypto_shash_export_core(shash, &ctx->sha256)) 164 164 return -EFAULT; 165 165 for (i = 0; i < digest_size >> 2; i++, hash_state_out++) 166 166 *hash_state_out = cpu_to_be32(ctx->sha256.state[i]); 167 167 break; 168 168 case ICP_QAT_HW_AUTH_ALGO_SHA512: 169 - if (crypto_shash_export(shash, &ctx->sha512)) 169 + if (crypto_shash_export_core(shash, &ctx->sha512)) 170 170 return -EFAULT; 171 171 for (i = 0; i < digest_size >> 3; i++, hash512_state_out++) 172 172 *hash512_state_out = cpu_to_be64(ctx->sha512.state[i]); ··· 190 190 191 191 switch (ctx->qat_hash_alg) { 192 192 case ICP_QAT_HW_AUTH_ALGO_SHA1: 193 - if (crypto_shash_export(shash, &ctx->sha1)) 193 + if (crypto_shash_export_core(shash, &ctx->sha1)) 194 194 return -EFAULT; 195 195 for (i = 0; i < digest_size >> 2; i++, hash_state_out++) 196 196 *hash_state_out = cpu_to_be32(ctx->sha1.state[i]); 197 197 break; 198 198 case ICP_QAT_HW_AUTH_ALGO_SHA256: 199 - if (crypto_shash_export(shash, &ctx->sha256)) 199 + if (crypto_shash_export_core(shash, &ctx->sha256)) 200 200 return -EFAULT; 201 201 for (i = 0; i < digest_size >> 2; i++, hash_state_out++) 202 202 *hash_state_out = cpu_to_be32(ctx->sha256.state[i]); 203 203 break; 204 204 case ICP_QAT_HW_AUTH_ALGO_SHA512: 205 - if (crypto_shash_export(shash, &ctx->sha512)) 205 + if (crypto_shash_export_core(shash, &ctx->sha512)) 206 206 return -EFAULT; 207 207 for (i = 0; i < digest_size >> 3; i++, hash512_state_out++) 208 208 *hash512_state_out = cpu_to_be64(ctx->sha512.state[i]);