kern_procctl.c (184667) | kern_procctl.c (189282) |
---|---|
1/*- 2 * Copyright (c) 1994, Sean Eric Fagan 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 --- 16 unchanged lines hidden (view full) --- 25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 * SUCH DAMAGE. 30 */ 31 32#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1994, Sean Eric Fagan 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 --- 16 unchanged lines hidden (view full) --- 25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 * SUCH DAMAGE. 30 */ 31 32#include <sys/cdefs.h> |
33__FBSDID("$FreeBSD: head/sys/kern/sys_process.c 184667 2008-11-05 03:01:23Z davidxu $"); | 33__FBSDID("$FreeBSD: head/sys/kern/sys_process.c 189282 2009-03-02 18:43:50Z kib $"); |
34 35#include "opt_compat.h" 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/lock.h> 40#include <sys/mutex.h> 41#include <sys/syscallsubr.h> | 34 35#include "opt_compat.h" 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/lock.h> 40#include <sys/mutex.h> 41#include <sys/syscallsubr.h> |
42#include <sys/sysent.h> |
|
42#include <sys/sysproto.h> 43#include <sys/proc.h> 44#include <sys/vnode.h> 45#include <sys/ptrace.h> 46#include <sys/sx.h> 47#include <sys/malloc.h> 48#include <sys/signalvar.h> 49 --- 9 unchanged lines hidden (view full) --- 59#include <vm/vm_object.h> 60#include <vm/vm_page.h> 61 62#ifdef COMPAT_IA32 63#include <sys/procfs.h> 64#include <machine/fpu.h> 65#include <compat/ia32/ia32_reg.h> 66 | 43#include <sys/sysproto.h> 44#include <sys/proc.h> 45#include <sys/vnode.h> 46#include <sys/ptrace.h> 47#include <sys/sx.h> 48#include <sys/malloc.h> 49#include <sys/signalvar.h> 50 --- 9 unchanged lines hidden (view full) --- 60#include <vm/vm_object.h> 61#include <vm/vm_page.h> 62 63#ifdef COMPAT_IA32 64#include <sys/procfs.h> 65#include <machine/fpu.h> 66#include <compat/ia32/ia32_reg.h> 67 |
67extern struct sysentvec ia32_freebsd_sysvec; 68 | |
69struct ptrace_io_desc32 { 70 int piod_op; 71 u_int32_t piod_offs; 72 u_int32_t piod_addr; 73 u_int32_t piod_len; 74}; 75#endif 76 --- 312 unchanged lines hidden (view full) --- 389 struct ptrace_io_desc32 piod32; 390#endif 391 } r; 392 void *addr; 393 int error = 0; 394#ifdef COMPAT_IA32 395 int wrap32 = 0; 396 | 68struct ptrace_io_desc32 { 69 int piod_op; 70 u_int32_t piod_offs; 71 u_int32_t piod_addr; 72 u_int32_t piod_len; 73}; 74#endif 75 --- 312 unchanged lines hidden (view full) --- 388 struct ptrace_io_desc32 piod32; 389#endif 390 } r; 391 void *addr; 392 int error = 0; 393#ifdef COMPAT_IA32 394 int wrap32 = 0; 395 |
397 if (td->td_proc->p_sysent == &ia32_freebsd_sysvec) | 396 if (SV_CURPROC_FLAG(SV_ILP32)) |
398 wrap32 = 1; 399#endif 400 AUDIT_ARG(pid, uap->pid); 401 AUDIT_ARG(cmd, uap->req); 402 AUDIT_ARG(addr, uap->addr); 403 AUDIT_ARG(value, uap->data); 404 addr = &r; 405 switch (uap->req) { --- 170 unchanged lines hidden (view full) --- 576 tid = td2->td_tid; 577 } 578 579#ifdef COMPAT_IA32 580 /* 581 * Test if we're a 32 bit client and what the target is. 582 * Set the wrap controls accordingly. 583 */ | 397 wrap32 = 1; 398#endif 399 AUDIT_ARG(pid, uap->pid); 400 AUDIT_ARG(cmd, uap->req); 401 AUDIT_ARG(addr, uap->addr); 402 AUDIT_ARG(value, uap->data); 403 addr = &r; 404 switch (uap->req) { --- 170 unchanged lines hidden (view full) --- 575 tid = td2->td_tid; 576 } 577 578#ifdef COMPAT_IA32 579 /* 580 * Test if we're a 32 bit client and what the target is. 581 * Set the wrap controls accordingly. 582 */ |
584 if (td->td_proc->p_sysent == &ia32_freebsd_sysvec) { 585 if (td2->td_proc->p_sysent == &ia32_freebsd_sysvec) | 583 if (SV_CURPROC_FLAG(SV_ILP32)) { 584 if (td2->td_proc->p_sysent->sv_flags & SV_ILP32) |
586 safe = 1; 587 wrap32 = 1; 588 } 589#endif 590 /* 591 * Permissions check 592 */ 593 switch (req) { --- 416 unchanged lines hidden --- | 585 safe = 1; 586 wrap32 = 1; 587 } 588#endif 589 /* 590 * Permissions check 591 */ 592 switch (req) { --- 416 unchanged lines hidden --- |