Merge patch series "fixes for iomap_bio_read_folio_range_sync"

Christoph Hellwig <hch@lst.de> says:

Two fixes for iomap_bio_read_folio_range_sync, a potential kernel
crash when tweaking the device integrity behvavior using sysfs,
and a missing bio_uninit that the Sashiko review of the first fix
found.

* patches from https://patch.msgid.link/20260804124404.737145-1-hch@lst.de:
  iomap: iomap_bio_read_folio_range_sync is missing a call to bio_uninit
  iomap: don't free integrity payload that doesn't exist

Link: https://patch.msgid.link/20260804124404.737145-1-hch@lst.de
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
This commit is contained in:
Christian Brauner 2026-08-12 09:22:40 +02:00
commit 9948bc9aa1
No known key found for this signature in database
GPG Key ID: 91C61BC06578DCA2

View File

@ -170,10 +170,11 @@ int iomap_bio_read_folio_range_sync(const struct iomap_iter *iter,
if (srcmap->flags & IOMAP_F_INTEGRITY)
fs_bio_integrity_alloc(&bio);
error = submit_bio_wait(&bio);
if (srcmap->flags & IOMAP_F_INTEGRITY) {
if (bio_integrity(&bio)) {
if (!error)
error = fs_bio_integrity_verify(&bio, sector, len);
fs_bio_integrity_free(&bio);
}
bio_uninit(&bio);
return error;
}