В ядре Linux была устранена следующая уязвимость: crypto: ixp4xx - fix buffer chain unwind on assocation failure chainup_buffers() строит связанный список дескрипторов буфера для списка разброса. Если dma_pool_alloc() терпит неудачу при построении списка, текущий код устанавливает buf на NULL, а затем безоговорочно отсылает его в конце функции: buf->next NULL; buf->phys_next 0; Это может привести к смещению нулевого указателя при отказе выделения. Если сбой происходит после того, как часть цепи дескриптора уже была выделена и отображена DMA, частично построенная цепочка также должна быть освобождена.
Исправьте это, прекратив частично построенную цепочку на отказе распределения и позволив абонентам размотать ее через существующие пути очистки. Также исправьте ablk_perform (), чтобы сохранить указатели крюка перед проверкой на отказ, поэтому частично построенные цепочки могут быть освобождены правильно.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: crypto: ixp4xx - fix buffer chain unwind on allocation failure chainup_buffers() builds a linked list of buffer descriptors for a scatterlist. If dma_pool_alloc() fails while constructing the list, the current code sets buf to NULL and later dereferences it unconditionally at the end of the function: buf->next = NULL; buf->phys_next = 0; This can lead to a null-pointer dereference on allocation failure. If the failure happens after part of the descriptor chain has already been allocated and DMA-mapped, the partially constructed chain also needs to be released. Fix this by terminating the partially constructed chain on allocation failure and letting the callers unwind it via their existing cleanup paths. Also fix ablk_perform() to preserve the hook pointers before checking for failure, so partially built chains can be freed correctly.