diff options
| author | Ingo Molnar <mingo@elte.hu> | 2008-12-29 03:42:58 -0500 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2008-12-29 04:37:07 -0500 |
| commit | 0ce74d9296c971b2355c26984ad0bc538e34dd6c (patch) | |
| tree | 566d03e2a4f6b42dab9628cd82c93cd61d587467 /fs/binfmt_elf.c | |
| parent | 1cc4fff0b360aeffeedb7d6db5089d88dd861700 (diff) | |
| parent | 3c92ec8ae91ecf59d88c798301833d7cf83f2179 (diff) | |
Merge branch 'linus' into timers/hrtimers
Conflicts:
sound/drivers/pcsp/pcsp.c
Semantic conflict:
sound/core/hrtimer.c
Diffstat (limited to 'fs/binfmt_elf.c')
| -rw-r--r-- | fs/binfmt_elf.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 8fcfa398d350..c41fa2af7677 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c | |||
| @@ -157,7 +157,7 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec, | |||
| 157 | int items; | 157 | int items; |
| 158 | elf_addr_t *elf_info; | 158 | elf_addr_t *elf_info; |
| 159 | int ei_index = 0; | 159 | int ei_index = 0; |
| 160 | struct task_struct *tsk = current; | 160 | const struct cred *cred = current_cred(); |
| 161 | struct vm_area_struct *vma; | 161 | struct vm_area_struct *vma; |
| 162 | 162 | ||
| 163 | /* | 163 | /* |
| @@ -223,10 +223,10 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec, | |||
| 223 | NEW_AUX_ENT(AT_BASE, interp_load_addr); | 223 | NEW_AUX_ENT(AT_BASE, interp_load_addr); |
| 224 | NEW_AUX_ENT(AT_FLAGS, 0); | 224 | NEW_AUX_ENT(AT_FLAGS, 0); |
| 225 | NEW_AUX_ENT(AT_ENTRY, exec->e_entry); | 225 | NEW_AUX_ENT(AT_ENTRY, exec->e_entry); |
| 226 | NEW_AUX_ENT(AT_UID, tsk->uid); | 226 | NEW_AUX_ENT(AT_UID, cred->uid); |
| 227 | NEW_AUX_ENT(AT_EUID, tsk->euid); | 227 | NEW_AUX_ENT(AT_EUID, cred->euid); |
| 228 | NEW_AUX_ENT(AT_GID, tsk->gid); | 228 | NEW_AUX_ENT(AT_GID, cred->gid); |
| 229 | NEW_AUX_ENT(AT_EGID, tsk->egid); | 229 | NEW_AUX_ENT(AT_EGID, cred->egid); |
| 230 | NEW_AUX_ENT(AT_SECURE, security_bprm_secureexec(bprm)); | 230 | NEW_AUX_ENT(AT_SECURE, security_bprm_secureexec(bprm)); |
| 231 | NEW_AUX_ENT(AT_EXECFN, bprm->exec); | 231 | NEW_AUX_ENT(AT_EXECFN, bprm->exec); |
| 232 | if (k_platform) { | 232 | if (k_platform) { |
| @@ -949,14 +949,14 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs) | |||
| 949 | set_binfmt(&elf_format); | 949 | set_binfmt(&elf_format); |
| 950 | 950 | ||
| 951 | #ifdef ARCH_HAS_SETUP_ADDITIONAL_PAGES | 951 | #ifdef ARCH_HAS_SETUP_ADDITIONAL_PAGES |
| 952 | retval = arch_setup_additional_pages(bprm, executable_stack); | 952 | retval = arch_setup_additional_pages(bprm, !!elf_interpreter); |
| 953 | if (retval < 0) { | 953 | if (retval < 0) { |
| 954 | send_sig(SIGKILL, current, 0); | 954 | send_sig(SIGKILL, current, 0); |
| 955 | goto out; | 955 | goto out; |
| 956 | } | 956 | } |
| 957 | #endif /* ARCH_HAS_SETUP_ADDITIONAL_PAGES */ | 957 | #endif /* ARCH_HAS_SETUP_ADDITIONAL_PAGES */ |
| 958 | 958 | ||
| 959 | compute_creds(bprm); | 959 | install_exec_creds(bprm); |
| 960 | current->flags &= ~PF_FORKNOEXEC; | 960 | current->flags &= ~PF_FORKNOEXEC; |
| 961 | retval = create_elf_tables(bprm, &loc->elf_ex, | 961 | retval = create_elf_tables(bprm, &loc->elf_ex, |
| 962 | load_addr, interp_load_addr); | 962 | load_addr, interp_load_addr); |
| @@ -1361,6 +1361,7 @@ static void fill_prstatus(struct elf_prstatus *prstatus, | |||
| 1361 | static int fill_psinfo(struct elf_prpsinfo *psinfo, struct task_struct *p, | 1361 | static int fill_psinfo(struct elf_prpsinfo *psinfo, struct task_struct *p, |
| 1362 | struct mm_struct *mm) | 1362 | struct mm_struct *mm) |
| 1363 | { | 1363 | { |
| 1364 | const struct cred *cred; | ||
| 1364 | unsigned int i, len; | 1365 | unsigned int i, len; |
| 1365 | 1366 | ||
| 1366 | /* first copy the parameters from user space */ | 1367 | /* first copy the parameters from user space */ |
| @@ -1388,8 +1389,11 @@ static int fill_psinfo(struct elf_prpsinfo *psinfo, struct task_struct *p, | |||
| 1388 | psinfo->pr_zomb = psinfo->pr_sname == 'Z'; | 1389 | psinfo->pr_zomb = psinfo->pr_sname == 'Z'; |
| 1389 | psinfo->pr_nice = task_nice(p); | 1390 | psinfo->pr_nice = task_nice(p); |
| 1390 | psinfo->pr_flag = p->flags; | 1391 | psinfo->pr_flag = p->flags; |
| 1391 | SET_UID(psinfo->pr_uid, p->uid); | 1392 | rcu_read_lock(); |
| 1392 | SET_GID(psinfo->pr_gid, p->gid); | 1393 | cred = __task_cred(p); |
| 1394 | SET_UID(psinfo->pr_uid, cred->uid); | ||
| 1395 | SET_GID(psinfo->pr_gid, cred->gid); | ||
| 1396 | rcu_read_unlock(); | ||
| 1393 | strncpy(psinfo->pr_fname, p->comm, sizeof(psinfo->pr_fname)); | 1397 | strncpy(psinfo->pr_fname, p->comm, sizeof(psinfo->pr_fname)); |
| 1394 | 1398 | ||
| 1395 | return 0; | 1399 | return 0; |
