CVE-2025-21977

In the Linux kernel, the following vulnerability has been resolved: fbdev: hyperv_fb: Fix hang in kdump kernel when on Hyper-V Gen 2 VMs Gen 2 Hyper-V VMs boot via EFI and have a standard EFI framebuffer device. When the kdump kernel runs in such a VM, loading the efifb driver may hang because of accessing the framebuffer at the wrong memory address. The scenario occurs when the hyperv_fb driver in the original kernel moves the framebuffer to a different MMIO address because of conflicts with an already-running efifb or simplefb driver. The hyperv_fb driver then informs Hyper-V of the change, which is allowed by the Hyper-V FB VMBus device protocol. However, when the kexec command loads the kdump kernel into crash memory via the kexec_file_load() system call, the system call doesn't know the framebuffer has moved, and it sets up the kdump screen_info using the original framebuffer address. The transition to the kdump kernel does not go through the Hyper-V host, so Hyper-V does not reset the framebuffer address like it would do on a reboot. When efifb tries to run, it accesses a non-existent framebuffer address, which traps to the Hyper-V host. After many such accesses, the Hyper-V host thinks the guest is being malicious, and throttles the guest to the point that it runs very slowly or appears to have hung. When the kdump kernel is loaded into crash memory via the kexec_load() system call, the problem does not occur. In this case, the kexec command builds the screen_info table itself in user space from data returned by the FBIOGET_FSCREENINFO ioctl against /dev/fb0, which gives it the new framebuffer location. This problem was originally reported in 2020 [1], resulting in commit 3cb73bc3fa2a ("hyperv_fb: Update screen_info after removing old framebuffer"). This commit solved the problem by setting orig_video_isVGA to 0, so the kdump kernel was unaware of the EFI framebuffer. The efifb driver did not try to load, and no hang occurred. But in 2024, commit c25a19afb81c ("fbdev/hyperv_fb: Do not clear global screen_info") effectively reverted 3cb73bc3fa2a. Commit c25a19afb81c has no reference to 3cb73bc3fa2a, so perhaps it was done without knowing the implications that were reported with 3cb73bc3fa2a. In any case, as of commit c25a19afb81c, the original problem came back again. Interestingly, the hyperv_drm driver does not have this problem because it never moves the framebuffer. The difference is that the hyperv_drm driver removes any conflicting framebuffers *before* allocating an MMIO address, while the hyperv_fb drivers removes conflicting framebuffers *after* allocating an MMIO address. With the "after" ordering, hyperv_fb may encounter a conflict and move the framebuffer to a different MMIO address. But the conflict is essentially bogus because it is removed a few lines of code later. Rather than fix the problem with the approach from 2020 in commit 3cb73bc3fa2a, instead slightly reorder the steps in hyperv_fb so conflicting framebuffers are removed before allocating an MMIO address. Then the default framebuffer MMIO address should always be available, and there's never any confusion about which framebuffer address the kdump kernel should use -- it's always the original address provided by the Hyper-V host. This approach is already used by the hyperv_drm driver, and is consistent with the usage guidelines at the head of the module with the function aperture_remove_conflicting_devices(). This approach also solves a related minor problem when kexec_load() is used to load the kdump kernel. With current code, unbinding and rebinding the hyperv_fb driver could result in the framebuffer moving back to the default framebuffer address, because on the rebind there are no conflicts. If such a move is done after the kdump kernel is loaded with the new framebuffer address, at kdump time it could again have the wrong address. This problem and fix are described in terms of the kdump kernel, but it can also occur ---truncated---
Configurations

Configuration 1 (hide)

OR cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.14:rc1:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.14:rc2:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.14:rc3:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.14:rc4:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.14:rc5:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.14:rc6:*:*:*:*:*:*

History

30 Oct 2025, 21:03

