aboutsummaryrefslogtreecommitdiffstats
path: root/lib/crypto/mpi/mpi-sub-ui.c
diff options
context:
space:
mode:
authorYin Fengwei <[email protected]>2025-07-17 11:01:08 +0000
committerKees Cook <[email protected]>2025-07-17 23:29:32 +0000
commit8030790477e839b94a10032c490132e47926cb02 (patch)
tree8dfcc17854d19e04f9e25aab025b25b9ff168213 /lib/crypto/mpi/mpi-sub-ui.c
parentbinfmt_elf: Warn on missing or suspicious regset note names (diff)
downloadkernel-8030790477e839b94a10032c490132e47926cb02.tar.gz
kernel-8030790477e839b94a10032c490132e47926cb02.zip
binfmt_elf: remove the 4k limitation of program header size
We have assembly code generated by a script. GCC successfully compiles it. However, the kernel cannot load it on an ARM64 platform with a 4K page size. In contrast, the same ELF file loads correctly on the same platform with a 64K page size. The root cause is the Linux kernel's ELF_MIN_ALIGN limitation on the program headers of ELF files. The ELF file contains 78 program headers (the script inserts many holes when generating the assembly code). On ARM64 with a 4K page size, the ELF_MIN_ALLIGN enforces a maximum of 74 program headers, causing the ELF file to fail. However, with a 64K page size, the ELF_MIN_ALIGN is relaxed to over 1,184 program headers, allowing the file to run correctly. Cook kindly identified[1] that this limitation was introduced in Linux-0.99.15f without an explanation for its purpose. The ELF specification does not impose such a restriction on program headers. Removing the ELF_MIN_ALIGN limitation on program headers to align with the ELF spec. After removing ELF_MIN_ALIGN limitation, 64K size limitation still exist which should be sufficient. Suggested-by: Kees Cook <[email protected]> Link: https://lore.kernel.org/linux-mm/202506270854.A729825@keescook/ [1] Signed-off-by: Yin Fengwei <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kees Cook <[email protected]>
Diffstat (limited to 'lib/crypto/mpi/mpi-sub-ui.c')
0 files changed, 0 insertions, 0 deletions