Module Name: src
Committed By: kamil
Date: Tue May 28 13:20:23 UTC 2019
Modified Files:
src/sys/arch/x86/x86: patch.c
Log Message:
Disable sanitizer instrumentation in x86_hotpatch()
Local variables have empty (0-sized), unknown alignment to UBSan.
This is hard to workaround without mutating the code too much.
To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/x86/x86/patch.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/x86/x86/patch.c
diff -u src/sys/arch/x86/x86/patch.c:1.35 src/sys/arch/x86/x86/patch.c:1.36
--- src/sys/arch/x86/x86/patch.c:1.35 Sat Jul 14 14:34:32 2018
+++ src/sys/arch/x86/x86/patch.c Tue May 28 13:20:23 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: patch.c,v 1.35 2018/07/14 14:34:32 maxv Exp $ */
+/* $NetBSD: patch.c,v 1.36 2019/05/28 13:20:23 kamil Exp $ */
/*-
* Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: patch.c,v 1.35 2018/07/14 14:34:32 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: patch.c,v 1.36 2019/05/28 13:20:23 kamil Exp $");
#include "opt_lockdebug.h"
#ifdef i386
@@ -132,6 +132,12 @@ patchbytes(void *addr, const uint8_t *by
}
}
+/* The local variables have unknown alignment to UBSan */
+#if defined(__clang__)
+__attribute__((no_sanitize("undefined")))
+#else
+__attribute__((no_sanitize_undefined))
+#endif
void
x86_hotpatch(uint32_t name, const uint8_t *bytes, size_t size)
{