aboutsummaryrefslogtreecommitdiffstats
path: root/fs/exec.c
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2005-11-09 19:06:04 -0500
committerPaul Mackerras <paulus@samba.org>2005-11-09 19:06:04 -0500
commit31e7f1ff3c5d39a70da85f7d81a1ab1f4e64fa97 (patch)
treea6cb8f14b1182e5dce55d13e52c1182a8c7e0402 /fs/exec.c
parentfca5dcd4835ed09bb1a48a355344aff7a25c76e0 (diff)
parent6730c3c14421b7c924d06e31bb66e0adad225547 (diff)
Merge ../linux-2.6
Diffstat (limited to 'fs/exec.c')
-rw-r--r--fs/exec.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/fs/exec.c b/fs/exec.c
index cd6c574557dc..c466fec5de20 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -135,7 +135,7 @@ asmlinkage long sys_uselib(const char __user * library)
135 if (!S_ISREG(nd.dentry->d_inode->i_mode)) 135 if (!S_ISREG(nd.dentry->d_inode->i_mode))
136 goto exit; 136 goto exit;
137 137
138 error = permission(nd.dentry->d_inode, MAY_READ | MAY_EXEC, &nd); 138 error = vfs_permission(&nd, MAY_READ | MAY_EXEC);
139 if (error) 139 if (error)
140 goto exit; 140 goto exit;
141 141
@@ -495,7 +495,7 @@ struct file *open_exec(const char *name)
495 file = ERR_PTR(-EACCES); 495 file = ERR_PTR(-EACCES);
496 if (!(nd.mnt->mnt_flags & MNT_NOEXEC) && 496 if (!(nd.mnt->mnt_flags & MNT_NOEXEC) &&
497 S_ISREG(inode->i_mode)) { 497 S_ISREG(inode->i_mode)) {
498 int err = permission(inode, MAY_EXEC, &nd); 498 int err = vfs_permission(&nd, MAY_EXEC);
499 if (!err && !(inode->i_mode & 0111)) 499 if (!err && !(inode->i_mode & 0111))
500 err = -EACCES; 500 err = -EACCES;
501 file = ERR_PTR(err); 501 file = ERR_PTR(err);
@@ -590,6 +590,7 @@ static inline int de_thread(struct task_struct *tsk)
590 struct signal_struct *sig = tsk->signal; 590 struct signal_struct *sig = tsk->signal;
591 struct sighand_struct *newsighand, *oldsighand = tsk->sighand; 591 struct sighand_struct *newsighand, *oldsighand = tsk->sighand;
592 spinlock_t *lock = &oldsighand->siglock; 592 spinlock_t *lock = &oldsighand->siglock;
593 struct task_struct *leader = NULL;
593 int count; 594 int count;
594 595
595 /* 596 /*
@@ -665,7 +666,7 @@ static inline int de_thread(struct task_struct *tsk)
665 * and to assume its PID: 666 * and to assume its PID:
666 */ 667 */
667 if (!thread_group_leader(current)) { 668 if (!thread_group_leader(current)) {
668 struct task_struct *leader = current->group_leader, *parent; 669 struct task_struct *parent;
669 struct dentry *proc_dentry1, *proc_dentry2; 670 struct dentry *proc_dentry1, *proc_dentry2;
670 unsigned long exit_state, ptrace; 671 unsigned long exit_state, ptrace;
671 672
@@ -674,6 +675,7 @@ static inline int de_thread(struct task_struct *tsk)
674 * It should already be zombie at this point, most 675 * It should already be zombie at this point, most
675 * of the time. 676 * of the time.
676 */ 677 */
678 leader = current->group_leader;
677 while (leader->exit_state != EXIT_ZOMBIE) 679 while (leader->exit_state != EXIT_ZOMBIE)
678 yield(); 680 yield();
679 681
@@ -733,7 +735,6 @@ static inline int de_thread(struct task_struct *tsk)
733 proc_pid_flush(proc_dentry2); 735 proc_pid_flush(proc_dentry2);
734 736
735 BUG_ON(exit_state != EXIT_ZOMBIE); 737 BUG_ON(exit_state != EXIT_ZOMBIE);
736 release_task(leader);
737 } 738 }
738 739
739 /* 740 /*
@@ -743,8 +744,11 @@ static inline int de_thread(struct task_struct *tsk)
743 sig->flags = 0; 744 sig->flags = 0;
744 745
745no_thread_group: 746no_thread_group:
746 BUG_ON(atomic_read(&sig->count) != 1);
747 exit_itimers(sig); 747 exit_itimers(sig);
748 if (leader)
749 release_task(leader);
750
751 BUG_ON(atomic_read(&sig->count) != 1);
748 752
749 if (atomic_read(&oldsighand->count) == 1) { 753 if (atomic_read(&oldsighand->count) == 1) {
750 /* 754 /*
@@ -892,7 +896,7 @@ int flush_old_exec(struct linux_binprm * bprm)
892 flush_thread(); 896 flush_thread();
893 897
894 if (bprm->e_uid != current->euid || bprm->e_gid != current->egid || 898 if (bprm->e_uid != current->euid || bprm->e_gid != current->egid ||
895 permission(bprm->file->f_dentry->d_inode,MAY_READ, NULL) || 899 file_permission(bprm->file, MAY_READ) ||
896 (bprm->interp_flags & BINPRM_FLAGS_ENFORCE_NONDUMP)) { 900 (bprm->interp_flags & BINPRM_FLAGS_ENFORCE_NONDUMP)) {
897 suid_keys(current); 901 suid_keys(current);
898 current->mm->dumpable = suid_dumpable; 902 current->mm->dumpable = suid_dumpable;