From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-20.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25F78C43460 for ; Tue, 11 May 2021 15:49:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EECDD61361 for ; Tue, 11 May 2021 15:49:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231961AbhEKPul (ORCPT ); Tue, 11 May 2021 11:50:41 -0400 Received: from gateway22.websitewelcome.com ([192.185.47.100]:30118 "EHLO gateway22.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231852AbhEKPuj (ORCPT ); Tue, 11 May 2021 11:50:39 -0400 Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway22.websitewelcome.com (Postfix) with ESMTP id 5BF52413FF for ; Tue, 11 May 2021 10:49:31 -0500 (CDT) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id gUdXlg0M48uM0gUdXl10aT; Tue, 11 May 2021 10:49:31 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=embeddedor.com; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=du7TLirKJwuRndTVgzHHBCMXvT6lZMGk+j6j2JK4ikk=; b=jVO4W/UG3fiHMDSm9xE8Ra87k3 +cgQgqzxJVZdYJVsdqhpoh0FUWz2VDu+NJczDnC8WrpoxH++yGLWMSWG3vY3L4TwcEYXqt/VYGwfS Iq31krhyN9/zwtnmsYa6hR2l5qrGI5RbO2Mobfbn1y34LKFCKc6D5eLAQx35mV97uY/wAYMkfgXsp VBABL308IUxeJpnKvlfvfqVxAxxg9F58lw2s/1Y7rEoPe1aUmq+ePxI3C45k6ughER11G8y7I7zE2 mWTQsmaxiHyhKmUDzHzrf4wrxEimMLhzUQ83BNifaZvm0BwlnDyKzNINSGViHnLXpKpL1nFECJa15 lAWA6ndQ==; Received: from 187-162-31-110.static.axtel.net ([187.162.31.110]:59016 helo=[192.168.15.8]) by gator4166.hostgator.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1lgUdS-000VgQ-Ji; Tue, 11 May 2021 10:49:26 -0500 Subject: Re: [Intel-wired-lan] [PATCH][next] ixgbe: Fix out-bounds warning in ixgbe_host_interface_command() To: "Switzer, David" , "Gustavo A. R. Silva" , "Brandeburg, Jesse" , "Nguyen, Anthony L" , "David S. Miller" , Jakub Kicinski Cc: Kees Cook , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "intel-wired-lan@lists.osuosl.org" , "linux-hardening@vger.kernel.org" References: <20210413190345.GA304933@embeddedor> From: "Gustavo A. R. Silva" Message-ID: Date: Tue, 11 May 2021 10:49:55 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 187.162.31.110 X-Source-L: No X-Exim-ID: 1lgUdS-000VgQ-Ji X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 187-162-31-110.static.axtel.net ([192.168.15.8]) [187.162.31.110]:59016 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 39 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, On 5/6/21 02:25, Switzer, David wrote: > >> -----Original Message----- >> From: Intel-wired-lan On Behalf Of >> Gustavo A. R. Silva >> Sent: Tuesday, April 13, 2021 12:04 PM >> To: Brandeburg, Jesse ; Nguyen, Anthony L >> ; David S. Miller ; Jakub >> Kicinski >> Cc: Kees Cook ; netdev@vger.kernel.org; linux- >> kernel@vger.kernel.org; Gustavo A. R. Silva ; intel- >> wired-lan@lists.osuosl.org; linux-hardening@vger.kernel.org >> Subject: [Intel-wired-lan] [PATCH][next] ixgbe: Fix out-bounds warning in >> ixgbe_host_interface_command() >> >> Replace union with a couple of pointers in order to fix the following out-of- >> bounds warning: >> >> CC [M] drivers/net/ethernet/intel/ixgbe/ixgbe_common.o >> drivers/net/ethernet/intel/ixgbe/ixgbe_common.c: In function >> ‘ixgbe_host_interface_command’: >> drivers/net/ethernet/intel/ixgbe/ixgbe_common.c:3729:13: warning: array >> subscript 1 is above array bounds of ‘u32[1]’ {aka ‘unsigned int[1]’} [-Warray- >> bounds] >> 3729 | bp->u32arr[bi] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, bi); >> | ~~~~~~~~~~^~~~ >> drivers/net/ethernet/intel/ixgbe/ixgbe_common.c:3682:7: note: while >> referencing ‘u32arr’ >> 3682 | u32 u32arr[1]; >> | ^~~~~~ >> >> This helps with the ongoing efforts to globally enable -Warray-bounds. >> >> Link: https://github.com/KSPP/linux/issues/109 >> Co-developed-by: Kees Cook >> Signed-off-by: Kees Cook >> Signed-off-by: Gustavo A. R. Silva >> --- >> drivers/net/ethernet/intel/ixgbe/ixgbe_common.c | 16 +++++++--------- >> 1 file changed, 7 insertions(+), 9 deletions(-) >> > Tested-by: Dave Switzer Thanks for this, Dave. :) By the way, we are about to be able to globally enable -Warray-bounds and, this is one of the last out-of-bounds warnings in linux-next. Thanks -- Gustavo