The current code incorrectly subtracts ImageBase from section VirtualAddress values when loading sections into memory. This is based on a misunderstanding of the PE specification. VirtualAddress in section headers is the address of the first byte of the section relative to the image base when the section is loaded into memory. In other words, VirtualAddress is already an RVA measured from the image base, it is definitely NOT an absolute address that needs to be adjusted. So when loading a PE image into a newly allocated buffer, sections should be copied to buffer + VirtualAddress, regardless of what ImageBase says. The ImageBase field merely indicates the *preferred* load address, it does not affect how section RVAs are interpreted. This happens to not cause issues when ImageBase was 0 (since VirtualAddress - 0 = VirtualAddress), which is why this bug went undetected on modern kernels. However, it fails with kernels that have non-zero ImageBase values. So let's remove the nonsensical VirtualAddress < ImageBase check, and remove the ImageBase subtractions from section loading offsets. This lets all kernel UKIs work properly again. Fixes: #40342
System and Service Manager
Details
Most documentation is available on systemd's web site.
Assorted, older, general information about systemd can be found in the systemd Wiki.
Information about build requirements is provided in the README file.
Consult our NEWS file for information about what's new in the most recent systemd versions.
Please see the Code Map for information about this repository's layout and content.
Please see the Hacking guide for information on how to hack on systemd and test your modifications.
Please see our Contribution Guidelines for more information about filing GitHub Issues and posting GitHub Pull Requests.
When preparing patches for systemd, please follow our Coding Style Guidelines.
If you are looking for support, please contact our mailing list, join our IRC channel #systemd on libera.chat or Matrix channel
Stable branches with backported patches are available in the stable repo.
We have a security bug bounty program sponsored by the Sovereign Tech Fund hosted on YesWeHack
Repositories with distribution packages built from git main are available on OBS, and also repositories with packages built from the latest stable release
