aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@imgtec.com>2015-11-12 19:47:48 -0500
committerRalf Baechle <ralf@linux-mips.org>2016-01-19 18:39:20 -0500
commiteb4bc076ff94b82fce04f6db061de597f71bd129 (patch)
tree4ad6d924adc05ccaa546b7e536b939bfb5b34bdc /fs
parent90d53a91fbd0c5a0882c29fa4279a3d2d700c76d (diff)
ELF: Also pass any interpreter's file header to `arch_check_elf'
Also pass any interpreter's file header to `arch_check_elf' so that any architecture handler can have a look at it if needed. Signed-off-by: Maciej W. Rozycki <macro@imgtec.com> Acked-by: Andrew Morton <akpm@linux-foundation.org> Acked-by: Al Viro <viro@zeniv.linux.org.uk> Cc: Matthew Fortune <Matthew.Fortune@imgtec.com> Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/11478/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/binfmt_elf.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 3a93755e880f..051ea4809c14 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -491,6 +491,7 @@ static inline int arch_elf_pt_proc(struct elfhdr *ehdr,
491 * arch_check_elf() - check an ELF executable 491 * arch_check_elf() - check an ELF executable
492 * @ehdr: The main ELF header 492 * @ehdr: The main ELF header
493 * @has_interp: True if the ELF has an interpreter, else false. 493 * @has_interp: True if the ELF has an interpreter, else false.
494 * @interp_ehdr: The interpreter's ELF header
494 * @state: Architecture-specific state preserved throughout the process 495 * @state: Architecture-specific state preserved throughout the process
495 * of loading the ELF. 496 * of loading the ELF.
496 * 497 *
@@ -502,6 +503,7 @@ static inline int arch_elf_pt_proc(struct elfhdr *ehdr,
502 * with that return code. 503 * with that return code.
503 */ 504 */
504static inline int arch_check_elf(struct elfhdr *ehdr, bool has_interp, 505static inline int arch_check_elf(struct elfhdr *ehdr, bool has_interp,
506 struct elfhdr *interp_ehdr,
505 struct arch_elf_state *state) 507 struct arch_elf_state *state)
506{ 508{
507 /* Dummy implementation, always proceed */ 509 /* Dummy implementation, always proceed */
@@ -829,7 +831,9 @@ static int load_elf_binary(struct linux_binprm *bprm)
829 * still possible to return an error to the code that invoked 831 * still possible to return an error to the code that invoked
830 * the exec syscall. 832 * the exec syscall.
831 */ 833 */
832 retval = arch_check_elf(&loc->elf_ex, !!interpreter, &arch_state); 834 retval = arch_check_elf(&loc->elf_ex,
835 !!interpreter, &loc->interp_elf_ex,
836 &arch_state);
833 if (retval) 837 if (retval)
834 goto out_free_dentry; 838 goto out_free_dentry;
835 839