[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <175279510782.2985357.8915174612817966643.b4-ty@kernel.org>
Date: Thu, 17 Jul 2025 16:31:50 -0700
From: Kees Cook <kees@...nel.org>
To: linux-kernel@...r.kernel.org,
linux-mm@...ck.org,
fengwei_yin@...ux.alibaba.com
Cc: Kees Cook <kees@...nel.org>,
zhourundong.zrd@...ux.alibaba.com
Subject: Re: [PATCH] binfmt_elf: remove the 4k limitation of program header size
On Thu, 17 Jul 2025 19:01:08 +0800, fengwei_yin@...ux.alibaba.com wrote:
> 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.
>
> [...]
Applied to for-next/execve, thanks!
[1/1] binfmt_elf: remove the 4k limitation of program header size
https://git.kernel.org/kees/c/8030790477e8
Take care,
--
Kees Cook
Powered by blists - more mailing lists