1
0
Fork 0
remarkable-linux/arch/s390
Eric Biggers b392a53b11 crypto: hash - annotate algorithms taking optional key
commit a208fa8f33 upstream.

We need to consistently enforce that keyed hashes cannot be used without
setting the key.  To do this we need a reliable way to determine whether
a given hash algorithm is keyed or not.  AF_ALG currently does this by
checking for the presence of a ->setkey() method.  However, this is
actually slightly broken because the CRC-32 algorithms implement
->setkey() but can also be used without a key.  (The CRC-32 "key" is not
actually a cryptographic key but rather represents the initial state.
If not overridden, then a default initial state is used.)

Prepare to fix this by introducing a flag CRYPTO_ALG_OPTIONAL_KEY which
indicates that the algorithm has a ->setkey() method, but it is not
required to be called.  Then set it on all the CRC-32 algorithms.

The same also applies to the Adler-32 implementation in Lustre.

Also, the cryptd and mcryptd templates have to pass through the flag
from their underlying algorithm.

Cc: stable@vger.kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-25 11:05:43 +01:00
..
appldata s390: Remove deprecated create_singlethread_workqueue 2016-09-06 10:59:57 +02:00
boot s390/decompressor: fix initrd corruption caused by bss clear 2017-04-12 12:41:14 +02:00
configs Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2016-10-04 14:05:52 -07:00
crypto crypto: hash - annotate algorithms taking optional key 2018-02-25 11:05:43 +01:00
hypfs s390/hypfs: Use get_free_page() instead of kmalloc to ensure page alignment 2016-10-28 10:08:58 +02:00
include s390: always save and restore all registers on context switch 2017-12-16 16:25:46 +01:00
kernel s390: fix handling of -1 in set{,fs}[gu]id16 syscalls 2018-02-22 15:43:52 +01:00
kvm KVM: s390: Fix skey emulation permission check 2017-12-14 09:28:13 +01:00
lib Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild 2016-10-14 14:26:58 -07:00
mm s390/mm: fix write access check in gup_huge_pmd() 2017-10-05 09:44:01 +02:00
net bpf, s390: fix jit branch offset related to ldimm64 2017-08-12 19:31:21 -07:00
numa s390/numa: only set possible nodes within node_possible_map 2016-07-31 05:28:00 -04:00
oprofile s390/dumpstack: restore reliable indicator for call traces 2016-10-17 14:44:30 +02:00
pci s390/pci: do not require AIS facility 2017-12-09 22:01:47 +01:00
tools s390/facilities: do not generate DWORDS define anymore 2016-07-31 05:27:59 -04:00
Kbuild s390/numa: add core infrastructure 2015-08-03 18:40:25 +02:00
Kconfig security/keys: add CONFIG_KEYS_COMPAT to Kconfig 2017-11-18 11:22:24 +01:00
Kconfig.debug arch: consolidate CONFIG_STRICT_DEVM in lib/Kconfig.debug 2016-01-09 06:30:49 -08:00
Makefile s390: add assembler include path for vx-insn.h 2016-09-06 11:00:04 +02:00
defconfig mm/usercopy: get rid of CONFIG_DEBUG_STRICT_USER_COPY_CHECKS 2016-08-30 10:10:21 -07:00