Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp120711imm; Fri, 21 Sep 2018 11:20:26 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZney/kTn7WGeorfHOuExXTyuOW/jL95ALBI3BU62IaopJNMeaNJxWwGrSFeh2ul3iaT8Nw X-Received: by 2002:a17:902:246a:: with SMTP id m39-v6mr44754465plg.57.1537554026146; Fri, 21 Sep 2018 11:20:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537554026; cv=none; d=google.com; s=arc-20160816; b=wERgjGZaYGb0vgnWAjBkiyKRepDmCXst+Ip4b4If8RgxjlQXRQEP244ZMNJjHouzch PFXWMAZRnIW+tRJ+uuW5d2FdpGKYIHiqsZA3dfQCRUkbfIH6mGVE2SNfeArJCCw2zx4c B+gFunOXT1/19OA7L+e1zJ/TdakMR2NnNUnD7TRwdvj67YmucZkUguS+4iCpd+a8sfja Dd3mzsdI9vu/QMcNnjdZw4QsGZ7JMdc20LwSKNznfMYpurJvOG8Uqyyx0M37eBPoEj52 kc0YlWEqGdrATkyHfiBTG3NTaNIJI7+ZUbtgagKsqX/72l72DsgTApVXzZDLdJJ3bb/E Ug6w== 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=PnL1sJkLcMPkiObGig82HmU2FMBBkb4mBsdnODpA+oI=; b=Eg1/Cm4st0nMOvRjUJIPQueRisrhp7PMN1g+SypbAXrlNDcEr9xEdqpK1RfcMAALp4 5yq+5+VvUnsJyQ0/lSQ996a6hH//Xa5mUNrwHY4oJqZjvrg65Ez2jEpb1eA2dt4qzT+0 IBVLp+D2tHneGYW/JIPVIaYtdNszQ/5g0RSpqhEu71qa/+nMNkFxImB557QHP0JCASKH 2LTxx5b/t7uNlu4yxeNkJe6wm2qE4qkJWADDeoq6lhS+qJ3lRs5bCH20D4Bk+mNmUao3 8+Fr6XYLhT6jw2j+AH1J/zmNNHrCNZzHlsetbv8g3GpwM5fPvdrUtBnawxfCvTI2leFd p9jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=S4Mf5O7V; 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 g22-v6si28652905pfb.136.2018.09.21.11.20.09; Fri, 21 Sep 2018 11:20:26 -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=S4Mf5O7V; 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 S2391227AbeIVAIO (ORCPT + 99 others); Fri, 21 Sep 2018 20:08:14 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:41676 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391092AbeIVAIO (ORCPT ); Fri, 21 Sep 2018 20:08:14 -0400 Received: by mail-pf1-f196.google.com with SMTP id h79-v6so6327857pfk.8 for ; Fri, 21 Sep 2018 11:18:10 -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=PnL1sJkLcMPkiObGig82HmU2FMBBkb4mBsdnODpA+oI=; b=S4Mf5O7Vu/aKpV2GlqRjpvbWyqyRMh4o4zTsyoiylGpL9Kvuo1OYyEhF820J2wffJM 7p7uO9BpJDUqLMoqBCdPJN4nYPhbBcrjz/geODh9Y4JM4jpYftr7OMbzt1cUB5ywv1rq lXAlaAMAYQ6L5UDTvsm7thUT+6l7oZdeCNzHPHkju7OBApg4yM3uVHHgEOkyF9CD/b29 XvWJd35Wax3jIJlRuJik3tPpFPfv52gaj6OMLq0fa2/Y0IeY2c3U2v2EsfcTapOqFVkY b9vYn+8G+C8vLMBcoIJuyHg4VPObUT1+h3MIZCZpnWbqr/qrYytbTp66GedXe9+6q/+Z aOpw== 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=PnL1sJkLcMPkiObGig82HmU2FMBBkb4mBsdnODpA+oI=; b=FSjwrLDmvGb4pphm4VLA3ER+94TjRnaUIpihtn2LJ7HReLN77ZYPHbDAXoKbyjCdV8 lte+nxe8rJgaVoCMdZJ+rbWBNEbme7d1fkMHR/T2HwT7lPkvsAWtKQeSi2i3ElgMSEEh FssBfpl8O7Z3ojibgUs2KZKH7H2XjMwidxCs2HQrB8MTRry2fGCeXYcDGSQP3KxzcRmm 3qj1BdCXIHSjBBBSSAVebwiAph8yQlTDZWYBIuzGCVe5T+QGgNHT9FswfKAzAw0DW2oC azM4rULbZ38KuJhW6h+qWgk3kZOHayHieKq+kF6KdyiaC2AD6kxsjfH1PDxc6WzzZsZj u25g== X-Gm-Message-State: APzg51BSAZ31iw3Yk4u/Z5isP+AZAQzztAz1elMjdz11sHryX2DMhL/Z YzSLxONC7lz+9BqKgPen4JCYMhVQvFsZ4APy8Mx8iA== X-Received: by 2002:a62:8559:: with SMTP id u86-v6mr47899451pfd.32.1537553890077; Fri, 21 Sep 2018 11:18:10 -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 11:17:58 -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 10:59 AM Nick Desaulniers wrote: > > 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%). A value of 4614 would ignore 95% of the instances (2 standard deviations of the distribution of current warnings). > > 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 -- Thanks, ~Nick Desaulniers