WSL2-Linux-Kernel/security/integrity
Eric Biggers 877b5691f2 crypto: shash - remove shash_desc::flags
The flags field in 'struct shash_desc' never actually does anything.
The only ostensibly supported flag is CRYPTO_TFM_REQ_MAY_SLEEP.
However, no shash algorithm ever sleeps, making this flag a no-op.

With this being the case, inevitably some users who can't sleep wrongly
pass MAY_SLEEP.  These would all need to be fixed if any shash algorithm
actually started sleeping.  For example, the shash_ahash_*() functions,
which wrap a shash algorithm with the ahash API, pass through MAY_SLEEP
from the ahash API to the shash API.  However, the shash functions are
called under kmap_atomic(), so actually they're assumed to never sleep.

Even if it turns out that some users do need preemption points while
hashing large buffers, we could easily provide a helper function
crypto_shash_update_large() which divides the data into smaller chunks
and calls crypto_shash_update() and cond_resched() for each chunk.  It's
not necessary to have a flag in 'struct shash_desc', nor is it necessary
to make individual shash algorithms aware of this at all.

Therefore, remove shash_desc::flags, and document that the
crypto_shash_*() functions can be called from any context.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2019-04-25 15:38:12 +08:00
..
evm crypto: shash - remove shash_desc::flags 2019-04-25 15:38:12 +08:00
ima crypto: shash - remove shash_desc::flags 2019-04-25 15:38:12 +08:00
platform_certs efi: Allow the "db" UEFI variable to be suppressed 2018-12-12 22:09:10 -05:00
Kconfig Merge branch 'next-integrity' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security 2019-01-02 09:43:14 -08:00
Makefile efi: Import certificates from UEFI Secure Boot 2018-12-12 22:04:33 -05:00
digsig.c integrity, KEYS: add a reference to platform keyring 2019-02-04 17:29:19 -05:00
digsig_asymmetric.c integrity: support EC-RDSA signatures for asymmetric_verify 2019-04-18 22:15:03 +08:00
iint.c get rid of legacy 'get_ds()' function 2019-03-04 10:50:14 -08:00
integrity.h integrity: Remove references to module keyring 2018-12-17 14:09:39 -08:00
integrity_audit.c ima: Use audit_log_format() rather than audit_log_string() 2018-07-18 07:27:22 -04:00