В ядре Linux была устранена следующая уязвимость: posix-cpu-timers: Prevent освобождает таймер, который стоит в очереди в списке истечения срока действия Kijo проанализировал другую гонку в коде таймера POSIX CPU: Commit bf635681c906 преобразовал cpu_timer::firing из значения tristate в boolean. Это утеряло различие между «не принадлежащими расстрельному списку» и «все еще принадлежащими, но поставка была отменена». The resulting race is: expiry handler timer_settime() timer_delete() -------------- --------------- -------------- collect timer onto private firing list firing = true observes firing = true firing = false return TIMER_RETRY wait for handler observes firing = false finish deletion unhash and free timer resume list traversal read freed elist.next -> UAF The firing bit is clearly the wrong indicator since that commit.
Проверьте, стоит ли таймер в очереди в списке истечения срока действия или нет. Если он стоит в очереди, очистите бит запуска, чтобы предотвратить доставку сигнала, как и раньше, и верните TIMER_RETRY, чтобы звонящий разблокировал таймер, который позволяет коду истечения срока действия сделать прогресс и удалить его из списка.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: posix-cpu-timers: Prevent freeing a timer which is queued on the expiry list Kijo analyzed another race in the POSIX CPU timer code: Commit bf635681c906 converted cpu_timer::firing from a tristate value to a boolean. This lost the distinction between "not owned by the firing list" and "still owned, but delivery was canceled". The resulting race is: expiry handler timer_settime() timer_delete() -------------- --------------- -------------- collect timer onto private firing list firing = true observes firing = true firing = false return TIMER_RETRY wait for handler observes firing = false finish deletion unhash and free timer resume list traversal read freed elist.next -> UAF The firing bit is clearly the wrong indicator since that commit. Check whether the timer is queued on the expiry list or not instead. If it is queued clear the firing bit to prevent signal delivery as before and return TIMER_RETRY so the caller unlocks the timer which allows the expiry code to make progress and remove it from the list.
Характеристики атаки
Последствия
Строка CVSS v3.1