linux-stable/fs/verity
Eric Biggers 3cfecc78ff fsverity: don't use bio_first_page_all() in fsverity_verify_bio()
[ Upstream commit d1f0c5ea04 ]

bio_first_page_all(bio)->mapping->host is not compatible with large
folios, since the first page of the bio is not necessarily the head page
of the folio, and therefore it might not have the mapping pointer set.

Therefore, move the dereference of ->mapping->host into
verify_data_blocks(), which works with a folio.

(Like the commit that this Fixes, this hasn't actually been tested with
large folios yet, since the filesystems that use fs/verity/ don't
support that yet.  But based on code review, I think this is needed.)

Fixes: 5d0f0e57ed ("fsverity: support verifying data from large folios")
Link: https://lore.kernel.org/r/20230604022101.48342-1-ebiggers@kernel.org
Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-07-19 16:35:08 +02:00
..
enable.c fsverity: use shash API instead of ahash API 2023-07-19 16:35:08 +02:00
fsverity_private.h fsverity: use shash API instead of ahash API 2023-07-19 16:35:08 +02:00
hash_algs.c fsverity: use shash API instead of ahash API 2023-07-19 16:35:08 +02:00
init.c fsverity: remove debug messages and CONFIG_FS_VERITY_DEBUG 2023-01-01 15:46:48 -08:00
Kconfig fsverity: remove debug messages and CONFIG_FS_VERITY_DEBUG 2023-01-01 15:46:48 -08:00
Makefile fs-verity: add FS_IOC_READ_VERITY_METADATA ioctl 2021-02-07 14:51:11 -08:00
measure.c fsverity: simplify fsverity_get_digest() 2022-11-29 21:07:41 -08:00
open.c fsverity: use WARN_ON_ONCE instead of WARN_ON 2023-04-11 19:23:15 -07:00
read_metadata.c fs-verity: use kmap_local_page() instead of kmap() 2022-08-19 15:19:55 -07:00
signature.c fs-verity: simplify sysctls with register_sysctl() 2023-03-27 21:17:02 -07:00
verify.c fsverity: don't use bio_first_page_all() in fsverity_verify_bio() 2023-07-19 16:35:08 +02:00