В ядре Linux устранена следующая уязвимость: pnfs/blocklayout: Fix device leaks on parse failure bl_parse_concat() и bl_parse_stripe() выделяют массив дочернего устройства, а затем поочередно разбирают каждое дочернее. Если анализ ребенка не удался, несостоявшийся ребенок не засчитывается в nr_children, и родитель может остаться с дочерним массивом, который bl_free_device () не выпустит, когда nr_children равен нулю. Отпустите несостоявшегося ребенка и уже проанализированных детей, прежде чем возвращать ошибку.
Также сделайте так, чтобы bl_free_device() высвобождал дочерний массив всякий раз, когда установлен дочерний указатель, чтобы частично инициализированные устройства concat или stripe были правильно очищены. bl_parse_scsi() также может выйти из строя после назначения d->bdev_file и удаления ссылки на файл. Очистите указатель после fput(), чтобы внешний путь очистки не помещал его снова.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: pnfs/blocklayout: Fix device leaks on parse failure bl_parse_concat() and bl_parse_stripe() allocate a child device array and then parse each child in turn. If parsing a child fails, the failed child is not counted in nr_children and the parent may be left with a children array that bl_free_device() will not release when nr_children is zero. Release the failed child and the already parsed children before returning the error. Also make bl_free_device() release the child array whenever the children pointer is set, so that partially initialised concat or stripe devices are cleaned up correctly. bl_parse_scsi() can also fail after assigning d->bdev_file and dropping the file reference. Clear the pointer after fput() so that an outer cleanup path does not put it again.