Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp148184iof; Wed, 8 Jun 2022 17:46:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxO6AgMku1bi9b7W21rcMEcjYkNIvH+TCftzbCTaGC4inODYTGBw57HKz+UL+ZqGGj4TLP/ X-Received: by 2002:a17:902:e484:b0:167:5b79:2b61 with SMTP id i4-20020a170902e48400b001675b792b61mr25546207ple.132.1654735594424; Wed, 08 Jun 2022 17:46:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654735594; cv=none; d=google.com; s=arc-20160816; b=CKEOVksuLBb8/IeHqH1449WrbFzKcfjDFOsJX+Rvwa4zSfKJ6OI2axQlQrGk4lYV52 1bMUoCIu4hec3L7cYL4hJOGd26ACdjZE0q61F82rZjYr8053wEewDTgwizjn5/VKO/Ul /49fxkY3wE6yvdkh3GwtEA5WslHGDJhq+GrhsUVtB0zcag/U+nZXW9aPZ/SMnW6zDwU/ b5ngkwc8JeSr+/1X2hiZfhBRQqM/eBUCWx+XZ2YN1ebWF0JqFSdjn/6Y1iYOgn3V1Btv EFvaDzq7htfWZ11IkYpG53cxUHxbXp7/3dEnL/Fc6u4IpVDr/lZFm/v2Ck/Ac0UgSOvs BbCg== 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=HL4pyz552FBsgBnW1SFjlcHSshRtDZGTUGirGdiUozU=; b=Z9XqiFkNi8chmrWz8b9QHyV2LjQ0seCncKRr3X4dVF62JDJg4SqLJbLnXoLBYX41a1 F7H9CgKG7TxyvL8BkXcs/Q8JkF3/OaxAe4UWLb6OoTIoktc5SJ7XLFPv9Ekl/2Yq1B03 AEg3rqgydKtLdGiuEaQ5UBoYHunsMePRInrAZFG9ZPjnt2xyrCCERgo5Zgbj7QEzpxnR FKfqYhNeSZa5IVkodGhwYL43lRldw53MLf2aQ+dEaHATTuwkRmUB5fawpIl9N+Ro8dMz gg/mq5zKVcdloCNTKhGG+XYWdkUm3CPBZcxOShVQVxIEzw8+csgRVY8Xhs12n0D3xsgn MW1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=B3PW1aZy; 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 x21-20020a056a00189500b0050dfc410ab6si20318704pfh.142.2022.06.08.17.46.23; Wed, 08 Jun 2022 17:46:34 -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=B3PW1aZy; 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 S231240AbiFHX7v (ORCPT + 99 others); Wed, 8 Jun 2022 19:59:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229633AbiFHX7u (ORCPT ); Wed, 8 Jun 2022 19:59:50 -0400 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1E951B6FC2 for ; Wed, 8 Jun 2022 16:59:48 -0700 (PDT) Received: by mail-ej1-x630.google.com with SMTP id gl15so30518457ejb.4 for ; Wed, 08 Jun 2022 16:59:48 -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=HL4pyz552FBsgBnW1SFjlcHSshRtDZGTUGirGdiUozU=; b=B3PW1aZy7J/jYvh53GlIU/iYmD74bYN/sIOQCE9xSK9ZYKRs9gtlNR7LrPBaccvH/9 fIkONSDZyV79TvM5yiH0+Cs6L/JqBJ1YAwTMtILxle8rTB28414n0sMNmSjw/VeEmqF5 gXeWOIKYlp2i5aefoOFR7eGt3UbciV4mm8ahU= 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=HL4pyz552FBsgBnW1SFjlcHSshRtDZGTUGirGdiUozU=; b=YgseHExeJZqU56ByrtA9ne/kNPQwF5Zu6quARvTnVUwgPs62wy6WYSEKwWQkvkBAiB JNhk2P7uYwIPLOnDZCuWOs96isjkGnHjLcPvDJLIi2dBDVTx+ZjUkzBXTZScT1Uoeq/k vr/5qooFB3902GJhG+mYdJSwYnWC5k9NeEYjsoPTW9/20hY6eYxdo6q8Wn31QOVBAbTk caoap6W8WpqfTTtWRDMJnql96G9RyYCNF5mrJS8ZUw5OPJyEH0vRK0ONQOvNKBJxWhON WR6IJiLsq4+iCaQrrcgPXC7zEZTzIdyxYhYjm/jnu4UQUEOLhM25rLZx57xTnMABLVQw eAtQ== X-Gm-Message-State: AOAM530UkF+uq6hEqpkRcrLlr0p65SgmEZ5YGiQhJRkV+Zh28T6UGxsy P5oPq5fBoknhtDyQP8NtPvxtHjAMj09V0LRT X-Received: by 2002:a17:906:25d8:b0:6fe:9f11:3906 with SMTP id n24-20020a17090625d800b006fe9f113906mr32909280ejb.538.1654732787077; Wed, 08 Jun 2022 16:59:47 -0700 (PDT) Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com. [209.85.221.49]) by smtp.gmail.com with ESMTPSA id x4-20020a1709065ac400b00704fa2748ffsm9952809ejs.99.2022.06.08.16.59.46 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Jun 2022 16:59:46 -0700 (PDT) Received: by mail-wr1-f49.google.com with SMTP id h5so30289906wrb.0 for ; Wed, 08 Jun 2022 16:59:46 -0700 (PDT) X-Received: by 2002:a5d:414d:0:b0:213:be00:a35 with SMTP id c13-20020a5d414d000000b00213be000a35mr28893206wrq.97.1654732785866; Wed, 08 Jun 2022 16:59:45 -0700 (PDT) MIME-Version: 1.0 References: <20220422134308.1613610-1-svens@linux.ibm.com> <202204221052.85D0C427@keescook> <202206081404.F98F5FC53E@keescook> In-Reply-To: <202206081404.F98F5FC53E@keescook> From: Linus Torvalds Date: Wed, 8 Jun 2022 16:59:29 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] s390: disable -Warray-bounds To: Kees Cook , Philipp Zabel , Shawn Guo , Sascha Hauer , Fabio Estevam , David Howells Cc: Sven Schnelle , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Linux Kernel Mailing List Content-Type: multipart/mixed; boundary="000000000000e68e4105e0f87f4c" 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 --000000000000e68e4105e0f87f4c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Jun 8, 2022 at 2:33 PM Kees Cook wrote: > > I and others have been working through a bunch of them, though yes, > they're not all fixed yet. I've been trying to track it here[1], but > many of those fixes are only in -next. Hmm. Even with that disabled, I get a few warnings I *really* would want to get rid of. The one in ipuv3-crtc.c seems valid about "address used as boolean is always true". The 'dangling-pointer' warning does seem interesting, but not when the compiler does as bad a job as gcc seems to do. See the attached patch for (a) make the s390 "use -Wno-array-bounds for gcc-12" be generic (b) fix the ipuv3-crtc.c one. IMX people? (c) disable -Wdangling-pointer entirely for now but that still leaves the netfs_i_context games, which gcc-12 is very unhappy about: In function =E2=80=98fortify_memset_chk=E2=80=99, inlined from =E2=80=98netfs_i_context_init=E2=80=99 at ./include/linu= x/netfs.h:327:2, inlined from =E2=80=98afs_set_netfs_context=E2=80=99 at fs/afs/inode.= c:61:2, inlined from =E2=80=98afs_inode_init_from_status=E2=80=99 at fs/afs/i= node.c:139:2: ./include/linux/fortify-string.h:258:25: error: call to =E2=80=98__write_overflow_field=E2=80=99 declared with attribute warning: d= etected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=3Dattribute-warning] and I do kind of agree with the compiler in that case. That code should have some kind of struct container { struct inode inode; struct netfs_i_context ctx; }; thing, and aim to do that instead of the pointer arithmetic games. Ceph seems to trigger the exact same thing. There's also an annoying mlx5 issue, with gcc apparently not tracking the usage of struct lag_tracker tracker; well enough (it's never used if do_bond is false, but probably some inlining change means that gcc doesn't see that). DavidH - mind looking at the netfs_i_context_init() thing? I'd like to use something more surgical than CONFIG_CC_NO_ARRAY_BOUNDS, but considering the s390 issues, it may not even be worth it. Kees, just how far away are we from that being ok on x86-64? I did consider making CONFIG_CC_NO_ARRAY_BOUNDS be more akin to config CC_NO_ARRAY_BOUNDS bool depends on CC_IS_GCC depends on GCC_VERSION >=3D 120000 && GCC_VERSION < 130000 default GCC12_NO_ARRAY_BOUNDS and then s390 and any subsystem that triggers the -Warray-bounds problem ca= n do select GCC12_NO_ARRAY_BOUNDS to show that they have issues with the new gcc12 rules. That would be at least a bit more surgical.. Linus --000000000000e68e4105e0f87f4c Content-Type: text/x-patch; charset="US-ASCII"; name="patch.diff" Content-Disposition: attachment; filename="patch.diff" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_l468v6ie0 IE1ha2VmaWxlICAgICAgICAgIC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