diff options
-rw-r--r-- | fs/binfmt_elf.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 451c04fecb43..d0434406eaeb 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c | |||
@@ -177,10 +177,11 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec, | |||
177 | } | 177 | } |
178 | 178 | ||
179 | /* Create the ELF interpreter info */ | 179 | /* Create the ELF interpreter info */ |
180 | elf_info = (elf_addr_t *) current->mm->saved_auxv; | 180 | elf_info = (elf_addr_t *)current->mm->saved_auxv; |
181 | #define NEW_AUX_ENT(id, val) \ | 181 | #define NEW_AUX_ENT(id, val) \ |
182 | do { \ | 182 | do { \ |
183 | elf_info[ei_index++] = id; elf_info[ei_index++] = val; \ | 183 | elf_info[ei_index++] = id; \ |
184 | elf_info[ei_index++] = val; \ | ||
184 | } while (0) | 185 | } while (0) |
185 | 186 | ||
186 | #ifdef ARCH_DLINFO | 187 | #ifdef ARCH_DLINFO |
@@ -199,17 +200,17 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec, | |||
199 | NEW_AUX_ENT(AT_BASE, interp_load_addr); | 200 | NEW_AUX_ENT(AT_BASE, interp_load_addr); |
200 | NEW_AUX_ENT(AT_FLAGS, 0); | 201 | NEW_AUX_ENT(AT_FLAGS, 0); |
201 | NEW_AUX_ENT(AT_ENTRY, exec->e_entry); | 202 | NEW_AUX_ENT(AT_ENTRY, exec->e_entry); |
202 | NEW_AUX_ENT(AT_UID, (elf_addr_t)tsk->uid); | 203 | NEW_AUX_ENT(AT_UID, tsk->uid); |
203 | NEW_AUX_ENT(AT_EUID, (elf_addr_t)tsk->euid); | 204 | NEW_AUX_ENT(AT_EUID, tsk->euid); |
204 | NEW_AUX_ENT(AT_GID, (elf_addr_t)tsk->gid); | 205 | NEW_AUX_ENT(AT_GID, tsk->gid); |
205 | NEW_AUX_ENT(AT_EGID, (elf_addr_t)tsk->egid); | 206 | NEW_AUX_ENT(AT_EGID, tsk->egid); |
206 | NEW_AUX_ENT(AT_SECURE, (elf_addr_t)security_bprm_secureexec(bprm)); | 207 | NEW_AUX_ENT(AT_SECURE, security_bprm_secureexec(bprm)); |
207 | if (k_platform) { | 208 | if (k_platform) { |
208 | NEW_AUX_ENT(AT_PLATFORM, | 209 | NEW_AUX_ENT(AT_PLATFORM, |
209 | (elf_addr_t)(unsigned long)u_platform); | 210 | (elf_addr_t)(unsigned long)u_platform); |
210 | } | 211 | } |
211 | if (bprm->interp_flags & BINPRM_FLAGS_EXECFD) { | 212 | if (bprm->interp_flags & BINPRM_FLAGS_EXECFD) { |
212 | NEW_AUX_ENT(AT_EXECFD, (elf_addr_t)bprm->interp_data); | 213 | NEW_AUX_ENT(AT_EXECFD, bprm->interp_data); |
213 | } | 214 | } |
214 | #undef NEW_AUX_ENT | 215 | #undef NEW_AUX_ENT |
215 | /* AT_NULL is zero; clear the rest too */ | 216 | /* AT_NULL is zero; clear the rest too */ |