Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp1053881ybh; Sat, 3 Aug 2019 16:50:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqw4O3LYT9pUIqNsJziszafg9mmHeEDYm5WJzpvqS2r/cl266remg2X6HLAzdPiT0Dipnbqk X-Received: by 2002:a17:90a:2305:: with SMTP id f5mr11834420pje.128.1564876223052; Sat, 03 Aug 2019 16:50:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564876223; cv=none; d=google.com; s=arc-20160816; b=AuPsKFQmSAcv9PmzkzBBC6+YiB5DwGkADs2vfCv0PChN+Ar8+Y4nQk9qXs4afsA05t 9VBQfjcFbwLvzOcye7Yl9/6kGM/wi3TA63Gd+4iHIXpEo9wR5SgJIXUoCdUSQgwHz9uD sGbiPluXsvUkatXlPgcHjG5i811gUe35gzRBoZoAu37Xt9wLy9a+1zu174MUPDmseBvP v+J7si813rhsvbSy2ZK5B3L2JZNb0c/4xP9cit+N7XRWa9aDRU2DOYbl6hRKflQSD3lX +cHNcM4S+55sJkBTOxmibF8+DEWyVX4GCPn4C60JgQHw08iKAXji2BvypDUvBFwiZPvK k4+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :dlp-reaction:dlp-version:dlp-product:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from; bh=1O239fo5tPgVj+JkCJHmuDKpO5lExa/avz4uyUyxCUc=; b=lR46mdBYJTionH70xi1fjTLG8lBmJxe93xzD1F2G19wk8vfG1UvVpvcuSu/EUbIGCB agclQPOYkSVS7+HhgdtmrrpfPC2vpDHIwBdYxFPPiqXQ/TuE7NXxwhE9aAqupTFYXdN6 UR7N/LInTe6qILGOAuUdp2rgYHvT59Kut8rs2lwMH2NKRwSlDiNUnHD8HRyNZkJg9dQA HOK5am09i6R/NTCUQ7cbyXlZIbsxhNn2WOQNCcMvgFu6DWmT3B2I52bI9AeVlyMAH6E5 AFyUH8r+7lhYLeLciJAcRRYDVWQqmaRtJG6Nd59+DFOP7PwjGCTG6gAEwJ3jixaCVnuj 2I+w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t15si9206871pjr.46.2019.08.03.16.50.07; Sat, 03 Aug 2019 16:50:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404320AbfHBRH1 convert rfc822-to-8bit (ORCPT + 99 others); Fri, 2 Aug 2019 13:07:27 -0400 Received: from mga07.intel.com ([134.134.136.100]:47035 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403807AbfHBRH0 (ORCPT ); Fri, 2 Aug 2019 13:07:26 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Aug 2019 10:07:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,338,1559545200"; d="scan'208";a="201720256" Received: from orsmsx108.amr.corp.intel.com ([10.22.240.6]) by fmsmga002.fm.intel.com with ESMTP; 02 Aug 2019 10:07:25 -0700 Received: from orsmsx126.amr.corp.intel.com (10.22.240.126) by ORSMSX108.amr.corp.intel.com (10.22.240.6) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 2 Aug 2019 10:07:25 -0700 Received: from orsmsx122.amr.corp.intel.com ([169.254.11.68]) by ORSMSX126.amr.corp.intel.com ([169.254.4.77]) with mapi id 14.03.0439.000; Fri, 2 Aug 2019 10:07:24 -0700 From: "Allan, Bruce W" To: Colin King , "Kirsher, Jeffrey T" , "David S . Miller" , "intel-wired-lan@lists.osuosl.org" , "netdev@vger.kernel.org" CC: "kernel-janitors@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [Intel-wired-lan] [PATCH][net-next] ice: fix potential infinite loop Thread-Topic: [Intel-wired-lan] [PATCH][net-next] ice: fix potential infinite loop Thread-Index: AQHVSUpMQyMMSydwckqiAxGJUhtvkKboBjCA Date: Fri, 2 Aug 2019 17:07:24 +0000 Message-ID: <804857E1F29AAC47BF68C404FC60A18401096DB0DF@ORSMSX122.amr.corp.intel.com> References: <20190802155217.16996-1-colin.king@canonical.com> In-Reply-To: <20190802155217.16996-1-colin.king@canonical.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiODEwYjE0OTYtMjlkZS00MDlmLTk2YTMtMWU0Y2QxOTc5ZDhhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiM1lmQzhFaHFodmkwbXoxUWhFRk95ZE5EV1NBd3pkRlZDV1RuYVZoMzZnNFFvZ0RxMjFnTmNwTDdcLysrOHZRcVUifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.22.254.140] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Intel-wired-lan [mailto:intel-wired-lan-bounces@osuosl.org] On Behalf > Of Colin King > Sent: Friday, August 02, 2019 8:52 AM > To: Kirsher, Jeffrey T ; David S . Miller > ; intel-wired-lan@lists.osuosl.org; > netdev@vger.kernel.org > Cc: kernel-janitors@vger.kernel.org; linux-kernel@vger.kernel.org > Subject: [Intel-wired-lan] [PATCH][net-next] ice: fix potential infinite loop > > From: Colin Ian King > > The loop counter of a for-loop is a u8 however this is being compared > to an int upper bound and this can lead to an infinite loop if the > upper bound is greater than 255 since the loop counter will wrap back > to zero. Fix this potential issue by making the loop counter an int. > > Addresses-Coverity: ("Infinite loop") Actually, num_alloc_vfs should probably be a u16 instead of an int since num_alloc_vfs cannot exceed 256. Which Coverity scan reported this and what options are used in the analysis? > Fixes: c7aeb4d1b9bf ("ice: Disable VFs until reset is completed") > Signed-off-by: Colin Ian King > --- > drivers/net/ethernet/intel/ice/ice_main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/intel/ice/ice_main.c > b/drivers/net/ethernet/intel/ice/ice_main.c > index c26e6a102dac..088543d50095 100644 > --- a/drivers/net/ethernet/intel/ice/ice_main.c > +++ b/drivers/net/ethernet/intel/ice/ice_main.c > @@ -488,7 +488,7 @@ static void > ice_prepare_for_reset(struct ice_pf *pf) > { > struct ice_hw *hw = &pf->hw; > - u8 i; > + int i; > > /* already prepared for reset */ > if (test_bit(__ICE_PREPARED_FOR_RESET, pf->state)) > -- > 2.20.1 > > _______________________________________________ > Intel-wired-lan mailing list > Intel-wired-lan@osuosl.org > https://lists.osuosl.org/mailman/listinfo/intel-wired-lan