В ядре Linux устранена следующая уязвимость:
ALSA: таймер: очистите SNDRV_TIMER_IFLG_DEAD после завершения закрытия.
snd_timer_close_locked() отмечает экземпляр с помощью SNDRV_TIMER_IFLG_DEAD
и возвращается раньше, когда флаг уже установлен, но флаг никогда не сбрасывается.
снова очистился. Завершенное закрытие заканчивается функцией remove_slave_links(), которая
оставляет timeri->timer NULL, поэтому второе закрытие уже безвредно.
таймер == NULL путь; Досрочное возвращение может быть достигнуто только
экземпляр, который был снова открыт между ними. Для такого случая
close ничего не отключает, поэтому snd_timer_instance_free() освобождает объект, который
все еще включен в timer->open_list_head, все еще в snd_timer_master_list, если он
был открыт подчиненным ключом, все еще владеет приемными рабами и до сих пор
содержит ссылки на таймер и модуль.
snd_seq_timer_open() повторно открывает экземпляр именно так: он повторяет попытку
его резервное открытие на том же объекте после уже произошедшего сбоя
запустите snd_timer_close_locked() внутренне.
Непривилегированный пользователь с
доступ к /dev/snd/timer и /dev/snd/seq может вызвать этот сбой, поскольку
snd_timer_check_master() возвращает -EBUSY, когда ожидающее подчиненное устройство соответствует
ключ нового ведущего устройства (slave_class, подчиненный_id), а целевой таймер имеет
достигнуто max_instances и SNDRV_TIMER_IOCTL_SELECT с dev_class =
SNDRV_TIMER_CLASS_SLAVE сохраняет предоставленный вызывающей стороной dev_sclass, поэтому
Ключ очереди секвенсора можно подделать. Освобожденный экземпляр будет позже
разыменовывается любым последующим snd_timer_open() на этом таймере,
snd_timer_check_slave() и /proc/asound/timers, который вызывает ошибку на
устаревший указатель ti->владельца. Флаг должен быть виден только во время закрытия, а это
все, что нужно другим пользователям.
Очистите его с помощью функции remove_slave_links() под
тот же таймер->блокировка, которая его устанавливает, как только экземпляр удаляется из каждого списка.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: ALSA: timer: Clear SNDRV_TIMER_IFLG_DEAD once the close completes snd_timer_close_locked() marks an instance with SNDRV_TIMER_IFLG_DEAD and returns early when the flag is already set, but the flag is never cleared again. A completed close ends in remove_slave_links(), which leaves timeri->timer NULL, so a second close is already harmless through the timer == NULL path; the early return can only be reached by an instance that was opened again in between. For such an instance the close unlinks nothing, so snd_timer_instance_free() frees an object that is still on timer->open_list_head, still on snd_timer_master_list if it was opened with a slave key, still owns any adopted slaves, and still holds its timer and module references. snd_seq_timer_open() reopens an instance exactly like that: it retries its fallback open on the same object after a failure that has already run snd_timer_close_locked() internally. An unprivileged user with access to /dev/snd/timer and /dev/snd/seq can force that failure, since snd_timer_check_master() returns -EBUSY when a pending slave matches the new master's (slave_class, slave_id) key and the target timer has reached max_instances, and SNDRV_TIMER_IOCTL_SELECT with dev_class = SNDRV_TIMER_CLASS_SLAVE keeps the caller-supplied dev_sclass, so a sequencer queue's key can be forged. The freed instance is afterwards dereferenced by any further snd_timer_open() on that timer, by snd_timer_check_slave(), and by /proc/asound/timers, which faults on the stale ti->owner pointer. The flag only has to be visible while the close is in progress, which is all its other users need. Clear it in remove_slave_links(), under the same timer->lock that sets it, once the instance is off every list.
Характеристики атаки
Последствия
Строка CVSS v3.1