Commit 5edc2a51 authored by Paul Mundt's avatar Paul Mundt Committed by Linus Torvalds

binfmt_elf_fdpic: wire up AT_EXECFD, AT_EXECFN, AT_SECURE

These auxvec entries are the only ones left unhandled out of the current
base implementation. This syncs up binfmt_elf_fdpic with linux/auxvec.h
and current binfmt_elf.
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
Acked-by: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c7637941
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <linux/fcntl.h> #include <linux/fcntl.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/pagemap.h> #include <linux/pagemap.h>
#include <linux/security.h>
#include <linux/highmem.h> #include <linux/highmem.h>
#include <linux/highuid.h> #include <linux/highuid.h>
#include <linux/personality.h> #include <linux/personality.h>
...@@ -560,11 +561,14 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm, ...@@ -560,11 +561,14 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm,
} }
/* force 16 byte _final_ alignment here for generality */ /* force 16 byte _final_ alignment here for generality */
#define DLINFO_ITEMS 13 #define DLINFO_ITEMS 15
nitems = 1 + DLINFO_ITEMS + (k_platform ? 1 : 0) + nitems = 1 + DLINFO_ITEMS + (k_platform ? 1 : 0) +
(k_base_platform ? 1 : 0) + AT_VECTOR_SIZE_ARCH; (k_base_platform ? 1 : 0) + AT_VECTOR_SIZE_ARCH;
if (bprm->interp_flags & BINPRM_FLAGS_EXECFD)
nitems++;
csp = sp; csp = sp;
sp -= nitems * 2 * sizeof(unsigned long); sp -= nitems * 2 * sizeof(unsigned long);
sp -= (bprm->envc + 1) * sizeof(char *); /* envv[] */ sp -= (bprm->envc + 1) * sizeof(char *); /* envv[] */
...@@ -602,6 +606,12 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm, ...@@ -602,6 +606,12 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm,
(elf_addr_t) (unsigned long) u_base_platform); (elf_addr_t) (unsigned long) u_base_platform);
} }
if (bprm->interp_flags & BINPRM_FLAGS_EXECFD) {
nr = 0;
csp -= 2 * sizeof(unsigned long);
NEW_AUX_ENT(AT_EXECFD, bprm->interp_data);
}
nr = 0; nr = 0;
csp -= DLINFO_ITEMS * 2 * sizeof(unsigned long); csp -= DLINFO_ITEMS * 2 * sizeof(unsigned long);
NEW_AUX_ENT(AT_HWCAP, hwcap); NEW_AUX_ENT(AT_HWCAP, hwcap);
...@@ -617,6 +627,8 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm, ...@@ -617,6 +627,8 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm,
NEW_AUX_ENT(AT_EUID, (elf_addr_t) current->euid); NEW_AUX_ENT(AT_EUID, (elf_addr_t) current->euid);
NEW_AUX_ENT(AT_GID, (elf_addr_t) current->gid); NEW_AUX_ENT(AT_GID, (elf_addr_t) current->gid);
NEW_AUX_ENT(AT_EGID, (elf_addr_t) current->egid); NEW_AUX_ENT(AT_EGID, (elf_addr_t) current->egid);
NEW_AUX_ENT(AT_SECURE, security_bprm_secureexec(bprm));
NEW_AUX_ENT(AT_EXECFN, bprm->exec);
#ifdef ARCH_DLINFO #ifdef ARCH_DLINFO
nr = 0; nr = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment