summaryrefslogtreecommitdiffstats
path: root/sys/amd64/amd64/vm_machdep.c
diff options
context:
space:
mode:
authorbsd <bsd@FreeBSD.org>2000-02-20 20:51:23 +0000
committerbsd <bsd@FreeBSD.org>2000-02-20 20:51:23 +0000
commit85f1c223b39c92c49e8b7c6c7ad39d3e42a27574 (patch)
tree24b3d3119a30ef55034eb6483b006f39f272b986 /sys/amd64/amd64/vm_machdep.c
parent5e5e3ebba622666325b5191546c69ed7f00a5781 (diff)
downloadFreeBSD-src-85f1c223b39c92c49e8b7c6c7ad39d3e42a27574.zip
FreeBSD-src-85f1c223b39c92c49e8b7c6c7ad39d3e42a27574.tar.gz
Don't forget to reset the hardware debug registers when a process that
was using them exits. Don't allow a user process to cause the kernel to take a TRCTRAP on a user space address. Reviewed by: jlemon, sef Approved by: jkh
Diffstat (limited to 'sys/amd64/amd64/vm_machdep.c')
-rw-r--r--sys/amd64/amd64/vm_machdep.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c
index d7fa73b1..cdcc278 100644
--- a/sys/amd64/amd64/vm_machdep.c
+++ b/sys/amd64/amd64/vm_machdep.c
@@ -246,6 +246,13 @@ cpu_exit(p)
#ifdef USER_LDT
user_ldt_free(pcb);
#endif
+ if (pcb->pcb_flags & PCB_DBREGS) {
+ /*
+ * disable all hardware breakpoints
+ */
+ reset_dbregs();
+ pcb->pcb_flags &= ~PCB_DBREGS;
+ }
cnt.v_swtch++;
cpu_switch(p);
panic("cpu_exit");
OpenPOWER on IntegriCloud