summaryrefslogtreecommitdiff
path: root/server/RouteController.cpp
diff options
context:
space:
mode:
authorEvgenii Stepanov <eugenis@google.com>2016-02-11 16:55:56 -0800
committerJon Larimer <jlarimer@google.com>2016-04-06 20:18:01 -0400
commitf65122c81c824940ba93666d961c8d3fd76f3a9c (patch)
tree3dec11a93d8fe827897610996766d07b93afaeb5 /server/RouteController.cpp
parent31701a903560b165f8241d34b9d98c18b8aaad6a (diff)
Workaround ASan false positive in RouteController.
Bug: 27037723 Change-Id: I40e7f0d07652aeb6484de5f963a7698b6805d582 (cherry picked from commit dfde1d6c6c397e437adf937a1718784d9cb2c0cf)
Diffstat (limited to 'server/RouteController.cpp')
-rw-r--r--server/RouteController.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/server/RouteController.cpp b/server/RouteController.cpp
index b2cd93a2..e4b7cc1f 100644
--- a/server/RouteController.cpp
+++ b/server/RouteController.cpp
@@ -180,6 +180,15 @@ void updateTableNamesFile() {
// |iov| is an array of struct iovec that contains the netlink message payload.
// The netlink header is generated by this function based on |action| and |flags|.
// Returns -errno if there was an error or if the kernel reported an error.
+
+// Disable optimizations in ASan build.
+// ASan reports an out-of-bounds 32-bit(!) access in the first loop of the
+// function (over iov[]).
+#ifdef __clang__
+#if __has_feature(address_sanitizer)
+__attribute__((optnone))
+#endif
+#endif
WARN_UNUSED_RESULT int sendNetlinkRequest(uint16_t action, uint16_t flags, iovec* iov, int iovlen) {
nlmsghdr nlmsg = {
.nlmsg_type = action,