Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp509219ybt; Wed, 1 Jul 2020 03:53:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPdkpKOemFf13/1mbO5NSKM10U+MpGoebT+gqRbZo+zG9NYzf2pLkrBaQpGZWp1QR/NdMF X-Received: by 2002:aa7:d3cd:: with SMTP id o13mr27619919edr.176.1593600815988; Wed, 01 Jul 2020 03:53:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593600815; cv=none; d=google.com; s=arc-20160816; b=uDxChU70cT+DG8DyWcFi2j4EmDeS7MgkHNHaE2wEVBI4FO9gIMl76Jgm9rbVM/wvWi Exel3WDq9QBRZ+4QjuucksDo2mvRnJPblFBSE9Nl0p9SWFWg0fH2+GKABAsc6Hxo9btI cpX+dxKJN7j2Xe6MGB8wBr+1BFr1IbR2A26lTusOXu9Qf/LhgO2AMjKMx2iyS3HnO8Az r5o7sVrpeArMWrueliK82YjuZP25pRJSg9yU6QggFQnOTN86aH4cW/KaMvmKCu08QS6Z 0RgNMhiW3fk3In2tvqtqM6B6JwGoW1CMJyHuX7BM8f0QBhy6VXzc00hh3ToIQEhJC0g4 wJ3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=5oF+mSeUKqcexkzn8iMEsJf1U3hSje1Cn9U1nMF9S+o=; b=DbRAYGEA7QIF9FDWZUkxtgHxTnDNnak9XmNhpRgcjqfyRI1GNWBCEFJX/9CaNhYQwp JlgYPkLfJD6Ej9W94dRBaUKt0Layfqe8QeIp7L17dRH2kCEOxaOHxBNWZGp3OM7luI0V +pAOMvw6dIR/B7KPRYQte6KUSCDrw/08XFDhLTEMVQQawXlxyX1E4DtAd3JMEtuMOVH3 n5NEhGtt8lo2VgaMy9PZ3UW653gwAElG7l5fSTN5Oqd2J0cSWefliJVrZuG3U0OUM1SN EAhmT0l8nG5kYwl7VyWQNHPf5Gxn02HAQIphC/jbdVTivX2WphdLMts9LyOLxlJhWPx7 NLMA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id i9si3724821edx.408.2020.07.01.03.53.13; Wed, 01 Jul 2020 03:53:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1730103AbgGAKvB (ORCPT + 99 others); Wed, 1 Jul 2020 06:51:01 -0400 Received: from mga07.intel.com ([134.134.136.100]:4288 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729791AbgGAKvB (ORCPT ); Wed, 1 Jul 2020 06:51:01 -0400 IronPort-SDR: i1r71mXlTJGdL9T6fPgcGdNmgcpoWFaiovfbVayR8sx6yhNLH5nZDvBjPkXKgIrrMXOZw8cG9Q iSVWDdrx0iGg== X-IronPort-AV: E=McAfee;i="6000,8403,9668"; a="211589913" X-IronPort-AV: E=Sophos;i="5.75,299,1589266800"; d="scan'208";a="211589913" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jul 2020 03:50:59 -0700 IronPort-SDR: fqdJjYt0cdpBdhV9T+5fkkEjx1fpdbgRU0STGFzgfVj1c3WKqbZkEadWiXoQVuy7trbiZuO4AU HF4yU22+wEsA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,299,1589266800"; d="scan'208";a="386975562" Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.163]) by fmsmga001.fm.intel.com with SMTP; 01 Jul 2020 03:50:56 -0700 Received: by lahna (sSMTP sendmail emulation); Wed, 01 Jul 2020 13:50:55 +0300 Date: Wed, 1 Jul 2020 13:50:55 +0300 From: Mika Westerberg To: Colin King Cc: Andreas Noever , Michael Jamet , Yehezkel Bernat , linux-usb@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH][next] thunderbolt: ensure left shift of 512 does not overflow a 32 bit int Message-ID: <20200701105055.GQ5180@lahna.fi.intel.com> References: <20200630145558.516961-1-colin.king@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200630145558.516961-1-colin.king@canonical.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 30, 2020 at 03:55:58PM +0100, Colin King wrote: > From: Colin Ian King > > The 32 bit int value 512 is being left shifted and then used in a context > that expects the expression to be a larger unsigned long. There may be > a potential integer overflow, so make 512 a UL before shift to avoid > any such issues. > > Addresses-Coverity: ("Uninintentional integer overflow") > Fixes: 3b1d8d577ca8 ("thunderbolt: Implement USB3 bandwidth negotiation routines") > Signed-off-by: Colin Ian King Applied, thanks!