From patchwork Thu Sep 9 10:49:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marco Elver X-Patchwork-Id: 12482901 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-26.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81E98C433F5 for ; Thu, 9 Sep 2021 10:49:40 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F1F0A60F4A for ; Thu, 9 Sep 2021 10:49:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org F1F0A60F4A Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 6A8736B0071; Thu, 9 Sep 2021 06:49:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 65951900002; Thu, 9 Sep 2021 06:49:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 547736B0073; Thu, 9 Sep 2021 06:49:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 429936B0071 for ; Thu, 9 Sep 2021 06:49:39 -0400 (EDT) Received: from smtpin39.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id ED7082CFE8 for ; Thu, 9 Sep 2021 10:49:38 +0000 (UTC) X-FDA: 78567714036.39.217EEC7 Received: from mail-wm1-f74.google.com (mail-wm1-f74.google.com [209.85.128.74]) by imf20.hostedemail.com (Postfix) with ESMTP id AF26FD0000A7 for ; Thu, 9 Sep 2021 10:49:38 +0000 (UTC) Received: by mail-wm1-f74.google.com with SMTP id f17-20020a05600c155100b002f05f30ff03so695052wmg.3 for ; Thu, 09 Sep 2021 03:49:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc; bh=JKG2Csw+REpqX6pYLoajkSbStNWY+2P13qnXNLcGPTo=; b=oVBgZSF0f7gZb8HxrZbIdXzorsMl6/30hQtezrkGiG8Mjm7GMEenEEeX5JUiCbYIgx Doy4WrNjWdwiqs8RasWNSvfZMqCqnH3qDP5QY3UwDBgMIVon3xP9XEhsjAd1s9G2oe3x RiqzigUTJHbCf4sZNRHKAS30r6yHw0KBwy5YQPG1DjBL3/6mFcF5IBV5cgzgfseyw+lr N53YN3j9A/2jMxFze4B4nunFb0XIP42E5YN4mAKc7Ck8rGjvakkPbQCWqASi8Y3uDwYC thMRP3jA2e6aXbyMrjruuJeGvI7gZjIhXqKuZKJDaRFVke0PxsNbBzmW77HK7kksfQ58 J8nQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=JKG2Csw+REpqX6pYLoajkSbStNWY+2P13qnXNLcGPTo=; b=CaQ4UPuneJ6AOPajaDXAt4tFV5OaMh6B3W43NdpNoMIZAZWm4j3xfalD8W6WrjzvS8 MkdgQ+o6cRlLSm3mUpttcXFuOtgbQi9Ec9f/e1FO87UEDwxWdYbEImNHVJqcIJi49ytm idFsQD0b7fIdVxFHSGIOclP3+iV65Bip8oESBF1Ob6vFB5Zbk/qQqtwoY+6rEpMM+cmV CdrWdjIkLohLF5UWUv1AQAuy70aX/wNZhRhxIwikFKQBvNSpYBF4QPGaoAxJI2gu9nsO Rgmu7mbWqceReatozEwARObT4XDzXArTDGCo/dRkzFRxUPC9jteKcg6GgmWRKUzusVho Nl7g== X-Gm-Message-State: AOAM530sJVOe8X0g1ScZ1cNCs8awaqQcxNOO7ZZkwz5Sy5v7qe3pJcB6 fEdiWNubxJW6y88X+9uIigzxaKPRrA== X-Google-Smtp-Source: ABdhPJzkOAvHKQVqCuqxsCtyM6C/PyG02n+39nThS1IWFPChq3RDEGCJm3IbSKaPCz97WE1D6JAp5UuEWQ== X-Received: from elver.muc.corp.google.com ([2a00:79e0:15:13:98f9:2b1c:26b6:bc81]) (user=elver job=sendgmr) by 2002:a05:600c:b4e:: with SMTP id k14mr2206453wmr.151.1631184577256; Thu, 09 Sep 2021 03:49:37 -0700 (PDT) Date: Thu, 9 Sep 2021 12:49:25 +0200 Message-Id: <20210909104925.809674-1-elver@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.33.0.153.gba50c8fa24-goog Subject: [PATCH] kasan: double -Wframe-larger-than threshold if KASAN From: Marco Elver To: elver@google.com, Andrew Morton Cc: linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, Arnd Bergmann , Christoph Hellwig , Guenter Roeck , Nathan Chancellor , Nick Desaulniers , Aleksandr Nogikh , Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , Taras Madan , linux-mm@kvack.org, llvm@lists.linux.dev X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: AF26FD0000A7 X-Stat-Signature: zuad7yd5tct8mj4egwdbteqp1ze6uuhu Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=oVBgZSF0; spf=pass (imf20.hostedemail.com: domain of 3weY5YQUKCIYov5o1qyyqvo.mywvsx47-wwu5kmu.y1q@flex--elver.bounces.google.com designates 209.85.128.74 as permitted sender) smtp.mailfrom=3weY5YQUKCIYov5o1qyyqvo.mywvsx47-wwu5kmu.y1q@flex--elver.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com X-HE-Tag: 1631184578-835645 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: All architectures at least double stack size when using one of the KASAN software modes that rely on compiler instrumentation. Until now, warnings emitted by -Wframe-larger-than could easily be ignored, as we would still get a working kernel. However, with the introduction of -Werror (CONFIG_WERROR=y), it makes sense to at least double the -Wframe-larger-than threshold for software-based KASAN modes to reflect the already increased stack sizes when building a kernel with KASAN enabled. Link: https://lkml.kernel.org/r/YTbOs13waorzamZ6@Ryzen-9-3900X.localdomain Signed-off-by: Marco Elver --- lib/Kconfig.debug | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index ed4a31e34098..2055bbb6724a 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -345,6 +345,8 @@ endif # DEBUG_INFO config FRAME_WARN int "Warn for stack frames larger than" range 0 8192 + default 4096 if 64BIT && (KASAN_GENERIC || KASAN_SW_TAGS) + default 2048 if !64BIT && (KASAN_GENERIC || KASAN_SW_TAGS) default 2048 if GCC_PLUGIN_LATENT_ENTROPY default 1536 if (!64BIT && PARISC) default 1024 if (!64BIT && !PARISC)