В ядре Linux устранена следующая уязвимость: s390/vfio-ap: исправлено потенциальное использование неинициализированного растрового файла apm_filtered bitmap The DECLARE_BITMAP(apm_filtered, AP_DEVICES) макрос выделяет растровое изображение на стеке без его нулевой инициализации. В vfio_ap_mdev_hot_plug_cfg() функция vfio_ap_mdev_filter_matrix() вызывается только для инициализации и заполнения apm_filtered, если верны filter_adapters или filter_domains. Если изменение конфигурации горячего разъема добавляет только контрольные домены (то есть filter_cdoms верно, но filter_adapters и filter_domains ложны), vfio_ap_mdev_filter_matrix() обходится.
Следовательно, apm_filtered передается в reset_queues_for_apids() с неинициализированным мусором стека. Это может привести к тому, что reset_queues_for_apids() интерпретирует произвольные биты мусора стека как действительные APIDs для сброса, потенциально выполняя непреднамеренные сбросы очереди гостевого оборудования. Исправьте это, инициализировав растровую карту apm_filtered в начале vfio_ap_mdev_hot_plug_cfg() с помощью bitmap_zero().
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: s390/vfio-ap: fix potential use of uninitialized apm_filtered bitmap The DECLARE_BITMAP(apm_filtered, AP_DEVICES) macro allocates the bitmap on the stack without zero-initializing it. In vfio_ap_mdev_hot_plug_cfg(), the vfio_ap_mdev_filter_matrix() function is only called to initialize and populate apm_filtered if either filter_adapters or filter_domains is true. If the hot plug configuration change only adds control domains (meaning filter_cdoms is true, but filter_adapters and filter_domains are both false), vfio_ap_mdev_filter_matrix() is bypassed. Consequently, apm_filtered is passed to reset_queues_for_apids() with uninitialized stack garbage. This can cause reset_queues_for_apids() to interpret arbitrary stack garbage bits as valid APIDs to reset, potentially performing unintended guest hardware queue resets. Fix this by zero-initializing the apm_filtered bitmap at the beginning of vfio_ap_mdev_hot_plug_cfg() using bitmap_zero().