aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2021-07-23 14:30:29 +0000
committerMark Johnston <markj@FreeBSD.org>2021-07-23 14:47:13 +0000
commit4e8e26a00471f1a5e7a2af322265c45b1529c5b8 (patch)
tree33da29880c4c43c4bfcda7684737db5be8a79fa6 /sys
parentf95e683fa231fd1bed5cc10f52db0629a687ac3d (diff)
downloadsrc-4e8e26a00471f1a5e7a2af322265c45b1529c5b8.tar.gz
src-4e8e26a00471f1a5e7a2af322265c45b1529c5b8.zip
redzone: Raise a compile error if KASAN is configured
redzone(9) does some munging of the allocation to insert redzones before and after a valid memory buffer, but KASAN does not know about this and will raise false positives if both are configured. Until this is fixed, do not allow both to be configured. Note that KASAN provides similar checking on its own but currently does not force the creation of redzones for all UMA allocations; this should be addressed as well. Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sys')
-rw-r--r--sys/vm/redzone.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/vm/redzone.c b/sys/vm/redzone.c
index affaa5008a22..88e36c41b928 100644
--- a/sys/vm/redzone.c
+++ b/sys/vm/redzone.c
@@ -37,6 +37,10 @@ __FBSDID("$FreeBSD$");
#include <vm/redzone.h>
+#ifdef KASAN
+#error KASAN and DEBUG_REDZONE cannot be configured together
+#endif
+
static SYSCTL_NODE(_vm, OID_AUTO, redzone, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL,
"RedZone data");
static u_long redzone_extra_mem = 0;