Re: [PATCH v2 0/2] binfmt_elf: return the real error when program headers cannot be loaded
From: Christian Brauner
Date: Wed Dec 02 2026 - 17:20:37 EST
On Fri, 06 Nov 2026 21:57:36 +0100, Konstantin Khorenko wrote:
> load_elf_phdrs() returns NULL on any failure, and load_elf_binary()
> turns that into -ENOEXEC for the executable and -ELIBBAD for its
> interpreter. A failed allocation or read of the program header table
> then looks like a bad file, and glibc's execvp() runs the ELF with
> /bin/sh.
>
> v2 changes the errno of those two failures and nothing else. Patch 2
> adds a selftest for both what stays and what changes.
>
> [...]
Applied to the kernel-7.5.misc branch of the vfs/vfs.git tree.
Patches in the kernel-7.5.misc branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: kernel-7.5.misc
[1/2] binfmt_elf: return the real error when program headers cannot be loaded
https://git.kernel.org/vfs/vfs/c/296e9bafaab7
[2/2] selftests/exec: check the errors of an unloadable program header table
https://git.kernel.org/vfs/vfs/c/00e3f3e675a4