aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2005-09-27 18:10:26 +0000
committerPeter Wemm <peter@FreeBSD.org>2005-09-27 18:10:26 +0000
commit458d22f30259508abcc97d1331ad091d5e70c523 (patch)
tree6cccaad7d1620ad5fe1791733869510c83045c68 /sys
parent7e9e371f2d9787ff777f1198dc92921000434359 (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/machdep.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index 3e0795269c42..5345dc1318e9 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -1726,11 +1726,15 @@ set_dbregs(struct thread *td, struct dbreg *dbregs)
* check for undefined settings. Setting these bit patterns
* result in undefined behaviour and can lead to an unexpected
* TRCTRAP or a general protection fault right here.
+ * Upper bits of dr6 and dr7 must not be set
*/
for (i = 0, mask1 = 0x3<<16, mask2 = 0x2<<16; i < 8;
i++, mask1 <<= 2, mask2 <<= 2)
if ((dbregs->dr[7] & mask1) == mask2)
return (EINVAL);
+ if ((dbregs->dr[6] & 0xffffffff00000000ul) != 0 ||
+ (dbregs->dr[7] & 0xffffffff00000000ul) != 0)
+ return (EINVAL);
pcb = td->td_pcb;