Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fixes from Herbert Xu: - Fix missed wake-up race in padata - Use crypto_memneq in ccp - Fix version check in ccp - Fix fuzz test failure in ccp - Fix potential double free in crypto4xx - Fix compile warning in stm32 * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: padata: use smp_mb in padata_reorder to avoid orphaned padata jobs crypto: ccp - Fix SEV_VERSION_GREATER_OR_EQUAL crypto: ccp/gcm - use const time tag comparison. crypto: ccp - memset structure fields to zero before reuse crypto: crypto4xx - fix a potential double free in ppc4xx_trng_probe crypto: stm32/hash - Fix incorrect printk modifier for size_t
This commit is contained in:
@@ -622,6 +622,7 @@ static int ccp_run_aes_gcm_cmd(struct ccp_cmd_queue *cmd_q,
|
||||
|
||||
unsigned long long *final;
|
||||
unsigned int dm_offset;
|
||||
unsigned int jobid;
|
||||
unsigned int ilen;
|
||||
bool in_place = true; /* Default value */
|
||||
int ret;
|
||||
@@ -660,9 +661,11 @@ static int ccp_run_aes_gcm_cmd(struct ccp_cmd_queue *cmd_q,
|
||||
p_tag = scatterwalk_ffwd(sg_tag, p_inp, ilen);
|
||||
}
|
||||
|
||||
jobid = CCP_NEW_JOBID(cmd_q->ccp);
|
||||
|
||||
memset(&op, 0, sizeof(op));
|
||||
op.cmd_q = cmd_q;
|
||||
op.jobid = CCP_NEW_JOBID(cmd_q->ccp);
|
||||
op.jobid = jobid;
|
||||
op.sb_key = cmd_q->sb_key; /* Pre-allocated */
|
||||
op.sb_ctx = cmd_q->sb_ctx; /* Pre-allocated */
|
||||
op.init = 1;
|
||||
@@ -813,6 +816,13 @@ static int ccp_run_aes_gcm_cmd(struct ccp_cmd_queue *cmd_q,
|
||||
final[0] = cpu_to_be64(aes->aad_len * 8);
|
||||
final[1] = cpu_to_be64(ilen * 8);
|
||||
|
||||
memset(&op, 0, sizeof(op));
|
||||
op.cmd_q = cmd_q;
|
||||
op.jobid = jobid;
|
||||
op.sb_key = cmd_q->sb_key; /* Pre-allocated */
|
||||
op.sb_ctx = cmd_q->sb_ctx; /* Pre-allocated */
|
||||
op.init = 1;
|
||||
op.u.aes.type = aes->type;
|
||||
op.u.aes.mode = CCP_AES_MODE_GHASH;
|
||||
op.u.aes.action = CCP_AES_GHASHFINAL;
|
||||
op.src.type = CCP_MEMTYPE_SYSTEM;
|
||||
@@ -840,7 +850,8 @@ static int ccp_run_aes_gcm_cmd(struct ccp_cmd_queue *cmd_q,
|
||||
if (ret)
|
||||
goto e_tag;
|
||||
|
||||
ret = memcmp(tag.address, final_wa.address, AES_BLOCK_SIZE);
|
||||
ret = crypto_memneq(tag.address, final_wa.address,
|
||||
AES_BLOCK_SIZE) ? -EBADMSG : 0;
|
||||
ccp_dm_free(&tag);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user