From patchwork Wed Sep 29 21:27:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brendan Higgins X-Patchwork-Id: 12537953 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87001C4332F for ; Wed, 29 Sep 2021 21:27:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7368761528 for ; Wed, 29 Sep 2021 21:27:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346958AbhI2V3G (ORCPT ); Wed, 29 Sep 2021 17:29:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346927AbhI2V3D (ORCPT ); Wed, 29 Sep 2021 17:29:03 -0400 Received: from mail-qv1-xf4a.google.com (mail-qv1-xf4a.google.com [IPv6:2607:f8b0:4864:20::f4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B0CBC061768 for ; Wed, 29 Sep 2021 14:27:22 -0700 (PDT) Received: by mail-qv1-xf4a.google.com with SMTP id k20-20020a05621414f400b003824ecf0127so9383337qvw.0 for ; Wed, 29 Sep 2021 14:27:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=GBgRPmylRP0XaI5E/LihaXT2Ir7X1xpw3ZInKRc4R50=; b=WHFQA+g25qkYPYFpep7vNNJTNwmmqsk9uHkMIXOXNnU9O5BPIQRfnn5cf/mGs1NaL+ ogKT12Uh8k7K5urhYrNFdvA4MuqXpUSda3nB7WGcM7+TmYrb/KYXzXGlDr9DjrUV16I0 rHwXYiunO8+vv1D/AhHbPY96DW0Dfw4rFl3WW3/Ie+sLyrSpeG+6nYS6+7KwC3QaTDAy kvG8F8Pay8skbykgIct0kmcVyTHUENlCleH7rnpjrTRQd1yF+nB+oZnvHiXisnyqj5hF B7JP6NY+hXsfKoG5gBkQZLzz+ZbQt1dS3slr7Wa8EFv5hkH1pcrphEZcixGC7BD/sLiC 7jgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=GBgRPmylRP0XaI5E/LihaXT2Ir7X1xpw3ZInKRc4R50=; b=tHarZfBU8aIMMKgPeLrnKANByKrLpVhWWfocXOEV7HGxmx3NEd2MtGN2U6NdLOhbSR RPp6QQAz/0LvrEWuCW+i4F7ax4DxuBrPVpBe21vRDVWNjpBUBxaGl7W6lXfRkIBQhE8P jvRrRd4XjRlNkcRs5q+tYDOUlfmL4nUHqRRkUyCYo3g/PZ76kh9uBZ9b0BMt2j4r4TH+ KvG69o/6tqkt7Q81VGFgasiBWB05aC636d/JSMzBLkqB6LM3bD0N645wQRXsARyHvEAd o4aHblt+Qxt+sc028D5ufnnfqHvFPee1I9WUKqxWKAKw7ODMlWcFioZ74u+6ra8U8yxZ QywQ== X-Gm-Message-State: AOAM532VsODh3GQzpJaT4++5IsXKNyrcxfafJob2jaT4pi8xW7VAnAbm /nDzYoJLvhCJheCatR7lDgTYogNzwcNPmNBaGW8iUg== X-Google-Smtp-Source: ABdhPJyf4SNenqCX/qG/XKTasyzdp9ORUzCCpdL0aIBEMr9txfgQG0Tiw87AG132HGgvqre40Hvbdjn6vQZh3WqzsjyZdQ== X-Received: from mactruck.svl.corp.google.com ([2620:15c:2cb:201:83f4:ff43:90d6:efd3]) (user=brendanhiggins job=sendgmr) by 2002:a05:6214:362:: with SMTP id t2mr642333qvu.64.1632950841307; Wed, 29 Sep 2021 14:27:21 -0700 (PDT) Date: Wed, 29 Sep 2021 14:27:09 -0700 In-Reply-To: <20210929212713.1213476-1-brendanhiggins@google.com> Message-Id: <20210929212713.1213476-2-brendanhiggins@google.com> Mime-Version: 1.0 References: <20210929212713.1213476-1-brendanhiggins@google.com> X-Mailer: git-send-email 2.33.0.685.g46640cef36-goog Subject: [PATCH v2 1/5] gcc-plugins/structleak: add makefile var for disabling structleak From: Brendan Higgins To: shuah@kernel.org, davidgow@google.com, arnd@arndb.de, keescook@chromium.org, rafael@kernel.org, jic23@kernel.org, lars@metafoo.de, ulf.hansson@linaro.org, andreas.noever@gmail.com, michael.jamet@intel.com, mika.westerberg@linux.intel.com, YehezkelShB@gmail.com, masahiroy@kernel.org, michal.lkml@markovi.net, ndesaulniers@google.com Cc: linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, gregkh@linuxfoundation.org, linux-iio@vger.kernel.org, linux-mmc@vger.kernel.org, linux-usb@vger.kernel.org, linux-hardening@vger.kernel.org, linux-kbuild@vger.kernel.org, Brendan Higgins Precedence: bulk List-ID: X-Mailing-List: linux-hardening@vger.kernel.org KUnit and structleak don't play nice, so add a makefile variable for enabling structleak when it complains. Co-developed-by: Kees Cook Signed-off-by: Kees Cook Signed-off-by: Brendan Higgins Reviewed-by: David Gow --- Changes since last revision: - None --- scripts/Makefile.gcc-plugins | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/Makefile.gcc-plugins b/scripts/Makefile.gcc-plugins index 952e46876329a..4aad284800355 100644 --- a/scripts/Makefile.gcc-plugins +++ b/scripts/Makefile.gcc-plugins @@ -19,6 +19,10 @@ gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF) \ += -fplugin-arg-structleak_plugin-byref gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL) \ += -fplugin-arg-structleak_plugin-byref-all +ifdef CONFIG_GCC_PLUGIN_STRUCTLEAK + DISABLE_STRUCTLEAK_PLUGIN += -fplugin-arg-structleak_plugin-disable +endif +export DISABLE_STRUCTLEAK_PLUGIN gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK) \ += -DSTRUCTLEAK_PLUGIN