diff options
author | tegge <tegge@FreeBSD.org> | 1998-05-19 00:00:14 +0000 |
---|---|---|
committer | tegge <tegge@FreeBSD.org> | 1998-05-19 00:00:14 +0000 |
commit | 9fdbafa2fe06cfff465241ce76c5395269982396 (patch) | |
tree | 3b482820bffff64041452ded3ad80246ff105eb3 /sys/kern/sys_process.c | |
parent | 34f4d24e56af87f75658e327d3046622ea4bc85d (diff) | |
download | FreeBSD-src-9fdbafa2fe06cfff465241ce76c5395269982396.zip FreeBSD-src-9fdbafa2fe06cfff465241ce76c5395269982396.tar.gz |
Disallow reading the current kernel stack. Only the user structure and
the current registers should be accessible.
Reviewed by: David Greenman <dg@root.com>
Diffstat (limited to 'sys/kern/sys_process.c')
-rw-r--r-- | sys/kern/sys_process.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index fcfbb7c..8231b23 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: sys_process.c,v 1.35 1998/02/04 22:32:36 eivind Exp $ + * $Id: sys_process.c,v 1.36 1998/02/06 12:13:27 eivind Exp $ */ #include <sys/param.h> @@ -409,6 +409,11 @@ ptrace(curp, uap) if ((u_int)uap->addr > (UPAGES * PAGE_SIZE - sizeof(int))) { return EFAULT; } + if (ptrace_read_u_check(p,(vm_offset_t) uap->addr, + sizeof(int)) && + !procfs_kmemaccess(curp)) { + return EFAULT; + } error = 0; PHOLD(p); /* user had damn well better be incore! */ if (p->p_flag & P_INMEM) { |