[lvc-project] [PATCH] block: bio-integrity: fix memory leak in bio_integrity_map_user()

Dmitry Antipov dmantipov at yandex.ru
Wed May 13 18:43:33 MSK 2026


On Wed, 2026-05-13 at 07:32 -0700, Caleb Sander Mateos wrote:

> I preferred your previous patch changing iov_iter_extract_pages() to
> free the page array on error.

Me too.

> Even though bio_integrity_map_user() is the only current caller that
> requests iov_iter_extract_pages() allocate a page array, others could
> be added in the future and forget to do this freeing.

It was in the past. Again, the whole thing was started from 6.12, see
https://lore.kernel.org/stable/20260505094529.406783-1-dmantipov@yandex.ru
(the commit message is somewhat messy BTW), and I'm definitely interested
in supporting that longterm too.

> Is there a reason you decided to modify bio_integrity_map_user() instead?

Sure. Such an ad-hoc quick fixes are much more likely to be integrated
within a reasonable time and effort from the maintainer. OTOH better wait for
Jens' answer before doing anything else.

Dmitry



More information about the lvc-project mailing list