В ядре Linux была устранена следующая уязвимость: KVM: s390: Данные бесплатной гостевой отладки на vcpu destroy kvm_s390_clear_bp_data() вызывается только из kvm_arch_vcpu_ioctl_set_guest_debug(), то есть когда пользовательское пространство меняется или отключается отладка. vCPU, который разрушается, пока аппаратные точки останова все еще вооружены - обычный случай, когда VMM просто выходит или выходит из строя - утечки hw_bp_info, hw_wp_info и все буферы old_data, поскольку общий KVM освобождает vCPU сразу после kvm_arch_vcpu_destroy(). Это ограничено записями MAX_BP_COUNT, так что примерно 8 KiB на vCPU, но он не ограничен в течение жизни VM. Распределения GFP_KERNEL_ACCOUNT, поэтому заряд также переживает процесс выхода и выводит умирающие memcgs.
Исправлено путем очистки отладочных данных об уничтожении vCPU. Называть это безусловно хорошо: struct kvm_vcpu выделяется ноль, поэтому для vCPU, который никогда не включал отладку, счетчики равны 0, а указатели NULL.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: KVM: s390: Free guest debug data on vcpu destroy kvm_s390_clear_bp_data() is only called from kvm_arch_vcpu_ioctl_set_guest_debug(), i.e. when user space changes or disables debugging. A vCPU that is destroyed while hardware breakpoints are still armed - the normal case when the VMM just exits or crashes - leaks hw_bp_info, hw_wp_info and all old_data buffers, since generic KVM frees the vCPU right after kvm_arch_vcpu_destroy(). That is bounded by MAX_BP_COUNT entries, so roughly 8 KiB per vCPU, but it is unbounded over VM lifetimes. The allocations are GFP_KERNEL_ACCOUNT, so the charge also outlives the exiting process and pins dying memcgs. Fix by clearing the debug data on vCPU destruction. Calling it unconditionally is fine: struct kvm_vcpu is zero allocated, so for a vCPU that never enabled debugging the counters are 0 and the pointers NULL.