CVE-2025-21977: fbdev: hyperv_fb: Fix hang in kdump kernel when on Hyper-V Gen 2 VMs

Published Apr 1, 2025
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

fbdev: hypervfb: 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 hypervfb 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 hypervfb 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 kexecfileload() system call, the system call doesn't know the framebuffer has moved, and it sets up the kdump screeninfo 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 kexecload() system call, the problem does not occur. In this case, the kexec command builds the screeninfo table itself in user space from data returned by the FBIOGETFSCREENINFO ioctl against /dev/fb0, which gives it the new framebuffer location.

This problem was originally reported in 2020 [1], resulting in commit 3cb73bc3fa2a ("hypervfb: Update screeninfo after removing old framebuffer"). This commit solved the problem by setting origvideoisVGA 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/hypervfb: Do not clear global screeninfo") 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 hypervdrm driver does not have this problem because it never moves the framebuffer. The difference is that the hypervdrm driver removes any conflicting framebuffers before allocating an MMIO address, while the hypervfb drivers removes conflicting framebuffers after allocating an MMIO address. With the "after" ordering, hypervfb 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 hypervfb 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 hypervdrm driver, and is consistent with the usage guidelines at the head of the module with the function apertureremoveconflictingdevices().

This approach also solves a related minor problem when kexecload() is used to load the kdump kernel. With current code, unbinding and rebinding the hypervfb 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---

Affected Software

9 affected components
Linux Kernel
Linux Linux kernel>=6.8<6.12.20
Linux Linux kernel>=6.13<6.13.8
Linux Linux kernel=6.14-rc1
Linux Linux kernel=6.14-rc2
Linux Linux kernel=6.14-rc3
Linux Linux kernel=6.14-rc4
Linux Linux kernel=6.14-rc5
Linux Linux kernel=6.14-rc6

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Compensating control

    Use the kexec_file_load() system call instead of kexec_load() when loading the kdump kernel; the described framebuffer-address conflict does not occur with kexec_file_load().

Event History

Apr 1, 2025
CVE Published
via MITRE·03:47 PM
Data Sourced
via MITRE·03:47 PM
Description
Data Sourced
via NVD·04:15 PM
RemedyDescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2025-21977?

CVE-2025-21977 has been rated as a moderate severity vulnerability due to its potential impact on kdump operations in Hyper-V Gen 2 VMs.

2

How can I fix CVE-2025-21977?

To fix CVE-2025-21977, update your Linux kernel to a version that includes the patch addressing this specific vulnerability.

3

What systems are affected by CVE-2025-21977?

CVE-2025-21977 affects the Linux kernel running on Hyper-V Generation 2 virtual machines.

4

What issue does CVE-2025-21977 address?

CVE-2025-21977 addresses a hang issue that occurs during the execution of the kdump kernel when utilizing the efifb driver.

5

When was CVE-2025-21977 published?

CVE-2025-21977 was published to disclose the vulnerability and the related fix in the Linux kernel.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203