diff options
author | rstone <rstone@FreeBSD.org> | 2011-11-07 01:55:58 +0000 |
---|---|---|
committer | rstone <rstone@FreeBSD.org> | 2011-11-07 01:55:58 +0000 |
commit | 6ab77084d31aa44617b2a735b5684d49fc66f5e5 (patch) | |
tree | 008313658ffd305c84aa254cbd04ce55be8f3a52 /sys/cddl | |
parent | 7513eaddcff8899b95b14f2389e55c550a66db93 (diff) | |
download | FreeBSD-src-6ab77084d31aa44617b2a735b5684d49fc66f5e5.zip FreeBSD-src-6ab77084d31aa44617b2a735b5684d49fc66f5e5.tar.gz |
Replace fasttrap_copyout() with uwrite(). FreeBSD copyout() is not able to
write to the .text section of a process.
Obtained from: rpaulo
MFC after: 3 days
Diffstat (limited to 'sys/cddl')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c b/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c index 85d9649..d0db808 100644 --- a/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c +++ b/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c @@ -97,7 +97,7 @@ uwrite(proc_t *p, void *kaddr, size_t len, uintptr_t uaddr) return (proc_ops(UIO_WRITE, p, kaddr, uaddr, len)); } -#endif +#endif /* sun */ #ifdef __i386__ #define r_rax r_eax #define r_rbx r_ebx @@ -1380,6 +1380,7 @@ fasttrap_pid_probe(struct reg *rp) { int ret = 0; uintptr_t addr = 0; + #ifdef __amd64 if (p->p_model == DATAMODEL_NATIVE) { addr = rp->r_rsp - sizeof (uintptr_t); @@ -1558,7 +1559,7 @@ fasttrap_pid_probe(struct reg *rp) * ------------------------ ----- * a: <original instruction> <= 15 * jmp <pc + tp->ftt_size> 5 - * b: <original instrction> <= 15 + * b: <original instruction> <= 15 * int T_DTRACE_RET 2 * ----- * <= 37 @@ -1731,12 +1732,16 @@ fasttrap_pid_probe(struct reg *rp) ASSERT(i <= sizeof (scratch)); + +#if defined(sun) if (fasttrap_copyout(scratch, (char *)addr, i)) { +#else + if (uwrite(curproc, scratch, i, addr)) { +#endif fasttrap_sigtrap(p, curthread, pc); new_pc = pc; break; } - if (tp->ftt_retids != NULL) { curthread->t_dtrace_step = 1; curthread->t_dtrace_ret = 1; |