В ядре Linux была устранена следующая уязвимость: KVM: s390: Fix potential races in dat skey functions When dat_cond_set_storage_key() находит большую страницу, она условно установит ключ хранения в абсолютной памяти с помощью large_crste_to_phys() для получения абсолютного адреса. Между dat_entry_walk() и large_crste_to_phys() существует окно гонки: большая страница может быть разделена одновременно, а large_crste_to_phys() может быть вызван с помощью crste, который не обозначает большую страницу, что приводит к сбоям. Аналогичные проблемы также присутствовали в dat_set_storage_key(). dat_get_storage_key() и dat_reset_reference_bit() вместо этого проверили потенциальное параллельное разделение большой страницы, но затем обработали его неправильно.
Исправьте, выполнив READ_ONCE на указателе crste, проверяя и используя результат, вместо того, чтобы снова ссылаться на указатель. В случае, если гонка была отменена, попробуйте dat_entry_walk () еще раз.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: KVM: s390: Fix potential races in dat skey functions When dat_cond_set_storage_key() finds a large page, it will conditionally set the storage key in absolute memory using large_crste_to_phys() to get the absolute address. There is a race window between dat_entry_walk() and large_crste_to_phys(): the large page could have been split concurrently, and large_crste_to_phys() might be called with a crste that does not designate a large page, leading to crashes. Similar issues were also present in dat_set_storage_key(). dat_get_storage_key() and dat_reset_reference_bit() did instead check for a potential concurrent splitting of the large page, but then handled it incorrectly. Fix by performing a READ_ONCE on the crste pointer, checking and using the result, instead of dereferencing the pointer again. In case a race is detacted, try dat_entry_walk() again.