В ядре Linux устранена следующая уязвимость:
RDMA/mlx5: исправлено разыменование NULL в событии подписки devx.
MLX5_IB_METHOD_DEVX_SUBSCRIBE_EVENT() связывает event_sub с sub_list
перед инициализацией полей, используемых общим путем ошибок. Если eventfd_ctx_fdget() завершается неудачей, путь очистки разыменовывается.
event_sub->ev_file в uverbs_uobject_put() и вызовах
subscribe_event_xa_dealloc() с неустановленным значением xa_key_level1.
subscribe_event_xa_alloc() создает запись XA ровно один раз для данного
key_level1 при первом появлении этого ключа. Путь расслабления должен
поэтому для этого также вызовите subscribe_event_xa_dealloc() ровно один раз.
Обеспечьте это, добавив devx_key_in_sub_list() и вызвав
subscribe_event_xa_dealloc() только тогда, когда последняя соответствующая ожидающая запись
очищаются.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: RDMA/mlx5: Fix devx subscribe-event unwind NULL dereference MLX5_IB_METHOD_DEVX_SUBSCRIBE_EVENT() links event_sub into sub_list before initializing the fields used by the shared error path. If eventfd_ctx_fdget() then fails, the unwind path dereferences event_sub->ev_file in uverbs_uobject_put() and calls subscribe_event_xa_dealloc() with an unset xa_key_level1. subscribe_event_xa_alloc() creates the XA entry exactly once for a given key_level1, on the first occurrence of that key. The unwind path must therefore call subscribe_event_xa_dealloc() exactly once for it as well. Enforce that by adding devx_key_in_sub_list() and calling subscribe_event_xa_dealloc() only when the last matching pending entry is being cleaned up.