Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto updates from Herbert Xu: "API: - Introduce crypto_shash_tfm_digest() and use it wherever possible. - Fix use-after-free and race in crypto_spawn_alg. - Add support for parallel and batch requests to crypto_engine. Algorithms: - Update jitter RNG for SP800-90B compliance. - Always use jitter RNG as seed in drbg. Drivers: - Add Arm CryptoCell driver cctrng. - Add support for SEV-ES to the PSP driver in ccp" * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (114 commits) crypto: hisilicon - fix driver compatibility issue with different versions of devices crypto: engine - do not requeue in case of fatal error crypto: cavium/nitrox - Fix a typo in a comment crypto: hisilicon/qm - change debugfs file name from qm_regs to regs crypto: hisilicon/qm - add DebugFS for xQC and xQE dump crypto: hisilicon/zip - add debugfs for Hisilicon ZIP crypto: hisilicon/hpre - add debugfs for Hisilicon HPRE crypto: hisilicon/sec2 - add debugfs for Hisilicon SEC crypto: hisilicon/qm - add debugfs to the QM state machine crypto: hisilicon/qm - add debugfs for QM crypto: stm32/crc32 - protect from concurrent accesses crypto: stm32/crc32 - don't sleep in runtime pm crypto: stm32/crc32 - fix multi-instance crypto: stm32/crc32 - fix run-time self test issue. crypto: stm32/crc32 - fix ext4 chksum BUG_ON() crypto: hisilicon/zip - Use temporary sqe when doing work crypto: hisilicon - add device error report through abnormal irq crypto: hisilicon - remove codes of directly report device errors through MSI crypto: hisilicon - QM memory management optimization crypto: hisilicon - unify initial value assignment into QM ...
This commit is contained in:
@@ -262,10 +262,10 @@ void __bpf_prog_free(struct bpf_prog *fp)
|
||||
|
||||
int bpf_prog_calc_tag(struct bpf_prog *fp)
|
||||
{
|
||||
const u32 bits_offset = SHA_MESSAGE_BYTES - sizeof(__be64);
|
||||
const u32 bits_offset = SHA1_BLOCK_SIZE - sizeof(__be64);
|
||||
u32 raw_size = bpf_prog_tag_scratch_size(fp);
|
||||
u32 digest[SHA_DIGEST_WORDS];
|
||||
u32 ws[SHA_WORKSPACE_WORDS];
|
||||
u32 digest[SHA1_DIGEST_WORDS];
|
||||
u32 ws[SHA1_WORKSPACE_WORDS];
|
||||
u32 i, bsize, psize, blocks;
|
||||
struct bpf_insn *dst;
|
||||
bool was_ld_map;
|
||||
@@ -277,7 +277,7 @@ int bpf_prog_calc_tag(struct bpf_prog *fp)
|
||||
if (!raw)
|
||||
return -ENOMEM;
|
||||
|
||||
sha_init(digest);
|
||||
sha1_init(digest);
|
||||
memset(ws, 0, sizeof(ws));
|
||||
|
||||
/* We need to take out the map fd for the digest calculation
|
||||
@@ -308,8 +308,8 @@ int bpf_prog_calc_tag(struct bpf_prog *fp)
|
||||
memset(&raw[psize], 0, raw_size - psize);
|
||||
raw[psize++] = 0x80;
|
||||
|
||||
bsize = round_up(psize, SHA_MESSAGE_BYTES);
|
||||
blocks = bsize / SHA_MESSAGE_BYTES;
|
||||
bsize = round_up(psize, SHA1_BLOCK_SIZE);
|
||||
blocks = bsize / SHA1_BLOCK_SIZE;
|
||||
todo = raw;
|
||||
if (bsize - psize >= sizeof(__be64)) {
|
||||
bits = (__be64 *)(todo + bsize - sizeof(__be64));
|
||||
@@ -320,12 +320,12 @@ int bpf_prog_calc_tag(struct bpf_prog *fp)
|
||||
*bits = cpu_to_be64((psize - 1) << 3);
|
||||
|
||||
while (blocks--) {
|
||||
sha_transform(digest, todo, ws);
|
||||
todo += SHA_MESSAGE_BYTES;
|
||||
sha1_transform(digest, todo, ws);
|
||||
todo += SHA1_BLOCK_SIZE;
|
||||
}
|
||||
|
||||
result = (__force __be32 *)digest;
|
||||
for (i = 0; i < SHA_DIGEST_WORDS; i++)
|
||||
for (i = 0; i < SHA1_DIGEST_WORDS; i++)
|
||||
result[i] = cpu_to_be32(digest[i]);
|
||||
memcpy(fp->tag, result, sizeof(fp->tag));
|
||||
|
||||
|
@@ -703,7 +703,7 @@ static int padata_cpu_online(unsigned int cpu, struct hlist_node *node)
|
||||
struct padata_instance *pinst;
|
||||
int ret;
|
||||
|
||||
pinst = hlist_entry_safe(node, struct padata_instance, node);
|
||||
pinst = hlist_entry_safe(node, struct padata_instance, cpu_online_node);
|
||||
if (!pinst_has_cpu(pinst, cpu))
|
||||
return 0;
|
||||
|
||||
@@ -718,7 +718,7 @@ static int padata_cpu_dead(unsigned int cpu, struct hlist_node *node)
|
||||
struct padata_instance *pinst;
|
||||
int ret;
|
||||
|
||||
pinst = hlist_entry_safe(node, struct padata_instance, node);
|
||||
pinst = hlist_entry_safe(node, struct padata_instance, cpu_dead_node);
|
||||
if (!pinst_has_cpu(pinst, cpu))
|
||||
return 0;
|
||||
|
||||
@@ -734,8 +734,9 @@ static enum cpuhp_state hp_online;
|
||||
static void __padata_free(struct padata_instance *pinst)
|
||||
{
|
||||
#ifdef CONFIG_HOTPLUG_CPU
|
||||
cpuhp_state_remove_instance_nocalls(CPUHP_PADATA_DEAD, &pinst->node);
|
||||
cpuhp_state_remove_instance_nocalls(hp_online, &pinst->node);
|
||||
cpuhp_state_remove_instance_nocalls(CPUHP_PADATA_DEAD,
|
||||
&pinst->cpu_dead_node);
|
||||
cpuhp_state_remove_instance_nocalls(hp_online, &pinst->cpu_online_node);
|
||||
#endif
|
||||
|
||||
WARN_ON(!list_empty(&pinst->pslist));
|
||||
@@ -939,9 +940,10 @@ static struct padata_instance *padata_alloc(const char *name,
|
||||
mutex_init(&pinst->lock);
|
||||
|
||||
#ifdef CONFIG_HOTPLUG_CPU
|
||||
cpuhp_state_add_instance_nocalls_cpuslocked(hp_online, &pinst->node);
|
||||
cpuhp_state_add_instance_nocalls_cpuslocked(hp_online,
|
||||
&pinst->cpu_online_node);
|
||||
cpuhp_state_add_instance_nocalls_cpuslocked(CPUHP_PADATA_DEAD,
|
||||
&pinst->node);
|
||||
&pinst->cpu_dead_node);
|
||||
#endif
|
||||
|
||||
put_online_cpus();
|
||||
|
Reference in New Issue
Block a user