]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commit - fs/binfmt_elf.c
binfmt_elf: don't attempt to load FDPIC binaries
authorNicolas Pitre <nicolas.pitre@linaro.org>
Wed, 16 Aug 2017 20:05:13 +0000 (16:05 -0400)
committerNicolas Pitre <nicolas.pitre@linaro.org>
Sun, 10 Sep 2017 23:31:47 +0000 (19:31 -0400)
commit4755200b6b116dbf6d5545427e8a2cf58194ba6b
tree68886d0d774a06af916967474c7ecc45dde201bd
parent382e67aec6a7eea8ed4403e86950b468a191c468
binfmt_elf: don't attempt to load FDPIC binaries

On platforms where both ELF and ELF-FDPIC variants are available, the
regular ELF loader will happily identify FDPIC binaries as proper ELF
and load them without the necessary FDPIC fixups, resulting in an
immediate user space crash. Let's prevent binflt_elf from loading those
binaries so binfmt_elf_fdpic has a chance to pick them up. For those
architectures that don't define elf_check_fdpic(), a default version
returning false is provided.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
Acked-by: Mickael GUENE <mickael.guene@st.com>
Tested-by: Vincent Abriou <vincent.abriou@st.com>
Tested-by: Andras Szemzo <szemzo.andras@gmail.com>
fs/binfmt_elf.c