Type Values Removed Values Added
CWE NVD-CWE-noinfo
Summary
  • (es) En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: fbdev: hyperv_fb: Se corrige el bloqueo del kernel kdump en máquinas virtuales Hyper-V Gen 2. Las máquinas virtuales Hyper-V Gen 2 arrancan mediante EFI y tienen un dispositivo de búfer de trama EFI estándar. Cuando el kernel kdump se ejecuta en una máquina virtual de este tipo, la carga del controlador efifb puede bloquearse debido al acceso al búfer de trama en la dirección de memoria incorrecta. Esto ocurre cuando el controlador hyperv_fb del kernel original mueve el búfer de trama a una dirección MMIO diferente debido a conflictos con un controlador efifb o simplefb ya en ejecución. El controlador hyperv_fb informa a Hyper-V del cambio, permitido por el protocolo de dispositivo VMBus de Hyper-V FB. Sin embargo, cuando el comando kexec carga el kernel kdump en la memoria de fallos mediante la llamada al sistema kexec_file_load(), esta desconoce el desplazamiento del framebuffer y configura el screen_info de kdump con la dirección original del framebuffer. La transición al kernel kdump no pasa por el host de Hyper-V, por lo que Hyper-V no restablece la dirección del framebuffer como lo haría al reiniciar. Cuando efifb intenta ejecutarse, accede a una dirección de framebuffer inexistente, lo que redirige al host de Hyper-V. Tras varios accesos de este tipo, el host de Hyper-V considera que el invitado es malicioso y lo limita hasta el punto de que se ejecuta muy lentamente o parece haberse colgado. Cuando el kernel kdump se carga en la memoria de fallos mediante la llamada al sistema kexec_load(), el problema no se produce. En este caso, el comando kexec crea la tabla screen_info en el espacio de usuario a partir de los datos devueltos por el comando ioctl FBIOGET_FSCREENINFO contra /dev/fb0, lo que le asigna la nueva ubicación del framebuffer. Este problema se reportó originalmente en 2020 [1], lo que resultó en el commit 3cb73bc3fa2a ("hyperv_fb: Actualizar screen_info tras eliminar el framebuffer antiguo"). Esta confirmación solucionó el problema estableciendo orig_video_isVGA a 0, por lo que el kernel de kdump desconocía el framebuffer EFI. El controlador efifb no intentó cargarse y no se produjo ningún bloqueo. Sin embargo, en 2024, el commit c25a19afb81c ("fbdev/hyperv_fb: No borrar la información global del screen_info") revirtió eficazmente el problema 3cb73bc3fa2a. el commit c25a19afb81c no hace referencia a 3cb73bc3fa2a, por lo que quizás se realizó sin conocer las implicaciones reportadas con 3cb73bc3fa2a. En cualquier caso, a partir de el commit c25a19afb81c, el problema original reapareció. Curiosamente, el controlador hyperv_drm no presenta este problema porque nunca mueve el framebuffer. La diferencia radica en que el controlador hyperv_drm elimina cualquier framebuffer conflictivo *antes* de asignar una dirección MMIO, mientras que el controlador hyperv_fb lo hace *después* de asignar una dirección MMIO. Con la ordenación "después", hyperv_fb puede encontrar un conflicto y mover el framebuffer a una dirección MMIO diferente. Sin embargo, el conflicto es esencialmente falso porque se elimina unas líneas de código más adelante. En lugar de corregir el problema con el enfoque de 2020 en el commit 3cb73bc3fa2a, se recomienda reordenar ligeramente los pasos en hyperv_fb para eliminar los framebuffers conflictivos antes de asignar una dirección MMIO. De esta forma, la dirección MMIO predeterminada del framebuffer siempre estará disponible y nunca habrá confusión sobre qué dirección debe usar el kernel de kdump: siempre es la dirección original proporcionada por el host de Hyper-V. Este enfoque ya lo utiliza el controlador hyperv_drm y es coherente con las directrices de uso que se indican al principio del módulo con la función aperture_remove_conflicting_devices(). Este enfoque también resuelve un problema menor relacionado cuando se utiliza kexec_load() para cargar el kernel de kdump. Con el código actual, desvincular y volver a vincular el controlador hyperv_fb podría---truncado---
CPE cpe:2.3:o:linux:linux_kernel:6.14:rc2:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.14:rc3:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.14:rc5:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.14:rc1:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.14:rc4:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.14:rc6:*:*:*:*:*:*
First Time Linux linux Kernel
Linux
References () https://git.kernel.org/stable/c/2924802d35e00a36b1503a4e786f1926b2fdc1d0 - () https://git.kernel.org/stable/c/2924802d35e00a36b1503a4e786f1926b2fdc1d0 - Patch
References () https://git.kernel.org/stable/c/304386373007aaca9236a3f36afac0bbedcd2bf0 - () https://git.kernel.org/stable/c/304386373007aaca9236a3f36afac0bbedcd2bf0 - Patch
References () https://git.kernel.org/stable/c/cfffe46a994ac6d5de3b119917680ea1e9a96125 - () https://git.kernel.org/stable/c/cfffe46a994ac6d5de3b119917680ea1e9a96125 - Patch
CVSS v2 : unknown
v3 : unknown
v2 : unknown
v3 : 5.5

01 Apr 2025, 16:15

Type Values Removed Values Added
New CVE

Information

Published : 2025-04-01 16:15

Updated : 2025-10-30 21:03


NVD link : CVE-2025-21977

Mitre link : CVE-2025-21977

CVE.ORG link : CVE-2025-21977


JSON object : View

Products Affected

linux

  • linux_kernel