diff options
Diffstat (limited to 'fs/binfmt_elf_fdpic.c')
-rw-r--r-- | fs/binfmt_elf_fdpic.c | 14 |
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; |