mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 15:11:48 -04:00
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>
This commit is contained in:
parent
63e46b95e9
commit
98611e4e6a
4 changed files with 2 additions and 6 deletions
|
|
@ -895,8 +895,7 @@ SYSCALL_DEFINE1(times, struct tms __user *, tbuf)
|
|||
* only important on a multi-user system anyway, to make sure one user
|
||||
* can't send a signal to a process owned by another. -TYT, 12/12/91
|
||||
*
|
||||
* Auch. Had to add the 'did_exec' flag to conform completely to POSIX.
|
||||
* LBT 04.03.94
|
||||
* !PF_FORKNOEXEC check to conform completely to POSIX.
|
||||
*/
|
||||
SYSCALL_DEFINE2(setpgid, pid_t, pid, pid_t, pgid)
|
||||
{
|
||||
|
|
@ -932,7 +931,7 @@ SYSCALL_DEFINE2(setpgid, pid_t, pid, pid_t, pgid)
|
|||
if (task_session(p) != task_session(group_leader))
|
||||
goto out;
|
||||
err = -EACCES;
|
||||
if (p->did_exec)
|
||||
if (!(p->flags & PF_FORKNOEXEC))
|
||||
goto out;
|
||||
} else {
|
||||
err = -ESRCH;
|
||||
|
|
|
|||
Loading…
Reference in a new issue