Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp99171imm; Fri, 21 Sep 2018 10:59:55 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbiZ6tjIidILlJqG8TapXsGf62KPnYot/DfUR8OCJqbScIO/mbM7XMHHpL3lgbTwEbjLJR9 X-Received: by 2002:a63:9c19:: with SMTP id f25-v6mr43088831pge.447.1537552795795; Fri, 21 Sep 2018 10:59:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537552795; cv=none; d=google.com; s=arc-20160816; b=VY2dpN3dmECGlXClxO/4mOtm+tTm8Vz/8mN6Xe/2SBTGQ+BGYxvfNoADBlsjVhrK/l DPtkDgeorqvNwhPL85edgMVfvS7T7eDAOipMix/oF9GxwljU1uVcm/+LtwFUIhdYtZCN wnmisTJNUedbuwI7oBFkcVtIhXkkQ2khBdb0buoM7YGZODGio4Y273cYJq4qaO/5iisl nyAwAEluTDFzFQhBJM1zh/MgC0GL8p2cm1R3Gpy5V9DRvNnkokSDLqYsU9glSgE0hZAN O6B+VgHXUI94jtGuZ5VNXIeBQ78DhyvvFDxUCvwZrLs4KNcraGRy0W59K6mk/KKT9w5b S3VA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=udNOJ/bqBgzqSpg5osX8UPWNlb1fRdlvc9pRFOu3yLI=; b=mkqYqZNrt0HtPOx2wVKpOHIDSh67DI1ATFBBxgpyibBqJqOyP3XBvWSCW6X2MXpQOU b1HI/tJwVLzbsZ1YGw7dpYkyRKG8NbVBJZqhVniT+bDpNbuP2clpyQUWPXSdnkDaQxtW H8QO42Y9nS7U/+8MpqR3Zrb3dlwaNz6HiGJe7P+SA8x9Z1ZUiX++QR6/Cys8Tl99b+6c K7yBNTqxjc4+NClK4kaRsL3Jn/Krti/U9jYEyXmzz/07L51PZ69tjPRMWrLLW94rflYK RcYPHS5sGC4MashwbLO6kHHWJiOaCQb1dGmgCoQAZshD+Rro+XW2iGhmRRpX3iSjG5ph rFuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=EMaW8Vug; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w20-v6si2972005plp.260.2018.09.21.10.59.39; Fri, 21 Sep 2018 10:59:55 -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=@google.com header.s=20161025 header.b=EMaW8Vug; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390932AbeIUXtU (ORCPT + 99 others); Fri, 21 Sep 2018 19:49:20 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:44791 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728149AbeIUXtU (ORCPT ); Fri, 21 Sep 2018 19:49:20 -0400 Received: by mail-pf1-f193.google.com with SMTP id k21-v6so6296777pff.11 for ; Fri, 21 Sep 2018 10:59:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=udNOJ/bqBgzqSpg5osX8UPWNlb1fRdlvc9pRFOu3yLI=; b=EMaW8VuguPBGQ2FECUlV697aGc0aGfVuC9JaJwgBvIpVswPJrXyzFPVMS43ulaATWm N/5uW1nH5Xa0/DzQ0JvQ8fy88C0IWgPQ7UuUNjWyLyBZXyx2c2JnW7k5hip3VGUk+vrs nihu1E1R79UJ0xUZuH759viOsYO7EFkj59aXt9O7Xkj41fnNDoxaaucU4uc6dLtUCark SVNTcEnCaQrmbOZ8LWBIZgc7bCo4cpu32O5MH1n+dG8HqgM+tp5wHb54VRXi9hYd6BQl BybEb4p8+mLM8y/0ljneaQFYemaCKAu3gPunqEUbBfZFmlI7QNZIoiNmrzx9HixjHos4 rrVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=udNOJ/bqBgzqSpg5osX8UPWNlb1fRdlvc9pRFOu3yLI=; b=jDHdVqAZaVHkiMED2t8LdcrEov8xVLjRShNbSH1beyPiAuXNX2iDpKpRd77mj1Feib iE4b/48Rj/sg9ZKSEf/es9VIL4+rqzVEs+fT03zJapYPVZssC1TW7h/JLIayGXUFvWgW UZiJG3XEmMXmI/BZmAU9eT8i6yWBGm4lYmKBqdV/N4GhU/4/kcT/6HXHu0Q9Whf1JRaN SSs1SGgeRtmLR658NdKYOcRq2rvFX1V8MPXvMzLwvEFwl1qh9LcUCKeD87pnn9jf0Dsx vVvvxwNUnOg3RWoaarDQAa1TajUpuAPaKChCLIbOmcV7utkMpGEg0bMe8FUjzHBd7AOR BpPA== X-Gm-Message-State: APzg51A2I+ScziHt2by5CSooDnQ/JbUElwXCtMwnnQDLFrYGVC/k0POe uo7NcHVbS//rHQIzeszWRZJrdTitBibF/SCra59JCA== X-Received: by 2002:a63:1921:: with SMTP id z33-v6mr43323702pgl.302.1537552759252; Fri, 21 Sep 2018 10:59:19 -0700 (PDT) MIME-Version: 1.0 References: <20180921001513.12504-1-Jason@zx2c4.com> <5b94d2f4-eb4a-e00e-5fdf-7f770c26f0da@virtuozzo.com> In-Reply-To: From: Nick Desaulniers Date: Fri, 21 Sep 2018 10:59:07 -0700 Message-ID: Subject: Re: [PATCH] framewarn: expand KASAN_EXTRA exception to KASAN To: Dmitry Vyukov Cc: Andrey Ryabinin , luto@kernel.org, Jason@zx2c4.com, Alexander Potapenko , Arnd Bergmann , Ard Biesheuvel , LKML Content-Type: text/plain; charset="UTF-8" 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 2:45 AM 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? Here's a plot of the distribution from an arm64 clang build with allyesconfig minus LSE_ATOMICS, BIG_ENDIAN, and GCOV: https://github.com/ClangBuiltLinux/linux/issues/39#issuecomment-423621655 A value of 3072 would ignore 79 out of the 128 instances (62%). Some values are huge outliers. > > > >>> 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 -- Thanks, ~Nick Desaulniers