git: 4e8e26a00471 - main - redzone: Raise a compile error if KASAN is configured
Mark Johnston
markj at FreeBSD.org
Fri Jul 23 14:50:00 UTC 2021
The branch main has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=4e8e26a00471f1a5e7a2af322265c45b1529c5b8
commit 4e8e26a00471f1a5e7a2af322265c45b1529c5b8
Author: Mark Johnston <markj at FreeBSD.org>
AuthorDate: 2021-07-23 14:30:29 +0000
Commit: Mark Johnston <markj at FreeBSD.org>
CommitDate: 2021-07-23 14:47:13 +0000
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
---
sys/vm/redzone.c | 4 ++++
1 file changed, 4 insertions(+)
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;
More information about the dev-commits-src-all
mailing list