CVE-2024-26678 x86/efistub: Use 1:1 file:memory mapping for PE/COFF .compat section

Medium 5.5 Published Updated

A kernel image layout violation may cause rejection by strict EFI loaders, preventing boot on systems with mixed EFI support enabled.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2024-26678?

CVE-2024-26678 is a medium-severity vulnerability in Linux kernel, published on 2 Apr 2024. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

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

x86/efistub: Use 1:1 file:memory mapping for PE/COFF .compat section

The .compat section is a dummy PE section that contains the address of the 32-bit entrypoint of the 64-bit kernel image if it is bootable from 32-bit firmware (i.e., CONFIG_EFI_MIXED=y)

This section is only 8 bytes in size and is only referenced from the loader, and so it is placed at the end of the memory view of the image, to avoid the need for padding it to 4k, which is required for sections appearing in the middle of the image.

Unfortunately, this violates the PE/COFF spec, and even if most EFI loaders will work correctly (including the Tianocore reference implementation), PE loaders do exist that reject such images, on the basis that both the file and memory views of the file contents should be described by the section headers in a monotonically increasing manner without leaving any gaps.

So reorganize the sections to avoid this issue. This results in a slight padding overhead (< 4k) which can be avoided if desired by disabling CONFIG_EFI_MIXED (which is only needed in rare cases these days)

Weakness: CWE-787

Which versions are affected by CVE-2024-26678?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2024-26678?

Apply the vendor's patch.

Is CVE-2024-26678 being exploited?

There is no known exploitation of CVE-2024-26678 in the wild and no public exploit code.

All Linux kernel vulnerabilities

Sources

Also known as BELL-CVE-2024-26678, DEBIAN-CVE-2024-26678, GHSA-5g26-fc68-x9f2, UBUNTU-CVE-2024-26678.

Is CVE-2024-26678 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free