Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp992985ybt; Fri, 19 Jun 2020 20:53:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWzbnI3/9LiCD0SjNTSBpyOx08Mv9JZtbDme0GBm+SVV0D+c0a5fgiaXBy4qDb5bD0uj1g X-Received: by 2002:a05:6402:745:: with SMTP id p5mr5258568edy.199.1592625216769; Fri, 19 Jun 2020 20:53:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592625216; cv=none; d=google.com; s=arc-20160816; b=Ebu40EvOgmIqnGvGtWseTorTODmg0UAWthQk95RjEz3BMcqK1GpXt8ye03MdP93PWv ec60Rrzok0mddpsiGpzuY6kDnr/BKnWKQBwMTez6AlLWauwM0uTG/7S4GmmWb6r/G9qJ 1ld5vHCFaoqVzCDD0MZA1qaeg5X4B3r0i3aAJvuuE7FSV1VPLs0F3oDLcSBAZK11NcvU WdnSM+pQYu1oi6rJTtYfQ4tsRMAfoBshdrmpkw1Tt7/KpPMSjsvNZieUsm2OA2m8xCfB 7q4iXTHVJ7WX3L83GHV6+TWN1FPyFb8qprwGcKdJFk/yJHhES8+nOanx2QQsQEoDh0m4 5PBg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=I/PGUuXGCq3gED0EC/G/hhh8NfgElo5rQbPCPTELbpk=; b=fagcueR584Ii1oVZNnAfXDI45dH7Lbiqulox5rkuoM9E9NjPEVp2a5chPhiI6Fh5JE BUTa8yxGqcFvWaZ3Fuu8Te23z8pSQmxlNV5JO2KWgO6hL3Lo7lVoubvmMB6VO32PfD54 2CD86h2d6/i8qjjpBaiyVACFOC2f/r8ioUzlUrAEhVBrBrGm17kJZHwlJXBoCe8yq7gS /yFVWLLWG3y1ivQ4YlSGttPvArZil9syc7IELcLI1iays+MULyTR0or7aQuA8EiZ6LxL LMTMOFQmBDir3WbmKAAFIOILnZGOMYXvDuB3l+qZmVMskSVZbxzj5PqxjBH6d9G3+SIh iLpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="xNLi/PMe"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ol24si5060610ejb.516.2020.06.19.20.53.15; Fri, 19 Jun 2020 20:53:36 -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="xNLi/PMe"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394466AbgFSQVR (ORCPT + 99 others); Fri, 19 Jun 2020 12:21:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:57338 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389757AbgFSPAw (ORCPT ); Fri, 19 Jun 2020 11:00:52 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0587420734; Fri, 19 Jun 2020 15:00:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592578850; bh=87ai8exqIO0/5aKSt3LHjxMtckrsMxd+6M0b2LS5y40=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xNLi/PMepfel9I553W4xStHkoTq7tGNlyqdLyS+qv7WjqLWB41fMI0AUp1Bc+axnI NDhSu9Y9qGxLZrMfBuQMFDgl/RZ1KyUyPHPteQ/nnwY0CWuHP864qbhlLNzJ8tlwia IG4Br9DasIHSq6netLjVm1O1W/ZJQUo384hX8s4s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Xie XiuQi , Andrew Bowers , Jeff Kirsher , Sasha Levin Subject: [PATCH 4.19 180/267] ixgbe: fix signed-integer-overflow warning Date: Fri, 19 Jun 2020 16:32:45 +0200 Message-Id: <20200619141657.410030712@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200619141648.840376470@linuxfoundation.org> References: <20200619141648.840376470@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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