From patchwork Tue Apr 27 23:03:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gaetan Rivet X-Patchwork-Id: 1470898 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=u256.net header.i=@u256.net header.a=rsa-sha256 header.s=fm1 header.b=elbTmWL9; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm2 header.b=r3IUV87p; dkim-atps=neutral Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FVHPk31wzz9sX2 for ; Wed, 28 Apr 2021 09:03:54 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 4A43740670; Tue, 27 Apr 2021 23:03:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4cL0i14QrRLp; Tue, 27 Apr 2021 23:03:48 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp4.osuosl.org (Postfix) with ESMTP id 6A5EF40654; Tue, 27 Apr 2021 23:03:47 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 19B74C002A; Tue, 27 Apr 2021 23:03:46 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id C8259C0026 for ; Tue, 27 Apr 2021 23:03:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 9F163404DB for ; Tue, 27 Apr 2021 23:03:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp2.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=u256.net header.b="elbTmWL9"; dkim=pass (2048-bit key) header.d=messagingengine.com header.b="r3IUV87p" Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GphsU5ULwO1H for ; Tue, 27 Apr 2021 23:03:40 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by smtp2.osuosl.org (Postfix) with ESMTPS id 38791403EA for ; Tue, 27 Apr 2021 23:03:40 +0000 (UTC) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 8AF5AF2A for ; Tue, 27 Apr 2021 19:03:39 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 27 Apr 2021 19:03:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=u256.net; h=from :to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=fm1; bh=yQH7JP6AybdTnRonVs39ILJOOX SxqsuufmeRIjlKvc4=; b=elbTmWL9ICjbY0FIjI3gdStLDtOevxyvRXif8APRtM nayyYq9zL0YkJL92s6yOilxg3S29nuxXh1EU1YABK46JDyPUMYH9FhrqLHNf+aXn I7m6PSjFcqrv7wtexT2CwGiKHql+fDt6k1IR7LRneE9fPB0ZqBztm4o4uP1ISfSZ s0SmtqY4Y4p/H4HNrd/kutgifNrJ0eprZ23r1CSgrnr77DPeeNvO4DkOCY2TaCSz gHDUI+dxeIlV2hgtnZuj/jv6WOBM8V78eK1KA4C2UhXgRXWREtq58fLw79Bzo5IX NamZGnWMzG0hUHKLLKerqwwd+5jawW5hiPavFR+K1tiA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=yQH7JP6AybdTnRonVs39ILJOOXSxqsuufmeRIjlKvc4=; b=r3IUV87p RDxLwPDbqxEbwu9b/Pq1sH4iXO3JHPmVb6LClfnxoomU0IsW9k1XIQQPONRqoNTc KDLyn4zVEXmkVTKbbbc1jdPkoRbRHP3bLcuVWnZwXEev158TiyVkBLQWc8Ut1mQl 56T19YLYIaol0wnhREkeeKg29ex7czk90v/b3KgSBYn1qaG8BQjUWXqbfugR+UWc O5PVENHtqCFeOO7oyvpY41ttdSukWojyeua5LVH2JTuR1FtrW/rJi8wD9XsCWPoR MF8N0FS5o7pdhZr1K02KnJZNwM9v7ruPWhICbXe9fV9qNDz93NgJeF7kAJFCNGrU v2MPBSKFC3BzXQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvddvuddgudehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepifgrvghtrghnucftihhvvghtuceoghhrihhvvgesuhdvheei rdhnvghtqeenucggtffrrghtthgvrhhnpeduheekveehfedtueejjeeigeehvdfggefhte dugedutdefhfekhedugeetveeuhfenucffohhmrghinhepshhhsgdrtghinecukfhppeek iedrvdehgedrvdegfedrudegieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpehgrhhivhgvsehuvdehiedrnhgvth X-ME-Proxy: Received: from inocybe.home (lfbn-poi-1-930-146.w86-254.abo.wanadoo.fr [86.254.243.146]) by mail.messagingengine.com (Postfix) with ESMTPA for ; Tue, 27 Apr 2021 19:03:38 -0400 (EDT) From: Gaetan Rivet To: ovs-dev@openvswitch.org Date: Wed, 28 Apr 2021 01:03:25 +0200 Message-Id: X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Subject: [ovs-dev] [PATCH v1 1/8] configure: add --enable-asan option X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Add a configure option to enable ASAN in a simple way. Adding an AC variable to allow checking for support in the testsuite. Signed-off-by: Gaetan Rivet --- .ci/linux-build.sh | 4 ++-- NEWS | 1 + acinclude.m4 | 16 ++++++++++++++++ configure.ac | 1 + tests/atlocal.in | 1 + 5 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh index 977449350..3c58637b4 100755 --- a/.ci/linux-build.sh +++ b/.ci/linux-build.sh @@ -229,10 +229,10 @@ fi if [ "$ASAN" ]; then # This will override default option configured in tests/atlocal.in. export ASAN_OPTIONS='detect_leaks=1' + EXTRA_OPTS="$EXTRA_OPTS --enable-asan" # -O2 generates few false-positive memory leak reports in test-ovsdb # application, so lowering optimizations to -O1 here. - CLFAGS_ASAN="-O1 -fno-omit-frame-pointer -fno-common -fsanitize=address" - CFLAGS_FOR_OVS="${CFLAGS_FOR_OVS} ${CLFAGS_ASAN}" + CFLAGS_FOR_OVS="${CFLAGS_FOR_OVS} -O1" fi save_OPTS="${OPTS} $*" diff --git a/NEWS b/NEWS index 95cf922aa..57e1f041b 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,7 @@ Post-v2.15.0 * New option '--no-record-hostname' to disable hostname configuration in ovsdb on startup. * New command 'record-hostname-if-not-set' to update hostname in ovsdb. + - New --enable-asan configure option enables AddressSanitizer. v2.15.0 - 15 Feb 2021 diff --git a/acinclude.m4 b/acinclude.m4 index 15a54d636..615e7f962 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -58,6 +58,22 @@ AC_DEFUN([OVS_ENABLE_WERROR], fi AC_SUBST([SPARSE_WERROR])]) +dnl OVS_ENABLE_ASAN +AC_DEFUN([OVS_ENABLE_ASAN], + [AC_ARG_ENABLE( + [asan], + [AC_HELP_STRING([--enable-asan], + [Enable the Address Sanitizer])], + [ASAN_ENABLED=yes], [ASAN_ENABLED=no]) + AC_SUBST([ASAN_ENABLED]) + AC_CONFIG_COMMANDS_PRE([ + if test "$ASAN_ENABLED" = "yes"; then + OVS_CFLAGS="$OVS_CFLAGS -fno-omit-frame-pointer" + OVS_CFLAGS="$OVS_CFLAGS -fno-common -fsanitize=address" + fi + ]) + ]) + dnl OVS_CHECK_LINUX dnl dnl Configure linux kernel source tree diff --git a/configure.ac b/configure.ac index c077034d4..eec5a9d1b 100644 --- a/configure.ac +++ b/configure.ac @@ -182,6 +182,7 @@ OVS_CONDITIONAL_CC_OPTION([-Wno-unused-parameter], [HAVE_WNO_UNUSED_PARAMETER]) OVS_CONDITIONAL_CC_OPTION([-mavx512f], [HAVE_AVX512F]) OVS_CHECK_CC_OPTION([-mavx512f], [CFLAGS="$CFLAGS -DHAVE_AVX512F"]) OVS_ENABLE_WERROR +OVS_ENABLE_ASAN OVS_ENABLE_SPARSE OVS_CTAGS_IDENTIFIERS OVS_CHECK_DPCLS_AUTOVALIDATOR diff --git a/tests/atlocal.in b/tests/atlocal.in index cfca7e192..f61e752bf 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -220,6 +220,7 @@ export OVS_SYSLOG_METHOD OVS_CTL_TIMEOUT=30 export OVS_CTL_TIMEOUT +ASAN_ENABLED='@ASAN_ENABLED@' # Add some default flags to make the tests run better under Address # Sanitizer, if it was used for the build. #