diff options
author | peter <peter@FreeBSD.org> | 2001-08-08 05:25:15 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2001-08-08 05:25:15 +0000 |
commit | bb5c43c4b860ad46968f5c811e6a704114915724 (patch) | |
tree | 9c1725fe17f3d99c873d801333a60db6ec49fb59 /sys/pc98 | |
parent | 185e591533d493e9aa5e937d42e40833936ae6f4 (diff) | |
download | FreeBSD-src-bb5c43c4b860ad46968f5c811e6a704114915724.zip FreeBSD-src-bb5c43c4b860ad46968f5c811e6a704114915724.tar.gz |
Zap 'ptrace(PT_READ_U, ...)' and 'ptrace(PT_WRITE_U, ...)' since they
are a really nasty interface that should have been killed long ago
when 'ptrace(PT_[SG]ETREGS' etc came along. The entity that they
operate on (struct user) will not be around much longer since it
is part-per-process and part-per-thread in a post-KSE world.
gdb does not actually use this except for the obscure 'info udot'
command which does a hexdump of as much of the child's 'struct user'
as it can get. It carries its own #defines so it doesn't break
compiles.
Diffstat (limited to 'sys/pc98')
-rw-r--r-- | sys/pc98/i386/machdep.c | 54 | ||||
-rw-r--r-- | sys/pc98/pc98/machdep.c | 54 |
2 files changed, 0 insertions, 108 deletions
diff --git a/sys/pc98/i386/machdep.c b/sys/pc98/i386/machdep.c index 86b6db2..48eef49 100644 --- a/sys/pc98/i386/machdep.c +++ b/sys/pc98/i386/machdep.c @@ -2118,60 +2118,6 @@ ptrace_single_step(p) return (0); } -int ptrace_read_u_check(p, addr, len) - struct proc *p; - vm_offset_t addr; - size_t len; -{ - vm_offset_t gap; - - if ((vm_offset_t) (addr + len) < addr) - return EPERM; - if ((vm_offset_t) (addr + len) <= sizeof(struct user)) - return 0; - - gap = (char *) p->p_frame - (char *) p->p_addr; - - if ((vm_offset_t) addr < gap) - return EPERM; - if ((vm_offset_t) (addr + len) <= - (vm_offset_t) (gap + sizeof(struct trapframe))) - return 0; - return EPERM; -} - -int ptrace_write_u(p, off, data) - struct proc *p; - vm_offset_t off; - long data; -{ - struct trapframe frame_copy; - vm_offset_t min; - struct trapframe *tp; - - /* - * Privileged kernel state is scattered all over the user area. - * Only allow write access to parts of regs and to fpregs. - */ - min = (char *)p->p_frame - (char *)p->p_addr; - if (off >= min && off <= min + sizeof(struct trapframe) - sizeof(int)) { - tp = p->p_frame; - frame_copy = *tp; - *(int *)((char *)&frame_copy + (off - min)) = data; - if (!EFL_SECURE(frame_copy.tf_eflags, tp->tf_eflags) || - !CS_SECURE(frame_copy.tf_cs)) - return (EINVAL); - *(int*)((char *)p->p_addr + off) = data; - return (0); - } - min = offsetof(struct user, u_pcb) + offsetof(struct pcb, pcb_save); - if (off >= min && off <= min + sizeof(union savefpu) - sizeof(int)) { - *(int*)((char *)p->p_addr + off) = data; - return (0); - } - return (EFAULT); -} - int fill_regs(p, regs) struct proc *p; diff --git a/sys/pc98/pc98/machdep.c b/sys/pc98/pc98/machdep.c index 86b6db2..48eef49 100644 --- a/sys/pc98/pc98/machdep.c +++ b/sys/pc98/pc98/machdep.c @@ -2118,60 +2118,6 @@ ptrace_single_step(p) return (0); } -int ptrace_read_u_check(p, addr, len) - struct proc *p; - vm_offset_t addr; - size_t len; -{ - vm_offset_t gap; - - if ((vm_offset_t) (addr + len) < addr) - return EPERM; - if ((vm_offset_t) (addr + len) <= sizeof(struct user)) - return 0; - - gap = (char *) p->p_frame - (char *) p->p_addr; - - if ((vm_offset_t) addr < gap) - return EPERM; - if ((vm_offset_t) (addr + len) <= - (vm_offset_t) (gap + sizeof(struct trapframe))) - return 0; - return EPERM; -} - -int ptrace_write_u(p, off, data) - struct proc *p; - vm_offset_t off; - long data; -{ - struct trapframe frame_copy; - vm_offset_t min; - struct trapframe *tp; - - /* - * Privileged kernel state is scattered all over the user area. - * Only allow write access to parts of regs and to fpregs. - */ - min = (char *)p->p_frame - (char *)p->p_addr; - if (off >= min && off <= min + sizeof(struct trapframe) - sizeof(int)) { - tp = p->p_frame; - frame_copy = *tp; - *(int *)((char *)&frame_copy + (off - min)) = data; - if (!EFL_SECURE(frame_copy.tf_eflags, tp->tf_eflags) || - !CS_SECURE(frame_copy.tf_cs)) - return (EINVAL); - *(int*)((char *)p->p_addr + off) = data; - return (0); - } - min = offsetof(struct user, u_pcb) + offsetof(struct pcb, pcb_save); - if (off >= min && off <= min + sizeof(union savefpu) - sizeof(int)) { - *(int*)((char *)p->p_addr + off) = data; - return (0); - } - return (EFAULT); -} - int fill_regs(p, regs) struct proc *p; |