В ядре Linux устранена следующая уязвимость: netconsole: take target_cleanup_list_lock in drop_netconsole_target() drop_netconsole_target() развязывает мишень, удерживая при этом только target_list_lock. Однако, когда базовый интерфейс был незарегистрирован, netconsole_netdev_event() перемещает цель из target_list в target_cleanup_list, и netconsole_process_cleanups_core() переходит к этому списку только под target_cleanup_list_lock. Если пользователь удаляет цель configfs в то же время, работник очистки итерирует target_cleanup_list, list_del() может повредить список, потому что два пути принимают непересекающиеся блокировки при работе на одном и том же узле списка.
Приобретите target_cleanup_list_lock вокруг list_del (), чтобы разъединение сериализовалось против netconsole_process_cleanups_core (), независимо от того, к какому списку в настоящее время принадлежит цель. Переход состояния, который понижает STATE_DEACTIVATED до STATE_DISABLED, остается неповрежденным и выполняется при том же комбинированном блокировании, сохраняя существующий порядок с resume_target ().
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: netconsole: take target_cleanup_list_lock in drop_netconsole_target() drop_netconsole_target() unlinks the target while only holding target_list_lock. However, when the underlying interface has been unregistered, netconsole_netdev_event() moves the target from target_list to target_cleanup_list, and netconsole_process_cleanups_core() walks that list under target_cleanup_list_lock only. If a user removes the configfs target at the same time the cleanup worker is iterating target_cleanup_list, list_del() can corrupt the list because the two paths take disjoint locks while operating on the same list node. Acquire target_cleanup_list_lock around the list_del() so the unlink is serialised against netconsole_process_cleanups_core() regardless of which list the target currently belongs to. The state transition that downgrades STATE_DEACTIVATED to STATE_DISABLED is left intact and is performed under the same combined locking, preserving the existing ordering with resume_target().