Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp444803imm; Fri, 21 Sep 2018 02:56:02 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYxbcCxKDzdV6bYUJ3EGaXXNJIEGqHJspwJzFqKJ73yanBOpmWtdmUkshFtMJO8tYj6lqqy X-Received: by 2002:a62:6948:: with SMTP id e69-v6mr45506588pfc.166.1537523762087; Fri, 21 Sep 2018 02:56:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537523762; cv=none; d=google.com; s=arc-20160816; b=rnoVVGC5lllBsNthHyv7JB8MDQlcnbOv6nfHxMNnODVOrdlIRaUWr/+O0qPp47nYgQ HZaGltQrn7kWR3Wxu9vajPmVfyPEMdYXbhH8MOA5zi9rKyLpDvirOxlKtKaCJXUHTIPK AN6zC/pT63/+pgy+8VQlahSJT+kid3D1EZPzjWlJThCmPaTkra6ETKh2S+VlyWucntAM EK+zCsNhzlIdMy0rdOBLO38bLdxxyjWcsJwA0u+ZFLoilLPbFJ8Nudq28biPvAmqO99c B9yuvzxYmdrr/BaNryxJVcaDszgfn8/J89XabKLps7tuZxRPcmmjm9tMvqeOKyu6HTsg i7hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=a9guB2UTD52C96OBaJsMuP5b9WKxupKoHmvi6wmWUYo=; b=wJCVhrndhmx0eDEvyr/VS6miGvTGtb9N7E1/WhgRhDrWBQ3Ja9k1OCiZ/AHD/XxIbv o3u0Du0dAAqAbC3UHmOQ5urFabbtNHrvJHRh6JPM4s/iM/YgzT1DKWXaWT6IOvaxGiby JHm8YugFVM2UL3tNa/lfm/MeIdxGsq4m7QWOYDL9041smHl7Fg/ZzCgZB8JU/siI4k2/ wy42sUUU9j6WaVHYvCf4ceu9AyEBQBz7kaGgORDcvBg3q49OCQAYT2uFoEvi+rk/vZ3J aL90EcMXPCfpZ+hqP21+/PxI/fxkKhWYgbNAFilj9wAUW49HSeqXptpkf9jhylBCOvOw NYSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RxBfDIfo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u20-v6si26441038plq.210.2018.09.21.02.55.44; Fri, 21 Sep 2018 02:56:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RxBfDIfo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389600AbeIUPn0 (ORCPT + 99 others); Fri, 21 Sep 2018 11:43:26 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:55413 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726479AbeIUPn0 (ORCPT ); Fri, 21 Sep 2018 11:43:26 -0400 Received: by mail-wm1-f67.google.com with SMTP id f21-v6so2384506wmc.5 for ; Fri, 21 Sep 2018 02:55:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=a9guB2UTD52C96OBaJsMuP5b9WKxupKoHmvi6wmWUYo=; b=RxBfDIfolVJVRJAjSQH1iDPfMssBJWhPG/6snGhLq48kaD3gfpalWFNoO07RtHAIN0 jCJjsSsGQ+cb1lRkXfRHXXghUAFgCfpSe4Xr6p/mZa37p84fa+kjXUtEuVjMHSWEYVA4 gPw6jtCXwZFeEOYfCeTePWJ7WqUDC6DAgGSuHCIhvmwq64uJqFLd4rwr2VU49PmtUW+K 9S45e8FdmJvVsAc30m4HHmVLRdIeXn9gXdgLiPEz0LvfGGubQY81TttOJW4Sk7YBnuTn IFliAGxPQAGQ35mjPI82EX5OMVYfgqKAGIrqYz3LGigPdVvgJSwysj1fOj2AVLCTFR6n yFkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=a9guB2UTD52C96OBaJsMuP5b9WKxupKoHmvi6wmWUYo=; b=f3zHjabBpJQkm2SbWdl1uSSqnkFJsUmhgcILeEO7KZKRlJODPRSYC4hM39Y8xMB2oe ozRewNPeuHmLKrKXHZTnFF9jhr61J76eQOsMBsYVTwBIS8woDtiMVD0AhI5ecyxPWSzk vrd53zlAw1Ng8VILvJa9DNQtQ7NUkFsJ0awssrvXr6ODWqllx5BASM26JfY+++2Po+aS UUxOfj/wGbzqj6t4/4Z1fHwllFLf+qsjbqhy8LHZjwPD+PF/q6DprEChhLhYxRZ/42TO 6ZqIeEpCal2NEcgrfUutnJCo0lwOF8IekBgl99tL6edmGJil9DN2gbUdBsWtt0iDdstN oPcw== X-Gm-Message-State: APzg51APO44Jf0XTe+JnGEmqnhDUo38IhkTDpGTrJF0di2igC+rCG1uw 7xKNYjjk8+6Ukw5cIW/ZOlk= X-Received: by 2002:a1c:8406:: with SMTP id g6-v6mr6082548wmd.18.1537523719195; Fri, 21 Sep 2018 02:55:19 -0700 (PDT) Received: from flashbox ([2a01:4f8:10b:24a5::2]) by smtp.gmail.com with ESMTPSA id j75-v6sm7485506wmj.8.2018.09.21.02.55.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 21 Sep 2018 02:55:18 -0700 (PDT) Date: Fri, 21 Sep 2018 02:55:16 -0700 From: Nathan Chancellor To: Dmitry Vyukov Cc: Andrey Ryabinin , Andy Lutomirski , "Jason A. Donenfeld" , Alexander Potapenko , Arnd Bergmann , Ard Biesheuvel , LKML , Nick Desaulniers Subject: Re: [PATCH] framewarn: expand KASAN_EXTRA exception to KASAN Message-ID: <20180921095516.GA17326@flashbox> References: <20180921001513.12504-1-Jason@zx2c4.com> <5b94d2f4-eb4a-e00e-5fdf-7f770c26f0da@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 21, 2018 at 11:45:07AM +0200, Dmitry Vyukov wrote: > On Fri, Sep 21, 2018 at 11:25 AM, Andrey Ryabinin > wrote: > > On 09/21/2018 04:50 AM, Andy Lutomirski wrote: > >> This patch seems reasonable, but you emailed the wrong people :) > >> > >> On Thu, Sep 20, 2018 at 5:15 PM Jason A. Donenfeld wrote: > >>> > >>> It turns out that KASAN in general will bloat stack frames in unexpected > >>> ways, not just KASAN_EXTRA. So, this patch trivially changes that > >>> default to be associated with KASAN instead of KASAN_EXTRA. > >>> > > > > KASAN_EXTRA bloats stack more than just KASAN, that's why the limit is higher than just for KASAN. > > If want more details, tead the changelog from commit e7c52b84fb18f08ce49b6067ae6285aca79084a8 > > > > If anything causes "stack frame > 2048" warning for KASAN we should at least try to fix it, > > I mean reduce stack usage. > > > +Nick who is also hitting these warnings on clang/arm64 build. As far > as I understand the situation there is much worse. > > I would be good to understand/fix the worst offenders. But the stack > size increase with KASAN is a real, inherent thing. So if we live very > close the edge, we can get people using different compilers and/or > versions of compilers constantly breaking each other. And clang hits > this warnings in lots of places today just because the current code > was tailored to gcc over long period, i.e. allowing more locals where > gcc happened to handle that better and having fewer locals where gcc > happened to handle it worse. But for another compiler all these > assumptions are significantly perturbed. > > Nick, do you know what frame size limit eliminates the bulk of > warnings on clang? Is 3072 a reasonable limit allowing to fix the > remaining outliners? > Hi Dmitry, I know I'm not Nick and I hope I am not butting in but I've been following this thread due to these warnings cropping up in Clang. We've been tracking them on GitHub and judging from the values there, I would argue that 3072 is a good starting value. Link: https://github.com/ClangBuiltLinux/linux/issues/39 Cheers, Nathan > > >>> Signed-off-by: Jason A. Donenfeld > >>> --- > >>> lib/Kconfig.debug | 2 +- > >>> 1 file changed, 1 insertion(+), 1 deletion(-) > >>> > >>> diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug > >>> index 4966c4fbe7f7..39078a080e29 100644 > >>> --- a/lib/Kconfig.debug > >>> +++ b/lib/Kconfig.debug > >>> @@ -222,7 +222,7 @@ config ENABLE_MUST_CHECK > >>> config FRAME_WARN > >>> int "Warn for stack frames larger than (needs gcc 4.4)" > >>> range 0 8192 > >>> - default 3072 if KASAN_EXTRA > >>> + default 3072 if KASAN > >>> default 2048 if GCC_PLUGIN_LATENT_ENTROPY > >>> default 1280 if (!64BIT && PARISC) > >>> default 1024 if (!64BIT && !PARISC) > >>> -- > >>> 2.19.0