forked from torvalds/linux
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fs/binfmt_elf: Fix memsz > filesz handling
The old code for ELF interpreter loading could only handle 1 memsz > filesz segment. This is incorrect, as evidenced by the elf program loading code, which could handle multiple such segments. Fix memsz > filesz handling for elf interpreters and refactor interpreter/program BSS clearing into a common codepath; also handle the case where a segment after a bss could overwrite a bss clear. This bug was uncovered on builds of ppc64le musl libc with llvm lld 15.0.0, since ppc64 does not allocate file space for its .plt. Cc: Rich Felker <dalias@libc.org> Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
- Loading branch information
1 parent
38b9184
commit 95d3dfb
Showing
1 changed file
with
164 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters