Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-4]: src/sys/kern Pull up revision 1.72 (requested by he):



details:   https://anonhg.NetBSD.org/src/rev/2bfec6103cc2
branches:  netbsd-1-4
changeset: 471318:2bfec6103cc2
user:      he <he%NetBSD.org@localhost>
date:      Mon Jan 14 15:19:04 2002 +0000

description:
Pull up revision 1.72 (requested by he):
  Fix a ptrace/execve race condition which could be used to modify
  the child process' image during execve.  This would be a security
  issue due to setuid programs.

diffstat:

 sys/kern/sys_process.c |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (20 lines):

diff -r 479fe2f05e75 -r 2bfec6103cc2 sys/kern/sys_process.c
--- a/sys/kern/sys_process.c    Mon Jan 14 15:18:47 2002 +0000
+++ b/sys/kern/sys_process.c    Mon Jan 14 15:19:04 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sys_process.c,v 1.61 1999/03/25 04:45:57 sommerfe Exp $        */
+/*     $NetBSD: sys_process.c,v 1.61.2.1 2002/01/14 15:19:04 he Exp $  */
 
 /*-
  * Copyright (c) 1994 Christopher G. Demetriou.  All rights reserved.
@@ -105,6 +105,10 @@
                        return (ESRCH);
        }
 
+       /* Can't trace a process that's currently exec'ing. */
+       if ((t->p_flag & P_INEXEC) != 0)
+               return EAGAIN;
+
        /* Make sure we can operate on it. */
        switch (SCARG(uap, req)) {
        case  PT_TRACE_ME:



Home | Main Index | Thread Index | Old Index