fsverity: don't use bio_first_page_all() in fsverity_verify_bio()
authorEric Biggers <ebiggers@google.com>
Sun, 4 Jun 2023 02:21:01 +0000 (19:21 -0700)
committerEric Biggers <ebiggers@google.com>
Sun, 4 Jun 2023 12:56:11 +0000 (05:56 -0700)
commitd1f0c5ea04cd0a93309de0246278f0b22394692d
tree56d949991109fb571829758970c7481595393746
parent32ab3c5e6226a5c39b6674b5fbb16b492c2faa2e
fsverity: don't use bio_first_page_all() in fsverity_verify_bio()

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: 5d0f0e57ed90 ("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>
fs/verity/verify.c