aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sys.c
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2014-01-23 18:55:52 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-23 19:37:02 -0500
commit98611e4e6a2b4a03fd2d4750cce8e4455a995c8d (patch)
tree5979f4761ba67616eaeb3c5fd6fd19dbd265f9f2 /kernel/sys.c
parent63e46b95e9eae1161832bf45cb40bbad37bfb182 (diff)
exec: kill task_struct->did_exec
We can kill either task->did_exec or PF_FORKNOEXEC, they are mutually exclusive. The patch kills ->did_exec because it has a single user. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Kees Cook <keescook@chromium.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/sys.c')
-rw-r--r--kernel/sys.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/sys.c b/kernel/sys.c
index c72311324ea7..ecd3ea12f72a 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -895,8 +895,7 @@ SYSCALL_DEFINE1(times, struct tms __user *, tbuf)
895 * only important on a multi-user system anyway, to make sure one user 895 * only important on a multi-user system anyway, to make sure one user
896 * can't send a signal to a process owned by another. -TYT, 12/12/91 896 * can't send a signal to a process owned by another. -TYT, 12/12/91
897 * 897 *
898 * Auch. Had to add the 'did_exec' flag to conform completely to POSIX. 898 * !PF_FORKNOEXEC check to conform completely to POSIX.
899 * LBT 04.03.94
900 */ 899 */
901SYSCALL_DEFINE2(setpgid, pid_t, pid, pid_t, pgid) 900SYSCALL_DEFINE2(setpgid, pid_t, pid, pid_t, pgid)
902{ 901{
@@ -932,7 +931,7 @@ SYSCALL_DEFINE2(setpgid, pid_t, pid, pid_t, pgid)
932 if (task_session(p) != task_session(group_leader)) 931 if (task_session(p) != task_session(group_leader))
933 goto out; 932 goto out;
934 err = -EACCES; 933 err = -EACCES;
935 if (p->did_exec) 934 if (!(p->flags & PF_FORKNOEXEC))
936 goto out; 935 goto out;
937 } else { 936 } else {
938 err = -ESRCH; 937 err = -ESRCH;