В ядре Linux была устранена следующая уязвимость: RDMA/core: Исправлено потенциальное использование после бесплатного в ib_destroy_cq_user() When доступа к CQ через путь netlink единственным механизмом синхронизации для указанного CQ является rdma_restrack_get(). В настоящее время rdma_restrack_del() вызывается в конце ib_destroy_cq_user(), что уже слишком поздно, так как к этому моменту ресурсы, связанные с CQ, могут быть уже освобождены. Это может оставить короткое окно, где CQ остается доступным через рестайлинг, что приводит к потенциальному use-after-free.
Исправьте это, переместив вызов rdma_restrack_begin_del () в начало ib_destroy_cq_user (), гарантируя, что CQ будет удален из рестайлинга до высвобождения его внутренних ресурсов. Это гарантирует, что никакие новые пользователи не имеют ссылок на CQ, который находится в процессе уничтожения. Кроме того, это изменение сохраняет предполагаемый инвертированный порядок между процедурами создания и уничтожения: ресурсы добавляются в рестайлинг в конце успешного создания и, следовательно, должны быть удалены из рестайлинга первым делом во время потока разрушения, который сохраняет управление жизненным циклом последовательным и предсказуемым.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: RDMA/core: Fix potential use after free in ib_destroy_cq_user() When accessing a CQ via the netlink path the only synchronization mechanism for the said CQ is rdma_restrack_get(). Currently, rdma_restrack_del() is invoked at the end of ib_destroy_cq_user(), which is too late, since by that point vendor-specific resources associated with the CQ might already be freed. This can leave a short window where the CQ remains accessible through restrack, leading to a potential use-after-free. Fix this by moving the rdma_restrack_begin_del() call to the start of ib_destroy_cq_user(), ensuring that the CQ is removed from restrack before its internal resources are released. This guarantees that no new users hold references to a CQ that is in the process of destruction. In addition, this change preserves the intended inverted order between create and destroy routines: resources are added to restrack at the end of successful creation, and hence shall be removed from the restrack first thing during the destruction flow, which keeps the lifecycle management consistent and predictable.
Характеристики атаки
Последствия
Строка CVSS v3.1