diff options
| author | cvs2svn <cvs2svn@FreeBSD.org> | 2002-02-04 19:23:43 +0000 |
|---|---|---|
| committer | cvs2svn <cvs2svn@FreeBSD.org> | 2002-02-04 19:23:43 +0000 |
| commit | c2429c497266c4f8c5ec071118e956758aa4af13 (patch) | |
| tree | 27eca0badfcdd1d8d0284d534696abb4195a9eba /sys | |
| parent | b3ea8abeca50df2e24167770d1e7484f1f877a7d (diff) | |
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/conf/newvers.sh | 2 | ||||
| -rw-r--r-- | sys/kern/kern_exec.c | 19 | ||||
| -rw-r--r-- | sys/kern/sys_process.c | 4 | ||||
| -rw-r--r-- | sys/kern/vfs_syscalls.c | 2 | ||||
| -rw-r--r-- | sys/miscfs/procfs/procfs.h | 2 | ||||
| -rw-r--r-- | sys/miscfs/procfs/procfs_ctl.c | 3 | ||||
| -rw-r--r-- | sys/miscfs/procfs/procfs_dbregs.c | 3 | ||||
| -rw-r--r-- | sys/miscfs/procfs/procfs_fpregs.c | 3 | ||||
| -rw-r--r-- | sys/miscfs/procfs/procfs_mem.c | 3 | ||||
| -rw-r--r-- | sys/miscfs/procfs/procfs_regs.c | 3 | ||||
| -rw-r--r-- | sys/miscfs/procfs/procfs_status.c | 4 | ||||
| -rw-r--r-- | sys/miscfs/procfs/procfs_vnops.c | 6 | ||||
| -rw-r--r-- | sys/sys/proc.h | 1 |
13 files changed, 6 insertions, 49 deletions
diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index a8f2bb15d155..1ad7111d41c2 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -36,7 +36,7 @@ TYPE="FreeBSD" REVISION="4.4" -BRANCH="RELEASE-p7" +BRANCH="RELEASE" RELEASE="${REVISION}-${BRANCH}" VERSION="${TYPE} ${RELEASE}" diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 341033c0fcdc..430837ca8629 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -113,15 +113,6 @@ execve(p, uap) imgp = &image_params; /* - * Lock the process and set the P_INEXEC flag to indicate that - * it should be left alone until we're done here. This is - * necessary to avoid race conditions - e.g. in ptrace() - - * that might allow a local user to illicitly obtain elevated - * privileges. - */ - p->p_flag |= P_INEXEC; - - /* * Initialize part of the common data */ imgp->proc = p; @@ -352,12 +343,10 @@ interpret: VREF(ndp->ni_vp); p->p_textvp = ndp->ni_vp; - /* - * Notify others that we exec'd, and clear the P_INEXEC flag - * as we're now a bona fide freshly-execed process. - */ + /* + * notify others that we exec'd + */ KNOTE(&p->p_klist, NOTE_EXEC); - p->p_flag &= ~P_INEXEC; /* * If tracing the process, trap to debugger so breakpoints @@ -411,8 +400,6 @@ exec_fail_dealloc: return (0); exec_fail: - /* we're done here, clear P_INEXEC */ - p->p_flag &= ~P_INEXEC; if (imgp->vmspace_destroyed) { /* sorry, no more process anymore. exit gracefully */ exit1(p, W_EXITCODE(0, SIGABRT)); diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index 482663c793d8..1fd7ef1457ff 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -220,10 +220,6 @@ ptrace(curp, uap) if (!PRISON_CHECK(curp, p)) return (ESRCH); - /* Can't trace a process that's currently exec'ing. */ - if ((p->p_flag & P_INEXEC) != 0) - return EAGAIN; - /* * Permissions check */ diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 6bbd90fc8a63..de2e4861e9ed 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -678,8 +678,6 @@ fstatfs(p, uap) if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0) return (error); mp = ((struct vnode *)fp->f_data)->v_mount; - if (mp == NULL) - return (EBADF); sp = &mp->mnt_stat; error = VFS_STATFS(mp, sp, p); if (error) diff --git a/sys/miscfs/procfs/procfs.h b/sys/miscfs/procfs/procfs.h index 9236cbf6cd70..efc982a4da45 100644 --- a/sys/miscfs/procfs/procfs.h +++ b/sys/miscfs/procfs/procfs.h @@ -97,7 +97,7 @@ struct pfsnode { ((((p1)->p_cred->pc_ucred->cr_uid == (p2)->p_cred->p_ruid) && \ ((p1)->p_cred->p_ruid == (p2)->p_cred->p_ruid) && \ ((p1)->p_cred->p_svuid == (p2)->p_cred->p_ruid) && \ - ((p2)->p_flag & (P_SUGID|P_INEXEC)) == 0) || \ + ((p2)->p_flag & P_SUGID) == 0) || \ (suser_xxx((p1)->p_cred->pc_ucred, (p1), PRISON_ROOT) == 0)) /* diff --git a/sys/miscfs/procfs/procfs_ctl.c b/sys/miscfs/procfs/procfs_ctl.c index 6370e8b05912..2192dbe5afa1 100644 --- a/sys/miscfs/procfs/procfs_ctl.c +++ b/sys/miscfs/procfs/procfs_ctl.c @@ -110,9 +110,6 @@ procfs_control(curp, p, op) { int error; - /* Can't trace a process that's currently exec'ing. */ - if ((p->p_flag & P_INEXEC) != 0) - return EAGAIN; /* * Authorization check: rely on normal debugging protection, except * allow processes to disengage debugging on a process onto which diff --git a/sys/miscfs/procfs/procfs_dbregs.c b/sys/miscfs/procfs/procfs_dbregs.c index 9fe4968d37c6..b4e9d41f668c 100644 --- a/sys/miscfs/procfs/procfs_dbregs.c +++ b/sys/miscfs/procfs/procfs_dbregs.c @@ -62,9 +62,6 @@ procfs_dodbregs(curp, p, pfs, uio) char *kv; int kl; - /* Can't trace a process that's currently exec'ing. */ - if ((p->p_flag & P_INEXEC) != 0) - return EAGAIN; if (!CHECKIO(curp, p) || p_trespass(curp, p)) return (EPERM); kl = sizeof(r); diff --git a/sys/miscfs/procfs/procfs_fpregs.c b/sys/miscfs/procfs/procfs_fpregs.c index 7074148cfbfc..cd5fa7426fe6 100644 --- a/sys/miscfs/procfs/procfs_fpregs.c +++ b/sys/miscfs/procfs/procfs_fpregs.c @@ -59,9 +59,6 @@ procfs_dofpregs(curp, p, pfs, uio) char *kv; int kl; - /* Can't trace a process that's currently exec'ing. */ - if ((p->p_flag & P_INEXEC) != 0) - return EAGAIN; if (!CHECKIO(curp, p) || p_trespass(curp, p)) return EPERM; kl = sizeof(r); diff --git a/sys/miscfs/procfs/procfs_mem.c b/sys/miscfs/procfs/procfs_mem.c index 7e59c4dded62..4994aa6c830a 100644 --- a/sys/miscfs/procfs/procfs_mem.c +++ b/sys/miscfs/procfs/procfs_mem.c @@ -244,9 +244,6 @@ procfs_domem(curp, p, pfs, uio) if (uio->uio_resid == 0) return (0); - /* Can't trace a process that's currently exec'ing. */ - if ((p->p_flag & P_INEXEC) != 0) - return EAGAIN; if (!CHECKIO(curp, p) || p_trespass(curp, p)) return EPERM; diff --git a/sys/miscfs/procfs/procfs_regs.c b/sys/miscfs/procfs/procfs_regs.c index ccde00af6da5..65659eafe7a6 100644 --- a/sys/miscfs/procfs/procfs_regs.c +++ b/sys/miscfs/procfs/procfs_regs.c @@ -60,9 +60,6 @@ procfs_doregs(curp, p, pfs, uio) char *kv; int kl; - /* Can't trace a process that's currently exec'ing. */ - if ((p->p_flag & P_INEXEC) != 0) - return EAGAIN; if (!CHECKIO(curp, p) || p_trespass(curp, p)) return EPERM; kl = sizeof(r); diff --git a/sys/miscfs/procfs/procfs_status.c b/sys/miscfs/procfs/procfs_status.c index b8cc6dbe9f91..8c1707584482 100644 --- a/sys/miscfs/procfs/procfs_status.c +++ b/sys/miscfs/procfs/procfs_status.c @@ -211,9 +211,7 @@ procfs_docmdline(curp, p, pfs, uio) */ if (p->p_args && - (ps_argsopen || (CHECKIO(curp, p) && - (p->p_flag & P_INEXEC) == 0 && - !p_trespass(curp, p)))) { + (ps_argsopen || (CHECKIO(curp, p) && !p_trespass(curp, p)))) { bp = p->p_args->ar_args; buflen = p->p_args->ar_length; buf = 0; diff --git a/sys/miscfs/procfs/procfs_vnops.c b/sys/miscfs/procfs/procfs_vnops.c index 48b4765baa9b..a0dd3986655b 100644 --- a/sys/miscfs/procfs/procfs_vnops.c +++ b/sys/miscfs/procfs/procfs_vnops.c @@ -148,9 +148,6 @@ procfs_open(ap) return (EBUSY); p1 = ap->a_p; - /* Can't trace a process that's currently exec'ing. */ - if ((p2->p_flag & P_INEXEC) != 0) - return EAGAIN; if (!CHECKIO(p1, p2) || p_trespass(p1, p2)) return (EPERM); @@ -242,9 +239,6 @@ procfs_ioctl(ap) return ENOTTY; } - /* Can't trace a process that's currently exec'ing. */ - if ((procp->p_flag & P_INEXEC) != 0) - return EAGAIN; if (!CHECKIO(p, procp) || p_trespass(p, procp)) return EPERM; diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 1ee93da7e60f..7c7cdef8d4d6 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -291,7 +291,6 @@ struct proc { #define P_JAILED 0x1000000 /* Process is in jail */ #define P_OLDMASK 0x2000000 /* need to restore mask before pause */ #define P_ALTSTACK 0x4000000 /* have alternate signal stack */ -#define P_INEXEC 0x8000000 /* Process is in execve(). */ /* * MOVE TO ucred.h? |
