1
0
Fork 0
remarkable-linux/arch/x86
Eric Biggers 8d906d183b 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.

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-16 20:23:00 +01:00
..
boot x86/mm/pti: Add infrastructure for page table isolation 2018-01-02 20:30:56 +01:00
configs x86/unwind: Rename unwinder config options to 'CONFIG_UNWINDER_*' 2017-12-25 14:26:13 +01:00
crypto crypto: hash - annotate algorithms taking optional key 2018-02-16 20:23:00 +01:00
entry x86/syscall: Sanitize syscall table de-references under speculation 2018-02-07 11:12:23 -08:00
events perf/x86/amd/power: Do not load AMD power module on !AMD platforms 2018-01-31 14:03:49 +01:00
hyperv x86/virt: Add enum for hypervisors to replace x86_hyper 2017-12-25 14:26:20 +01:00
ia32 License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
include x86/speculation: Fix typo IBRS_ATT, which should be IBRS_ALL 2018-02-07 11:12:25 -08:00
kernel Revert "x86/alternative: Print unadorned pointers" 2018-02-13 10:19:49 +01:00
kvm KVM MMU: check pending exception before injecting APF 2018-02-16 20:22:44 +01:00
lib x86/get_user: Use pointer masking to limit speculation 2018-02-07 11:12:23 -08:00
math-emu License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mm x86/speculation: Use Indirect Branch Prediction Barrier in context switch 2018-02-07 11:12:24 -08:00
net bpf: fix bpf_tail_call() x64 JIT 2017-10-03 16:04:44 -07:00
oprofile x86/oprofile/ppro: Do not use __this_cpu*() in preemptible context 2017-11-08 13:01:54 +01:00
pci x86/PCI: Make broadcom_postcore_init() check acpi_disabled 2017-12-14 09:52:53 +01:00
platform x86/pti: Unbreak EFI old_memmap 2018-01-17 09:45:27 +01:00
power x86/entry: Remap the TSS into the CPU entry area 2017-12-25 14:26:22 +01:00
purgatory License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ras License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
realmode License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
tools License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
um x86/entry: Use SYSCALL_DEFINE() macros for sys_modify_ldt() 2017-12-10 13:40:41 +01:00
video x86/video: Don't assume all FB devices are PCI devices 2016-03-15 11:08:26 +01:00
xen x86/xen: Support early interrupts in xen pv guests 2018-02-03 17:39:17 +01:00
.gitignore
Kbuild Merge branch 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-09-07 09:25:15 -07:00
Kconfig x86/retpoline: Add initial retpoline support 2018-01-17 09:45:29 +01:00
Kconfig.cpu License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Kconfig.debug x86/unwind: Make CONFIG_UNWINDER_ORC=y the default in kconfig for 64-bit 2017-12-25 14:26:14 +01:00
Makefile x86/retpoline: Remove compile time warning 2018-01-17 09:45:30 +01:00
Makefile.um License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Makefile_32.cpu License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00