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 'v7.0-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6

Pull crypto fixes from Herbert Xu:

- Fix use-after-free in ccp

- Fix bug when SEV is disabled in ccp

- Fix tfm_count leak in atmel-sha204a

* tag 'v7.0-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
crypto: atmel-sha204a - Fix OOM ->tfm_count leak
crypto: ccp - Fix use-after-free on error path
crypto: ccp - allow callers to use HV-Fixed page API when SEV is disabled

+8 -9
+3 -2
drivers/crypto/atmel-sha204a.c
··· 52 52 rng->priv = 0; 53 53 } else { 54 54 work_data = kmalloc_obj(*work_data, GFP_ATOMIC); 55 - if (!work_data) 55 + if (!work_data) { 56 + atomic_dec(&i2c_priv->tfm_count); 56 57 return -ENOMEM; 57 - 58 + } 58 59 work_data->ctx = i2c_priv; 59 60 work_data->client = i2c_priv->client; 60 61
+1 -1
drivers/crypto/ccp/sev-dev-tsm.c
··· 378 378 return; 379 379 380 380 error_exit: 381 - kfree(t); 382 381 pr_err("Failed to enable SEV-TIO: ret=%d en=%d initdone=%d SEV=%d\n", 383 382 ret, t->tio_en, t->tio_init_done, boot_cpu_has(X86_FEATURE_SEV)); 383 + kfree(t); 384 384 } 385 385 386 386 void sev_tsm_uninit(struct sev_device *sev)
+4 -6
drivers/crypto/ccp/sev-dev.c
··· 1105 1105 { 1106 1106 struct psp_device *psp_master = psp_get_master_device(); 1107 1107 struct snp_hv_fixed_pages_entry *entry; 1108 - struct sev_device *sev; 1109 1108 unsigned int order; 1110 1109 struct page *page; 1111 1110 1112 - if (!psp_master || !psp_master->sev_data) 1111 + if (!psp_master) 1113 1112 return NULL; 1114 - 1115 - sev = psp_master->sev_data; 1116 1113 1117 1114 order = get_order(PMD_SIZE * num_2mb_pages); 1118 1115 ··· 1123 1126 * This API uses SNP_INIT_EX to transition allocated pages to HV_Fixed 1124 1127 * page state, fail if SNP is already initialized. 1125 1128 */ 1126 - if (sev->snp_initialized) 1129 + if (psp_master->sev_data && 1130 + ((struct sev_device *)psp_master->sev_data)->snp_initialized) 1127 1131 return NULL; 1128 1132 1129 1133 /* Re-use freed pages that match the request */ ··· 1160 1162 struct psp_device *psp_master = psp_get_master_device(); 1161 1163 struct snp_hv_fixed_pages_entry *entry, *nentry; 1162 1164 1163 - if (!psp_master || !psp_master->sev_data) 1165 + if (!psp_master) 1164 1166 return; 1165 1167 1166 1168 /*