Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2399271ybl; Sun, 26 Jan 2020 01:41:44 -0800 (PST) X-Google-Smtp-Source: APXvYqx/aQkDyg+pTNJzizOnrD/eGsS2qwJIPJPph6r2XJ0SyP+YHtzSSA6ALXnhariotlT6NDTx X-Received: by 2002:a05:6830:ce:: with SMTP id x14mr8553025oto.289.1580031704287; Sun, 26 Jan 2020 01:41:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580031704; cv=none; d=google.com; s=arc-20160816; b=z7UDVD1yGjW38aFRi4u6tdmXUtoZlSdy8xg/Tk5ITVGEzF9M1MBjIQGynxTZpRd3vz uVMXxFVyzpu4YMee7iwcogMY9pBC8MrWkO99tQontUYeRPm0GiuNr5Ne9CztLWLAuKj1 4B0qv8TntxKhMA2ZDPYhdjHx+BmWz6j5yFQLz5+mRB+j+KV/ip95qVNJSMN/W9UNku4/ eNWOGgUlbnEIK4Z9tGl/8Q+V0b7juFH4yEFH1k61+Fcm9K4oK5IeuVBtVoG0+CWOki3k QWkZYZwvbncVrrHhuK4lbo0Ar5jUlD+2tadB3QDPiGe7yJBpUzEyFnUAnNDxss5vxrzH rUyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=8l1rmL5X5Cv0Cj5XiywukSTYoIUEeUjYPldXFydWbC0=; b=pfRuOoOffEcXClFQO8Zk0eIuHV0hbQlnT/NIr34Atx6CPjeyWDdmKXyJ8IcTYS1PBN RAwNvU/NWAA3/+0617O9E3twNocW5YP5FiSO8WBld5WKUqcdRJIOrHAhjTFWeNix58k0 EqDKQskEuwyJcyAzsVTsGy57hEcW0NBAcOuxqQdagH9oCxPDNY8y7v2st5AfnZ0EDvxI yn/V5Ol5CPuBuXjuLQbscyKt8eFwzR5G4iEyl99m3l0D+W/0VLebJ82e8xhuSV3xvDco HMfZoBbwSmtwwz+wZ8nrUMV3xObNmuHu+yy3qY/5RZedHLDHmAsX3IFrUuiTbiC4BEqF avgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@wp.pl header.s=1024a header.b=nOuavmRo; 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=pass (p=NONE sp=NONE dis=NONE) header.from=wp.pl Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d79si1300046oib.190.2020.01.26.01.41.31; Sun, 26 Jan 2020 01:41:44 -0800 (PST) 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; dkim=pass (test mode) header.i=@wp.pl header.s=1024a header.b=nOuavmRo; 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=pass (p=NONE sp=NONE dis=NONE) header.from=wp.pl Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729094AbgAZJjf (ORCPT + 99 others); Sun, 26 Jan 2020 04:39:35 -0500 Received: from mx3.wp.pl ([212.77.101.9]:45431 "EHLO mx3.wp.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727754AbgAZJjf (ORCPT ); Sun, 26 Jan 2020 04:39:35 -0500 Received: (wp-smtpd smtp.wp.pl 1467 invoked from network); 26 Jan 2020 10:39:33 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wp.pl; s=1024a; t=1580031573; bh=8l1rmL5X5Cv0Cj5XiywukSTYoIUEeUjYPldXFydWbC0=; h=From:To:Cc:Subject; b=nOuavmRoSp5RRbeyZdERhjGL6lBZfuXp1C1VmIyHyeBce9sOakGtCD5JYmxMVHj4p jvLiTTi+ttVtC62AHQY30tVHldAx8qkFpPY4H4fzMzBBtG7g8PBn5G/1x8ilpdGDLi on5uDFfGmaLAJd15pl1s+7iBsuBqrtzBsV+ikYR4= Received: from host-178.215.207.168-internet.zabrze.debacom.pl (HELO localhost) (stf_xl@wp.pl@[178.215.207.168]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP for ; 26 Jan 2020 10:39:33 +0100 Date: Sun, 26 Jan 2020 10:39:32 +0100 From: Stanislaw Gruszka To: Colin King Cc: Kalle Valo , "David S . Miller" , Meenakshi Venkataraman , Wey-Yi Guy , Johannes Berg , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH][next] iwlegacy: ensure loop counter addr does not wrap and cause an infinite loop Message-ID: <20200126093932.GA605118@wp.pl> References: <20200126000954.22807-1-colin.king@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200126000954.22807-1-colin.king@canonical.com> X-WP-MailID: 5300318e69b08c0e5e0d2f8643f46dc7 X-WP-AV: skaner antywirusowy Poczty Wirtualnej Polski X-WP-SPAM: NO 0000000 [oROH] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 26, 2020 at 12:09:54AM +0000, Colin King wrote: > From: Colin Ian King > > The loop counter addr is a u16 where as the upper limit of the loop > is a an int. In the unlikely event that the il->cfg->eeprom_size is > greater than 64K then we end up with an infinite loop since addr will > wrap around an never reach upper loop limit. Fix this by making addr > an int. > > Addresses-Coverity: ("Infinite loop") > Fixes: be663ab67077 ("iwlwifi: split the drivers for agn and legacy devices 3945/4965") > Signed-off-by: Colin Ian King Acked-by: Stanislaw Gruszka