Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp7715838rwp; Tue, 18 Jul 2023 22:00:26 -0700 (PDT) X-Google-Smtp-Source: APBJJlHNwOdCa14K+uBw8t3GJrUtO8gjqt7iP/bnes0uLvhQb8iAZK4Z5oenGcBY4iIM0SRgh2Cw X-Received: by 2002:a05:620a:410:b0:766:fd2c:fca1 with SMTP id 16-20020a05620a041000b00766fd2cfca1mr20670592qkp.75.1689742826421; Tue, 18 Jul 2023 22:00:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689742826; cv=none; d=google.com; s=arc-20160816; b=vjZTCA016jkx4xLbG7j8glV6Erhcqrk/G7x6m2FbLVWLkzzKGOcfEXRaaXKKy59Hx+ X1kPpnhbqRx0MwSi2H3EuGBTG9f3znEhDUg4ax7i17P+59dKMSbz1d9hOah5anODMKTM Gb8Ud4wxCfFU8tlqd/EhX9MH5h52hHJSBNgIIP4ofGqrIpC+6iGoxRhUzMgm2f+qG6MO zOsdLeloj5D2XFb7e0yQBY+TCdgh9aZv5vm8VgDNSn3r/KEGIyhdeqhor/zz2C4bfovN JGncbMiuCEPQ6JoSUono9LRuLMyIO4uEJSuPu/SYfrGK+qd/XS1hc1vLaXHDh7i+OWs9 D9fA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=+/BlqLIDfeuKqQi7Zyq/vs2odCOmYtAyzi0u6RkYKfs=; fh=XDvohtpUliTrJtbcSwKX3roSkYCKuJwT4k4IEXW0zfk=; b=XoWz0jrnY6mkNFOFdtGYhtg6z1AgqSayzagVYJiLuHP9LL7Phf+Ll+uVAIXn23sdf0 fFEO+jiMEEScZxbX1J9MXMB8gkHd010h9vQCDCf8g4sGEKdVHlNxouhthb1wkyzSb+lG J1G9ESXXf56MZ4mxLoifavY1HpDWOHNvLDXCN99IdNg8y4kJze1E0oMeCnqaurGSAEvY p22qFE3+3nzMcHJZghHbrwU1A+AEnnpHgXw6pGWq+9Wj2expNweIZINUyTPsepnmqOhr Xl2ZRXde0fGeCrhELWl42BggZvhqLIeaikoYtWyN0FCLuDxokfsajVLQClfmVZ7q8FHE QFMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=dI68NxHH; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j15-20020a170903028f00b001b6aeea4a58si2961243plr.53.2023.07.18.22.00.14; Tue, 18 Jul 2023 22:00:26 -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=@google.com header.s=20221208 header.b=dI68NxHH; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229808AbjGSEbF (ORCPT + 99 others); Wed, 19 Jul 2023 00:31:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229502AbjGSEbD (ORCPT ); Wed, 19 Jul 2023 00:31:03 -0400 Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A4AB1B9 for ; Tue, 18 Jul 2023 21:31:02 -0700 (PDT) Received: by mail-qt1-x82e.google.com with SMTP id d75a77b69052e-401d1d967beso559911cf.0 for ; Tue, 18 Jul 2023 21:31:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1689741061; x=1692333061; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=+/BlqLIDfeuKqQi7Zyq/vs2odCOmYtAyzi0u6RkYKfs=; b=dI68NxHHDPUyAywUbAXEmQM3Upc11gKLIkXntAl/lJHTY5ai+xy0GTHHGZqpc4nS8F rqvFYfj8IvVcnidgCYdBV92k8CrS64TsVoT8ZpddkRjVTp7AOAj6Uxd2q/8hRtWS0U5B fsPdzm6dGKcliW6tql984pOxXVq6luozGGaZNvwHo7kKhxEr0UuLW40USscS2EyuOE5w 3Qr7YoRiPhnMh71Etwwi6RiS+cnQdWJgpfJzYwoXZkMfNXCbpbpUqTADg2GlUP+Z/q95 R2GK3Eyx9nmKyOozKjXy6sBnZn9iLc1Opq9gdmzCqcP6OIuFSsYrKx2VpxYVTHtH0j9X ZMHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689741061; x=1692333061; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+/BlqLIDfeuKqQi7Zyq/vs2odCOmYtAyzi0u6RkYKfs=; b=NgCDiYqDiC1hV95GE4mRC52K2RvTZ0xrFVHKbVpu5/DoWr+TbJcvLLcP8UKs3LNMmd EyGBDERRiBK9q4BUl3nb6QXffqd67xV2h2NWIO84Fmbd5lRGZeubolsfSn6jrj9hJC+B Uw8hI2XNCkPqEQ5uGuKzWDd8m5E/XuMa0abC1TRAEoCJbfx8wQXMNkJUB2BRD/SSF9Q9 Fa31NQTgkFzSys9Lh7kLHZOFISxwyjNKUrcjs8PPXm3ddYHDyowPq3ZpSu1KSbCSaovd Ei79JIRW+K6DVKHsXWLj1HmsV7LWMIG2JIh1Wt0ZUvO+P/MQS5oDGhCgGIHmWIwYm8ew Cg5w== X-Gm-Message-State: ABy/qLYQYNlI7br3vgyEUv/isHdg0ZnhqBlfTaEn0tMAcuXe2vsl3QIh ug1TL3dfLlzULC1UDR28gynuxEbsDRcEuv6h/vW9rA== X-Received: by 2002:ac8:5905:0:b0:3f9:6930:1308 with SMTP id 5-20020ac85905000000b003f969301308mr332660qty.13.1689741061559; Tue, 18 Jul 2023 21:31:01 -0700 (PDT) MIME-Version: 1.0 References: <20230717143443.163732-1-carlos.bilbao@amd.com> <20230717192403.96187-1-kuniyu@amazon.com> <20230718195414.4c6f359f@kernel.org> In-Reply-To: <20230718195414.4c6f359f@kernel.org> From: Eric Dumazet Date: Wed, 19 Jul 2023 06:30:50 +0200 Message-ID: Subject: Re: [PATCH] tg3: fix array subscript out of bounds compilation error To: Jakub Kicinski Cc: Carlos Bilbao , Kuniyuki Iwashima , davem@davemloft.net, linux-kernel@vger.kernel.org, mchan@broadcom.com, netdev@vger.kernel.org, pabeni@redhat.com, prashant@broadcom.com, siva.kallam@broadcom.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable 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 On Wed, Jul 19, 2023 at 4:54=E2=80=AFAM Jakub Kicinski wr= ote: > > On Tue, 18 Jul 2023 10:52:39 -0500 Carlos Bilbao wrote: > > >> Fix encountered compilation error in tg3.c where an array subscript = was > > > > > > What is the error ? > > > > drivers/net/ethernet/broadcom/tg3.c: In function =E2=80=98tg3_init_one= =E2=80=99: > > What compiler are you using? Any extra flags? > > I remember seeing this warning too, but I can't repro it now (gcc 13.1; > clang 16). Same here, I think I was seeing this 4 or 5 years ago. I ignored the warning at that time because we were using an old compiler. > > > >> above the array bounds of 'struct tg3_napi[5]'. Add an additional ch= eck in > > >> the for loop to ensure that it does not exceed the bounds of > > >> 'struct tg3_napi' (defined by TG3_IRQ_MAX_VECS). > > >> > > >> Reviewed-By: Carlos Bilbao > > We need a sign-off tag > -- > pw-bot: cr