Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2851295iof; Wed, 8 Jun 2022 13:27:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMEN4yo7puy31PzTEmtHQcrJLKh/blJKmobDuzE1AmrV8ZN7jIYvxRExMzkp7FIUO1aAfL X-Received: by 2002:a63:cd52:0:b0:3fe:30ec:825d with SMTP id a18-20020a63cd52000000b003fe30ec825dmr4406772pgj.82.1654720073830; Wed, 08 Jun 2022 13:27:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654720073; cv=none; d=google.com; s=arc-20160816; b=nMtbR/dKLjunFbjA+8WEwoqTB5OIvdyQq4y7h4qEUtMjMtZBxHOm15gi7GYiy4hYxn kzs/QHjaUdZotEl66ognW4ZxfsuINPFNs/e0oZhimpr9BOylODVubTM/7Wq6CMX6kyLr yEWjPpi3cKmju36czkOe2wlP50jPGBSjo7HxpaPHGrHjTCoHbEQjLSvUTuwPBLQGELfW VzyZqhcA95Rf71Rq1pCiSh8sEI9IqZxnNjvsWRDzFnXf+BuECTRdAKVqZHdoGMup7Sg+ q78OMlAe15ZIRg5SZyarGmtKzK0wXGNIPs+nB81sUKkeoTpsqo/UK/OV1IcO11XB53Hw 7RDg== 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=ZuMrWXkULkBDGlmsnHz4J4K87p642Pa6n5p0SpJC58U=; b=eXtDvnkXWsGV6TT+w0s9MGRtI1yGOTrVTCkdvNp8q21A0OxvL/F6Yuqrmq0Y7JUeAj 8NlgHfAUD+a8tmUB5YshdFkEpJ6mtdZhfqVi/lleHsrZoOKB8BA92l0YL1tpOix1fEHa kkzkGNtF4+MN0pyRtNyPncKO1qHsMKzUM2WpWQi52NvMXMtDLkWzvvvHzl13NQCE/00R QvsqN6bqfJ51ZT1YB+XBU17ePDLWeUq2E6EFOtAxaC9aRpfJfSPj3fIwygKdw12OQ1ay 8xhxKM6fLX+rtQLeXJzzSM5WkMqU4qK2g2kevRK6AEuERxsdaY+Y5ywCSJzDnAeW3xJL Nn4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=VJXIyE1t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k191-20020a6384c8000000b003a1d18a5386si29322027pgd.17.2022.06.08.13.27.37; Wed, 08 Jun 2022 13:27:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=VJXIyE1t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232340AbiFHUHb (ORCPT + 99 others); Wed, 8 Jun 2022 16:07:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229844AbiFHUH2 (ORCPT ); Wed, 8 Jun 2022 16:07:28 -0400 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 062161D0CF for ; Wed, 8 Jun 2022 13:07:24 -0700 (PDT) Received: by mail-ej1-x635.google.com with SMTP id q1so43572282ejz.9 for ; Wed, 08 Jun 2022 13:07:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ZuMrWXkULkBDGlmsnHz4J4K87p642Pa6n5p0SpJC58U=; b=VJXIyE1t2dbJB1WiNhgxAyflpNWBLomOQZcjjbgmoF9Pa/ntwr9nvi0Ji1dDmIo/7c kG3KBj6C915FwIlBPvXCgkHtBH6M/yzD3upAlSVc7ORjrC1UQcHxoVi6Od1rnwbNCra9 +4pe76XUh2jNNqYMPudEZ/TEPYG5fiVtPwSQo= 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=ZuMrWXkULkBDGlmsnHz4J4K87p642Pa6n5p0SpJC58U=; b=wj4CV8gGR1k0WmB+PrL3OYKoMwSYxnHWCn3tYQ8A+tWUSZ94LUv6cxYrylUjTAAXDe Djry5kyI8ewqCwI1luxiOpCfe2xBfH+Q3xFgRyiSwuIkyDKkDxAj1B7QzYsT8tn/YHiG 42pKGZt6sZLcSawDS4Kl+/SePpVqCOGj2xPxWZKASzmZRhTEPlJkCmknL3mX9FIVxBsH sllSq0j9jxoilKdQvYypF1HOUKFacy/y2XuK9HDI1VEQzG5ggdMwHf0gcXtM4ZMj10hD DZVsGTqUCskr5kRmvGKE3knTxSFRh1SYhNnjlDjrWJCWRYfFidCioeAv4wnAkHwGIjlZ oi4w== X-Gm-Message-State: AOAM533tfCfU2w52U2RjrKpIa3D4n62vLaXPJ5kzvWQpBZ2TkbDJ5V1m ZywLye5WobdZQ0fPL5xAVYxCpeWFlVKUrFja X-Received: by 2002:a17:906:c834:b0:6ff:4275:1e4e with SMTP id dd20-20020a170906c83400b006ff42751e4emr17375721ejb.121.1654718842916; Wed, 08 Jun 2022 13:07:22 -0700 (PDT) Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com. [209.85.221.48]) by smtp.gmail.com with ESMTPSA id jt2-20020a170906dfc200b006f4cb79d9a8sm9601490ejc.75.2022.06.08.13.07.21 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Jun 2022 13:07:22 -0700 (PDT) Received: by mail-wr1-f48.google.com with SMTP id a15so21208702wrh.2 for ; Wed, 08 Jun 2022 13:07:21 -0700 (PDT) X-Received: by 2002:a5d:414d:0:b0:213:be00:a35 with SMTP id c13-20020a5d414d000000b00213be000a35mr28253388wrq.97.1654718841642; Wed, 08 Jun 2022 13:07:21 -0700 (PDT) MIME-Version: 1.0 References: <20220422134308.1613610-1-svens@linux.ibm.com> <202204221052.85D0C427@keescook> In-Reply-To: <202204221052.85D0C427@keescook> From: Linus Torvalds Date: Wed, 8 Jun 2022 13:07:05 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] s390: disable -Warray-bounds To: Kees Cook Cc: Sven Schnelle , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Coming back to this, because my rc2 week tends to be quiet as people take a breather, and as such a good time for me to do system upgrades. And gcc-12 dropped in Fedora 36, and shows problems on x86 too. So I suspect we'll have to disable -Warray-bounds globally on gcc-12, not just on s390. Unless Kees has patches ready to go already. Some of the warnings look potentially simple, ie struct mbus_dram_target_info; in has the comment * [..] Peripherals are * required to support at least 4 decode windows. and then as a result has int num_cs; struct mbus_dram_window { [..] } cs[4]; and that "cs[4]" looks just bogus - it can be a much larger array, the '4' is just a minimum. The real limit is that 'num_cs' one. But there's a *lot* of warnings, and many of them are due to this, and while some are obvious, others aren't. There are other things too in gcc-12 that seem half-baked. I was interested to see the new '-Wdangling-pointer' thing, but then when I looked at it, the two cases I looked at were just bogus, so .. Linus On Fri, Apr 22, 2022 at 10:54 AM Kees Cook wrote: > > On Fri, Apr 22, 2022 at 03:43:08PM +0200, Sven Schnelle wrote: > > gcc-12 shows a lot of array bound warnings on s390. This is caused > > by our S390_lowcore macro: > > > > which uses an hardcoded address of 0. Wrapping that with > > absolute_pointer() works, but gcc no longer knows that a 12 bit > > instruction is sufficient to access lowcore. So it emits instructions > > like 'lghi %r1,0; l %rx,xxx(%r1)' instead of a single load/store > > instruction. As s390 stores variables often read/written in lowcore, > > this is considered problematic. Therefore disable -Warray-bounds on > > s390 for now until there is a better real solution. > > > > Signed-off-by: Sven Schnelle > > It looks like the source of this problem (the literal-values-treated-as-NULL) > is gcc-12 specific. From the discussions, it sounded like Jacob was > going to fix this "correctly" in gcc-13. It might be a good idea to make > this version-checked? (i.e. only disable on gcc-12)