Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp107634ybg; Mon, 8 Jun 2020 17:48:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzigfLT+YE3qLSqHs2DwpDFq1JcAVCjUY6ZFZnh+Hi+ctHzk+EKg9Bw0tctmDgPr13mX9OU X-Received: by 2002:a17:906:2b04:: with SMTP id a4mr23647684ejg.98.1591663705157; Mon, 08 Jun 2020 17:48:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591663705; cv=none; d=google.com; s=arc-20160816; b=VEjEwsPLpZV/26OkK8Dxg6xhP92PzdJzLAOn8lHz2kOpuIGfN02JSsC4tVel2MXyCD 6Fqif3EpeN8joA8uen91rEygqpTkkLvZmqFJEIx0Bk4HzmA1MysMYPodh9J/XympuVSQ lUGRD4Z6A2b4+gMGzsX3lzETT19njwAHPyIywt1g8lY2ukoaka4wFGJrdSHkQTvjwQfJ x7S7v/osptpQ1QXIVF7cXV5nezKfdztZaB+AZbtMissMU3diUONXN/BzB0wowZ/HEQC6 8msXEiDSZuOi/W9sMY+1qYY4auF1QVivD1W1BWZIjP+4O9fCxw9ahtMc7nPt76igQJRv 00Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=I/PGUuXGCq3gED0EC/G/hhh8NfgElo5rQbPCPTELbpk=; b=Rcer7K597ks/X5tb1GufG8UnbAPAxeH6wPQbfz2ITuL/ilDd9Ceqi1k2IrT/thWcW6 rJfRPToH4hfkesd6iWhm7e4uvgMwnIxhxzl/9ktBTGec2JzgyeTypfY3j0JPcColzj8E x6XFBVhN/3vrd3SSPgIk27ibn7sL46PipAojrzP7k2IfG4Dzrk1jwKgYx4D/FWbgqIzN YRDO6EaN3ppQBnmRZXPE1Tk+vM3m1toDPr0GQNvQlmpc1wRw5fWi9pWrsx8zWfPlaQUe oMcAZVuk2GcHMPq9JfZBLIgdcIzni/tF9SqufF92Ceqk5eHBKcfLVsIqjXa8gNlyKNDq wZWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=S63siA8M; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e9si8744006eja.348.2020.06.08.17.48.01; Mon, 08 Jun 2020 17:48:25 -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; dkim=pass header.i=@kernel.org header.s=default header.b=S63siA8M; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728939AbgFIAqX (ORCPT + 99 others); Mon, 8 Jun 2020 20:46:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:58622 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728211AbgFHXLi (ORCPT ); Mon, 8 Jun 2020 19:11:38 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 79A7020C56; Mon, 8 Jun 2020 23:11:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591657898; bh=87ai8exqIO0/5aKSt3LHjxMtckrsMxd+6M0b2LS5y40=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S63siA8MQS1vxdJ0GdTCOGAMlr3z7X2ELwmEXC+h2T1l1iLMSfbiATBEO+m+azcDi ZpRxJq5RrqfnsbQvz8oMi5bsbGC1Q5k2A5ExNOft0nrNsl/baAfbozAqahioNGf3uP IbnQChboyretzCeg4Ap7ck8P3z61DAdio0r4cOcw= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Xie XiuQi , Hulk Robot , Andrew Bowers , Jeff Kirsher , Sasha Levin , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.7 252/274] ixgbe: fix signed-integer-overflow warning Date: Mon, 8 Jun 2020 19:05:45 -0400 Message-Id: <20200608230607.3361041-252-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200608230607.3361041-1-sashal@kernel.org> References: <20200608230607.3361041-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xie XiuQi [ Upstream commit 3b70683fc4d68f5d915d9dc7e5ba72c732c7315c ] ubsan report this warning, fix it by adding a unsigned suffix. UBSAN: signed-integer-overflow in drivers/net/ethernet/intel/ixgbe/ixgbe_common.c:2246:26 65535 * 65537 cannot be represented in type 'int' CPU: 21 PID: 7 Comm: kworker/u256:0 Not tainted 5.7.0-rc3-debug+ #39 Hardware name: Huawei TaiShan 2280 V2/BC82AMDC, BIOS 2280-V2 03/27/2020 Workqueue: ixgbe ixgbe_service_task [ixgbe] Call trace: dump_backtrace+0x0/0x3f0 show_stack+0x28/0x38 dump_stack+0x154/0x1e4 ubsan_epilogue+0x18/0x60 handle_overflow+0xf8/0x148 __ubsan_handle_mul_overflow+0x34/0x48 ixgbe_fc_enable_generic+0x4d0/0x590 [ixgbe] ixgbe_service_task+0xc20/0x1f78 [ixgbe] process_one_work+0x8f0/0xf18 worker_thread+0x430/0x6d0 kthread+0x218/0x238 ret_from_fork+0x10/0x18 Reported-by: Hulk Robot Signed-off-by: Xie XiuQi Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/ixgbe/ixgbe_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c index 0bd1294ba517..39c5e6fdb72c 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c @@ -2243,7 +2243,7 @@ s32 ixgbe_fc_enable_generic(struct ixgbe_hw *hw) } /* Configure pause time (2 TCs per register) */ - reg = hw->fc.pause_time * 0x00010001; + reg = hw->fc.pause_time * 0x00010001U; for (i = 0; i < (MAX_TRAFFIC_CLASS / 2); i++) IXGBE_WRITE_REG(hw, IXGBE_FCTTV(i), reg); -- 2.25.1