diff options
author | 2014-07-08 22:30:26 +0000 | |
---|---|---|
committer | 2014-07-08 22:30:26 +0000 | |
commit | 24c4d37a6024423cc33bd0bd9db3ea9647126f8a (patch) | |
tree | e76dd4ec4e8c0615da552ab6bddf907e1a827654 | |
parent | mention X Window System announcement. (diff) | |
download | wireguard-openbsd-24c4d37a6024423cc33bd0bd9db3ea9647126f8a.tar.xz wireguard-openbsd-24c4d37a6024423cc33bd0bd9db3ea9647126f8a.zip |
also use inverted poison patterns, to mix things up. ok deraadt miod
-rw-r--r-- | sys/kern/subr_poison.c | 14 |
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 |