An early pull request is in for the upcoming Linux 6.17 merge. It aims to fix an odd kernel limitation dating back to 1993, during the Linux 0.99 kernel era.
A Linux engineer from Alibaba discovered a bug related to a specific Assembly file generated by a script. When building this file with the GCC compiler as an ELF (Executable and Linkable Format) file, it ran into issues. On an ARM64 platform using the standard 4K page size, it resulted in an “exec format error.” However, it worked smoothly on a system using a 64K page size.
The engineer pointed out that the kernel contains a check in one of its load ELF functions. This check looked for whether the file size exceeded the limit defined by ELF_MIN_ALIGN divided by PAGE_SIZE. In this case, it did, causing the program to fail. Removing this check allowed the binary to function on a 4K page size kernel.
Long-time Linux developer Kees Cook took a deep dive into the historical code to find out why this limitation even existed. He noted that when ELF binary support was first introduced, this specific PAGE_SIZE check was absent. The check appeared later without any clear explanation for its necessity. Cook found that the restriction was much more lenient when using larger page sizes.
For Linux 6.17, there’s a patch set to lift this 4K limitation on the program header size. The explanation for this change emphasizes that the ELF specification does not impose limits on program headers. The intention is to align the kernel’s behavior with the official specifications, allowing for more modern use cases.
As more users shift to 64K page sizes, this update is not just a technical fix but could also improve performance and compatibility for those utilizing advanced Linux features. So, as the merge window opens, assuming no issues arise from Linus Torvalds, this patch should clear the path for a smoother and more efficient Linux experience.
Source link
Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite