aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2008-10-16 01:04:16 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-16 14:21:46 -0400
commit5edc2a5123a7c3d9bcb19ffcf3b91e8d6c246092 (patch)
tree82a131956b8c4b1a52ea67ae73cf6674b97dd5bb /fs
parentc7637941d16ae426a94058fe3b5460a31f68f61b (diff)
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: Paul Mundt <lethal@linux-sh.org> Acked-by: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/binfmt_elf_fdpic.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c
index 9eee649449a8..0e8367c54624 100644
--- a/fs/binfmt_elf_fdpic.c
+++ b/fs/binfmt_elf_fdpic.c
@@ -25,6 +25,7 @@
25#include <linux/fcntl.h> 25#include <linux/fcntl.h>
26#include <linux/slab.h> 26#include <linux/slab.h>
27#include <linux/pagemap.h> 27#include <linux/pagemap.h>
28#include <linux/security.h>
28#include <linux/highmem.h> 29#include <linux/highmem.h>
29#include <linux/highuid.h> 30#include <linux/highuid.h>
30#include <linux/personality.h> 31#include <linux/personality.h>
@@ -560,11 +561,14 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm,
560 } 561 }
561 562
562 /* force 16 byte _final_ alignment here for generality */ 563 /* force 16 byte _final_ alignment here for generality */
563#define DLINFO_ITEMS 13 564#define DLINFO_ITEMS 15
564 565
565 nitems = 1 + DLINFO_ITEMS + (k_platform ? 1 : 0) + 566 nitems = 1 + DLINFO_ITEMS + (k_platform ? 1 : 0) +
566 (k_base_platform ? 1 : 0) + AT_VECTOR_SIZE_ARCH; 567 (k_base_platform ? 1 : 0) + AT_VECTOR_SIZE_ARCH;
567 568
569 if (bprm->interp_flags & BINPRM_FLAGS_EXECFD)
570 nitems++;
571
568 csp = sp; 572 csp = sp;
569 sp -= nitems * 2 * sizeof(unsigned long); 573 sp -= nitems * 2 * sizeof(unsigned long);
570 sp -= (bprm->envc + 1) * sizeof(char *); /* envv[] */ 574 sp -= (bprm->envc + 1) * sizeof(char *); /* envv[] */
@@ -602,6 +606,12 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm,
602 (elf_addr_t) (unsigned long) u_base_platform); 606 (elf_addr_t) (unsigned long) u_base_platform);
603 } 607 }
604 608
609 if (bprm->interp_flags & BINPRM_FLAGS_EXECFD) {
610 nr = 0;
611 csp -= 2 * sizeof(unsigned long);
612 NEW_AUX_ENT(AT_EXECFD, bprm->interp_data);
613 }
614
605 nr = 0; 615 nr = 0;
606 csp -= DLINFO_ITEMS * 2 * sizeof(unsigned long); 616 csp -= DLINFO_ITEMS * 2 * sizeof(unsigned long);
607 NEW_AUX_ENT(AT_HWCAP, hwcap); 617 NEW_AUX_ENT(AT_HWCAP, hwcap);
@@ -617,6 +627,8 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm,
617 NEW_AUX_ENT(AT_EUID, (elf_addr_t) current->euid); 627 NEW_AUX_ENT(AT_EUID, (elf_addr_t) current->euid);
618 NEW_AUX_ENT(AT_GID, (elf_addr_t) current->gid); 628 NEW_AUX_ENT(AT_GID, (elf_addr_t) current->gid);
619 NEW_AUX_ENT(AT_EGID, (elf_addr_t) current->egid); 629 NEW_AUX_ENT(AT_EGID, (elf_addr_t) current->egid);
630 NEW_AUX_ENT(AT_SECURE, security_bprm_secureexec(bprm));
631 NEW_AUX_ENT(AT_EXECFN, bprm->exec);
620 632
621#ifdef ARCH_DLINFO 633#ifdef ARCH_DLINFO
622 nr = 0; 634 nr = 0;