* [PATCH 4/4] iomap: don't free integrity payload that doesn't exist [not found] <20260724051001.202741-1-hch@lst.de> @ 2026-07-24 5:09 ` Christoph Hellwig 2026-07-24 12:29 ` Kanchan Joshi ` (2 more replies) 0 siblings, 3 replies; 4+ messages in thread From: Christoph Hellwig @ 2026-07-24 5:09 UTC (permalink / raw) To: Jens Axboe Cc: Martin K. Petersen, Kanchan Joshi, Anuj Gupta, Christian Brauner, Darrick J. Wong, linux-block, linux-xfs, linux-fsdevel, stable fs_bio_integrity_alloc might not allocate a bio integrity payload if PI verification is disabled on the block device. Check for that case before calling fs_bio_integirty_free in iomap_bio_read_folio_range_sync to avoid a NULL pointer dereferences. Make the branch cover the PI verification as well - while fs_bio_integrity_verify works without an integrity payload, it requires one to actually do useful work. Fixes: 0b10a370529c ("iomap: support T10 protection information") Cc: <stable@vger.kernel.org> # v7.1 Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: "Darrick J. Wong" <djwong@kernel.org> --- fs/iomap/bio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/iomap/bio.c b/fs/iomap/bio.c index dc8ac7e370a5..30ef78a66b4f 100644 --- a/fs/iomap/bio.c +++ b/fs/iomap/bio.c @@ -179,7 +179,7 @@ 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); -- 2.53.0 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 4/4] iomap: don't free integrity payload that doesn't exist 2026-07-24 5:09 ` [PATCH 4/4] iomap: don't free integrity payload that doesn't exist Christoph Hellwig @ 2026-07-24 12:29 ` Kanchan Joshi 2026-07-24 13:33 ` Anuj gupta 2026-07-24 13:48 ` Martin K. Petersen 2 siblings, 0 replies; 4+ messages in thread From: Kanchan Joshi @ 2026-07-24 12:29 UTC (permalink / raw) To: Christoph Hellwig, Jens Axboe Cc: Martin K. Petersen, Anuj Gupta, Christian Brauner, Darrick J. Wong, linux-block, linux-xfs, linux-fsdevel, stable Reviewed-by: Kanchan Joshi <joshi.k@samsung.com> ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 4/4] iomap: don't free integrity payload that doesn't exist 2026-07-24 5:09 ` [PATCH 4/4] iomap: don't free integrity payload that doesn't exist Christoph Hellwig 2026-07-24 12:29 ` Kanchan Joshi @ 2026-07-24 13:33 ` Anuj gupta 2026-07-24 13:48 ` Martin K. Petersen 2 siblings, 0 replies; 4+ messages in thread From: Anuj gupta @ 2026-07-24 13:33 UTC (permalink / raw) To: Christoph Hellwig Cc: Jens Axboe, Martin K. Petersen, Kanchan Joshi, Anuj Gupta, Christian Brauner, Darrick J. Wong, linux-block, linux-xfs, linux-fsdevel, stable Reviewed-by: Anuj Gupta <anuj20.g@samsung.com> ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 4/4] iomap: don't free integrity payload that doesn't exist 2026-07-24 5:09 ` [PATCH 4/4] iomap: don't free integrity payload that doesn't exist Christoph Hellwig 2026-07-24 12:29 ` Kanchan Joshi 2026-07-24 13:33 ` Anuj gupta @ 2026-07-24 13:48 ` Martin K. Petersen 2 siblings, 0 replies; 4+ messages in thread From: Martin K. Petersen @ 2026-07-24 13:48 UTC (permalink / raw) To: Christoph Hellwig Cc: Jens Axboe, Martin K. Petersen, Kanchan Joshi, Anuj Gupta, Christian Brauner, Darrick J. Wong, linux-block, linux-xfs, linux-fsdevel, stable Christoph, > fs_bio_integrity_alloc might not allocate a bio integrity payload if PI > verification is disabled on the block device. Check for that case before > calling fs_bio_integirty_free in iomap_bio_read_folio_range_sync to ^^^^^^^^^ Nit: Typo. -- Martin K. Petersen ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-07-24 13:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20260724051001.202741-1-hch@lst.de>
2026-07-24 5:09 ` [PATCH 4/4] iomap: don't free integrity payload that doesn't exist Christoph Hellwig
2026-07-24 12:29 ` Kanchan Joshi
2026-07-24 13:33 ` Anuj gupta
2026-07-24 13:48 ` Martin K. Petersen
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox