Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp461045pxb; Thu, 9 Sep 2021 05:07:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzoa7/4yWQXLAuquYz6MM2KI8YnVqdDoVN8hv3YIfjQqjYMDkpJIk4HuTefSMWboNFwoZQR X-Received: by 2002:a05:6402:1cbc:: with SMTP id cz28mr2861132edb.370.1631189225055; Thu, 09 Sep 2021 05:07:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631189225; cv=none; d=google.com; s=arc-20160816; b=Sh7Ch8T3OC8Mf2s/3gKU1W/J2spE5GaSgAUACTKaWxtja6AAAHU5NXBv210lTT2LJn lFb6GoJMakSQ+J9YmWYnRNd+ra6klDJXHz/YoarYDVL/VjaIfaFwY8/g/l7q8Gkgc6Kc NhBkg2K8TQv8BwjEOv96Aot1caZGiG5KHmy/oZGqWfWLcXLTwsKwfvW6S2E5lkNoxM+7 XC9A94q7FzcwYlwXD25jUIZQpIUB5dJHlAX6dpRZq1Gp8ClYIPUbSCR11/9wCuIsQYbu Eu/8bTk6y8f+G8hr2tWpluvmmrOa7hDxArEOuS5bBuN4Ddcl6PuRgErxfFBIMys7WGHk Ng5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ge0i4MysJLg7UB+Yx2AaDOSBAP1whBCQ4nJVOdEAFfQ=; b=E+tivuf8obr7GiuetJlCUkurupMxJGhDPqlYuMRpY2Hdl4A6H2VJIWJA9xzEofcXyX QgP1V8aUnbLOuERNtWClYWbInYrt1IM9Sl2lUGVdTzn2dnYGkKvRXQ+u38W/6rV3a/GW nknTG+Qq+4r5SnuJ6DncaIEZkCGXfqYYfmiaLZNEkzlA2L2MdMlIGrDInkwzvdKYM+bu 5HZhnlVpK58/uUdEMPoaWxz8kuwne7vDYHcu5nsNlkTos3O4bGmvssOcBNqbqAquaioj xOO7FanE3N+ov5NV2sSnr67QE1qTHPdagQgzj/yWgxBQvDivOphg7au59EehzSzCll9V OU4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=AM0acIeR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id cy17si1194239edb.469.2021.09.09.05.06.27; Thu, 09 Sep 2021 05:07:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=AM0acIeR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1348083AbhIIMEo (ORCPT + 99 others); Thu, 9 Sep 2021 08:04:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345003AbhIIL7b (ORCPT ); Thu, 9 Sep 2021 07:59:31 -0400 Received: from mail-oi1-x22e.google.com (mail-oi1-x22e.google.com [IPv6:2607:f8b0:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F6F7C08C5DA for ; Thu, 9 Sep 2021 04:43:57 -0700 (PDT) Received: by mail-oi1-x22e.google.com with SMTP id v2so2093592oie.6 for ; Thu, 09 Sep 2021 04:43:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ge0i4MysJLg7UB+Yx2AaDOSBAP1whBCQ4nJVOdEAFfQ=; b=AM0acIeRzwZOQ8ps3Z56Nt2NWs6+nlhrzsKcVFwKMDqqa7rDx5eL5KDD0h/BaJoTnn Yyyxu9wJG75huSLycWf8IDuT7DT0EULGp5e0DvypWYxR9B4SQfPU5j8Fn4XhfFEruwLE ClKvJyFIvmnV6Km2XZLLKRVpzmuk+CmtA15esdDv1bDunZyDxFsQlEfitpESUQeSYFJp 8BTH19cQVldl2Q/Q/K063Hrw0iJTbEvdUS66oLsCqTbhNgBAq0kgnGI6EB+sd5gWro4q 6u6ZSKDtWZTSrF4AorelJKBZfPAQkJjHlymjU+m1V7QiieTyxzEwYQ0qxBYlDgPTQOni 8v9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ge0i4MysJLg7UB+Yx2AaDOSBAP1whBCQ4nJVOdEAFfQ=; b=IstbKthFiozsiYweiVFQ+GoFKBqf8G+qmmJ4OvBi9qT4LhOzTMBwBcKUxNTLtRpkEO rk3rEqce15oeAH8VOM/TAMjPsJcAczqrqi463q6zpB1/vel6Q53dQQSxkEgc5ElsbJJH OOEXy2aezi+AITcJhX+ebobuRFl4Yotu/ROM0hLyh0o9aeWWYFQZQsmGQoB7kI21oSo9 WljEj6ayNcqEyksQuMM+us3vSCACIGGK3BQQeMNx4QklYEBfhtcBxrG7VnFZZ1C+0MyB +1kqF1KQt7s/Xiv77YPEferZulF0opgjoWPpbBSUPcQupyaxDO2oDNrof0SJonj1XhUT kiGg== X-Gm-Message-State: AOAM531Pv5TDeJwxVIZLrOFRHoR0J1vDi/mpUsKoR7kzjGjBltnP2/a8 18UUk9zJwJe4RcgZoi0XX2g3lXswbJFjOLM3kAdA4A== X-Received: by 2002:aca:4344:: with SMTP id q65mr1645122oia.70.1631187836164; Thu, 09 Sep 2021 04:43:56 -0700 (PDT) MIME-Version: 1.0 References: <20210906142615.GA1917503@roeck-us.net> <75a10e8b-9f11-64c4-460b-9f3ac09965e2@roeck-us.net> In-Reply-To: From: Marco Elver Date: Thu, 9 Sep 2021 13:43:44 +0200 Message-ID: Subject: Re: [PATCH] Enable '-Werror' by default for all kernel builds To: Arnd Bergmann Cc: Christoph Hellwig , Guenter Roeck , Nathan Chancellor , Linus Torvalds , Linux Kernel Mailing List , llvm@lists.linux.dev, Nick Desaulniers , Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-riscv , Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Andrey Konovalov , kasan-dev , =?UTF-8?Q?Christian_K=C3=B6nig?= , "Pan, Xinhui" , amd-gfx list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 9 Sept 2021 at 13:00, Arnd Bergmann wrote: > On Thu, Sep 9, 2021 at 12:54 PM Marco Elver wrote: > > On Thu, 9 Sept 2021 at 07:59, Christoph Hellwig wrote: > > > On Wed, Sep 08, 2021 at 11:58:56PM +0200, Marco Elver wrote: > > > > It'd be good to avoid. It has helped uncover build issues with KASAN in > > > > the past. Or at least make it dependent on the problematic architecture. > > > > For example if arm is a problem, something like this: > > > > > > I'm also seeing quite a few stack size warnings with KASAN on x86_64 > > > without COMPILT_TEST using gcc 10.2.1 from Debian. In fact there are a > > > few warnings without KASAN, but with KASAN there are a lot more. > > > I'll try to find some time to dig into them. > > > > Right, this reminded me that we actually at least double the real > > stack size for KASAN builds, because it inherently requires more stack > > space. I think we need Wframe-larger-than to match that, otherwise > > we'll just keep having this problem: > > > > https://lkml.kernel.org/r/20210909104925.809674-1-elver@google.com > > The problem with this is that it completely defeats the point of the > stack size warnings in allmodconfig kernels when they have KASAN > enabled and end up missing obvious code bugs in drivers that put > large structures on the stack. Let's not go there. Sure, but the reality is that the real stack size is already doubled for KASAN. And that should be reflected in Wframe-larger-than. Either that, or we just have to live with the occasional warning (that is likely benign). But with WERROR we're now forced to make the defaults as sane as possible. If the worry is allmodconfig, maybe we do have to make KASAN dependent on !COMPILE_TEST, even though that's not great either because it has caught real issues in the past (it'll also mean doing the same for all other instrumentation-based tools, like KCSAN, UBSAN, etc.).