Deleted Added
full compact
kern_exec.c (147565) kern_exec.c (147708)
1/*-
2 * Copyright (c) 1993, David Greenman
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1993, David Greenman
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/kern/kern_exec.c 147565 2005-06-24 00:16:57Z peter $");
28__FBSDID("$FreeBSD: head/sys/kern/kern_exec.c 147708 2005-06-30 19:01:26Z jkoshy $");
29
30#include "opt_hwpmc_hooks.h"
31#include "opt_ktrace.h"
32#include "opt_mac.h"
33
34#include <sys/param.h>
35#include <sys/systm.h>
36#include <sys/eventhandler.h>

--- 259 unchanged lines hidden (view full) ---

296 struct vnode *textvp = NULL;
297 int credential_changing;
298 int vfslocked;
299 int textset;
300#ifdef MAC
301 struct label *interplabel = NULL;
302 int will_transition;
303#endif
29
30#include "opt_hwpmc_hooks.h"
31#include "opt_ktrace.h"
32#include "opt_mac.h"
33
34#include <sys/param.h>
35#include <sys/systm.h>
36#include <sys/eventhandler.h>

--- 259 unchanged lines hidden (view full) ---

296 struct vnode *textvp = NULL;
297 int credential_changing;
298 int vfslocked;
299 int textset;
300#ifdef MAC
301 struct label *interplabel = NULL;
302 int will_transition;
303#endif
304#ifdef HWPMC_HOOKS
305 struct pmckern_procexec pe;
306#endif
304
305 vfslocked = 0;
306 imgp = &image_params;
307
308 /*
309 * Lock the process and set the P_INEXEC flag to indicate that
310 * it should be left alone until we're done here. This is
311 * necessary to avoid race conditions - e.g. in ptrace() -

--- 364 unchanged lines hidden (view full) ---

676 * processing. This processing needs to happen AFTER the
677 * P_INEXEC flag is cleared.
678 *
679 * The proc lock needs to be released before taking the PMC
680 * SX.
681 */
682 if (PMC_SYSTEM_SAMPLING_ACTIVE() || PMC_PROC_IS_USING_PMCS(p)) {
683 PROC_UNLOCK(p);
307
308 vfslocked = 0;
309 imgp = &image_params;
310
311 /*
312 * Lock the process and set the P_INEXEC flag to indicate that
313 * it should be left alone until we're done here. This is
314 * necessary to avoid race conditions - e.g. in ptrace() -

--- 364 unchanged lines hidden (view full) ---

679 * processing. This processing needs to happen AFTER the
680 * P_INEXEC flag is cleared.
681 *
682 * The proc lock needs to be released before taking the PMC
683 * SX.
684 */
685 if (PMC_SYSTEM_SAMPLING_ACTIVE() || PMC_PROC_IS_USING_PMCS(p)) {
686 PROC_UNLOCK(p);
684 PMC_CALL_HOOK_X(td, PMC_FN_PROCESS_EXEC,
685 (void *) &credential_changing);
687 pe.pm_credentialschanged = credential_changing;
688 pe.pm_entryaddr = imgp->entry_addr;
689
690 PMC_CALL_HOOK_X(td, PMC_FN_PROCESS_EXEC, (void *) &pe);
686 } else
687 PROC_UNLOCK(p);
688#else /* !HWPMC_HOOKS */
689 PROC_UNLOCK(p);
690#endif
691
692 /* Set values passed into the program in registers. */
693 if (p->p_sysent->sv_setregs)

--- 596 unchanged lines hidden ---
691 } else
692 PROC_UNLOCK(p);
693#else /* !HWPMC_HOOKS */
694 PROC_UNLOCK(p);
695#endif
696
697 /* Set values passed into the program in registers. */
698 if (p->p_sysent->sv_setregs)

--- 596 unchanged lines hidden ---