linux/fs/verity
Eric Biggers 439bea104c fs-verity: use mempool for hash requests
When initializing an fs-verity hash algorithm, also initialize a mempool
that contains a single preallocated hash request object.  Then replace
the direct calls to ahash_request_alloc() and ahash_request_free() with
allocating and freeing from this mempool.

This eliminates the possibility of the allocation failing, which is
desirable for the I/O path.

This doesn't cause deadlocks because there's no case where multiple hash
requests are needed at a time to make forward progress.

Link: https://lore.kernel.org/r/20191231175545.20709-1-ebiggers@kernel.org
Reviewed-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Eric Biggers <ebiggers@google.com>
2020-01-14 13:28:05 -08:00
..
enable.c fs-verity: use mempool for hash requests 2020-01-14 13:28:05 -08:00
fsverity_private.h fs-verity: use mempool for hash requests 2020-01-14 13:28:05 -08:00
hash_algs.c fs-verity: use mempool for hash requests 2020-01-14 13:28:05 -08:00
init.c fs-verity: support builtin file signatures 2019-08-12 19:33:50 -07:00
Kconfig fs-verity: support builtin file signatures 2019-08-12 19:33:50 -07:00
Makefile fs-verity: support builtin file signatures 2019-08-12 19:33:50 -07:00
measure.c fs-verity: implement FS_IOC_MEASURE_VERITY ioctl 2019-08-12 19:33:50 -07:00
open.c fs-verity: use mempool for hash requests 2020-01-14 13:28:05 -08:00
signature.c fs-verity: support builtin file signatures 2019-08-12 19:33:50 -07:00
verify.c fs-verity: use mempool for hash requests 2020-01-14 13:28:05 -08:00