summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2014-07-08 22:30:27 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2014-07-08 22:30:27 +0000
commitc8f531c36565995ad1c89ffe27999c9661228d88 (patch)
tree1728153ac942df7906101cc4a169e52b29e3ae24
parentf3b47ee5cfbc62a268f8d3770f2549ae7f45c625 (diff)
also use inverted poison patterns, to mix things up. ok deraadt miod
-rw-r--r--sys/kern/subr_poison.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/kern/subr_poison.c b/sys/kern/subr_poison.c
index b2768e92d67..580406f60e2 100644
--- a/sys/kern/subr_poison.c
+++ b/sys/kern/subr_poison.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_poison.c,v 1.9 2014/07/08 17:42:50 miod Exp $ */
+/* $OpenBSD: subr_poison.c,v 1.10 2014/07/08 22:30:26 tedu Exp $ */
/*
* Copyright (c) 2013 Ted Unangst <tedu@openbsd.org>
*
@@ -44,7 +44,17 @@ poison_value(void *v)
l = l >> PAGE_SHIFT;
- return (l & 1) ? POISON0 : POISON1;
+ switch (l & 3) {
+ case 0:
+ return POISON0;
+ case 1:
+ return POISON1;
+ case 2:
+ return ~POISON0;
+ case 3:
+ return ~POISON1;
+ }
+ return 0;
}
void