From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from stargate3.asicdesigners.com (unknown [12.32.117.8]) by dpdk.org (Postfix) with ESMTP id 750E72B86 for ; Tue, 19 Jul 2016 10:17:17 +0200 (CEST) Received: from localhost (scalar.blr.asicdesigners.com [10.193.185.94]) by stargate3.asicdesigners.com (8.13.8/8.13.8) with ESMTP id u6J8GgFX022436; Tue, 19 Jul 2016 01:16:52 -0700 Date: Tue, 19 Jul 2016 13:46:03 +0530 From: Rahul Lakkireddy To: John Mcnamara , dev@dpdk.org Cc: Kumar Sanghvi , Nirranjan Kirubaharan , Arjun V Message-ID: <20160719081601.GA12140@chelsio.com> References: <201607041529.u64FTntT009098@sivswdev02.ir.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201607041529.u64FTntT009098@sivswdev02.ir.intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Subject: Re: [dpdk-dev] DPDK Coverity issue 127559 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jul 2016 08:17:17 -0000 Hi all, On Monday, July 07/04/16, 2016 at 08:29:49 -0700, john.mcnamara@intel.com wrote: > Hi Rahul, > > This is an automated email in relation to a new Coverity static code analysis > issue in DPDK. Details of the issue are below. > [...] > Git commit data and Coverity defect information below. > > Commit data > =========== > > Commit: net/cxgbe: support EEPROM access > Id: fe0bd9ee5da3fd52766458a5d0fa9a8728182be1 > Author: Rahul Lakkireddy > Email: rahul.lakkireddy@chelsio.com > Date: Fri May 6 08:43:18 2016 +0530 > > Defect information > ================== > > /drivers/net/cxgbe/cxgbe_ethdev.c: 919 in cxgbe_set_eeprom() > *** CID 127559: (TAINTED_SCALAR) > 913 } > 914 > 915 if (!err) > 916 err = t4_seeprom_wp(adapter, true); > 917 out: > 918 if (buf != eeprom->data) > >>> CID 127559: (TAINTED_SCALAR) > >>> Passing tainted variable "buf" to a tainted sink. > 919 rte_free(buf); > 920 return err; > 921 } > 922 > 923 static int cxgbe_get_regs_len(struct rte_eth_dev *eth_dev) > 924 { > /drivers/net/cxgbe/cxgbe_ethdev.c: 910 in cxgbe_set_eeprom() > 904 } > 905 > 906 err = t4_seeprom_wp(adapter, false); > 907 if (err) > 908 goto out; > 909 > >>> CID 127559: (TAINTED_SCALAR) > >>> Assigning: "p" = "(u32 *)buf". Both are now tainted. > 910 for (p = (u32 *)buf; !err && aligned_len; aligned_len -= 4, p++) { > 911 err = eeprom_wr_phys(adapter, aligned_offset, *p); > 912 aligned_offset += 4; > 913 } > 914 > 915 if (!err) > I'm not an expert in Coverity and am having trouble understanding what the defect is and need some clarification. Is it telling me that "buf" is being used without doing lower and upper bounds check? Thanks, Rahul