В ядре Linux была устранена следующая уязвимость: iomap: release the folio batch on iomap callback failures Обзор sashiko несвязанного патча указывает на то, что механизм folio batch, используемый для нулевого диапазона iomap, не позволяет выпустить партию в паре сценариев ошибок. Если один из вызовов ->iomap_end() или ->iomap_begin() не удался, прямые пути возврата обходят пакетную очистку. Случай ->iomap_end() не является практической проблемой на данный момент, потому что нет пользователя механизма, который возвращает ошибку с этого пути.
Случай ->iomap_begin () теоретически возможен, потому что XFS может вызвать помощник заполнения и ошибки в различных точках после этого. Это тонко усложняет вещи, потому что XFS не передает iomap_flags в структуру данных iomap в пути ошибки. Чтобы справиться с обеими этими проблемами, сначала обязательно вызовите помощника очистки в пути ошибки для любого обратного вызова fs.
Во-вторых, обновите помощник, чтобы безоговорочно очистить флаг и освободить партию, пока она населена. Это более четко очерчивает цель флага для контроля пути ввода-вывода и не обязательно статус fbatch, поэтому добавьте комментарий вокруг этого.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: iomap: release the folio batch on iomap callback failures A sashiko review of an unrelated patch points out that the folio batch mechanism used for iomap zero range fails to release the batch in a couple error scenarios. If either calls to ->iomap_end() or ->iomap_begin() fail, the direct return paths bypass the batch cleanup. The ->iomap_end() case is not a practical issue at the moment because there is no user of the mechanism that returns an error from this path. The ->iomap_begin() case is theoretically possible because XFS can invoke the fill helper and error out at various points thereafter. This subtly complicates things because XFS does not transfer iomap_flags to the iomap data structure in the error path. To deal with both of these issues, first make sure to invoke the cleanup helper in the error path for either fs callback. Second, update the helper to clear the flag unconditionally and release the batch so long as it is populated. This more clearly delineates the purpose of the flag to control the I/O path and not necessarily the status of the fbatch, so add a comment around this as well.