Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4078511ybg; Fri, 25 Oct 2019 13:01:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqzlnLgjNZtu7TBM84OAjPM3qI/QvrbwD7/U+B6AREGfjgdRXUPdJANPousZpjaYjJGifAuD X-Received: by 2002:a17:906:386:: with SMTP id b6mr5107383eja.148.1572033676920; Fri, 25 Oct 2019 13:01:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572033676; cv=none; d=google.com; s=arc-20160816; b=SIAY3cFKAHQHPu9d7PjKOJx1PtrxJMo93+t0YJAXf97rRJz+qaG9v65B3gyflLI8r+ l+fYeR6h68O17qA8gaXPeQJq41yUQca1QsMVl112FfuLoZxcOW/rYHcXVQ90HzitSsSM iwGdof6+sberJRJnGLv+1LqoQjEzW/mTJ5Q5bkLFmod3HdUkUPRM8kbJ2xevNBeBmdx6 znixUzJHd35xwZ7xrtWQt5trZO9Ld2vZTWP94viXbtqbJ9KcfWvsQ69Mgom600K2a9Xl itCpBEVGDbv3yXFEHjDcXqghP8hRu+P+PY/wME/gv9xk/zJp1viGTlKFaRaTmtvZlndM y+4w== 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 :message-id:date:subject:cc:to:from; bh=KlaD/BNNz8Wi9g/ezcRGksvimgI3LCGy/tYfjS/u47E=; b=fZi7rlT84u7DS9tca60gWDh/swub4xgTH2dH839EymiEJ2sLBPjxEVEDsvbI03Xw3K ZH9gLcI9EjufX08oyiQRW1FJNfvflpfKwcshBlkO1YjKc31aG+A2OoSgUMTmnUaf/Ogc kuINkKNi/CwtJC3teYz7YfgkZrCHQ+oKlFK1IzqLCZdvk0n4vCdOvWRNGj8Hp8uk/1aJ HHPCdbYsZCfaQEcNxFnidpM5v+Rp7VSx0bcQGaLJDDSCEPsJond5sFspoWfWV7DCRJtz 7c/zfkk6y+J1S54M6aiXzwggURHQIlxAM0tpD0HQOutDn5Yam0egLOerkMp0m+egPqtj zevA== 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=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t26si1894702edr.36.2019.10.25.13.00.54; Fri, 25 Oct 2019 13:01:16 -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=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2502400AbfJYL6R (ORCPT + 99 others); Fri, 25 Oct 2019 07:58:17 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:43307 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393497AbfJYL6R (ORCPT ); Fri, 25 Oct 2019 07:58:17 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iNyEN-0005rC-QD; Fri, 25 Oct 2019 11:58:11 +0000 From: Colin King To: Egor Pomozov , Igor Russkikh , "David S . Miller" , Dmitry Bezrukov , Sergey Samoilenko , netdev@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][next] net: aquantia: fix unintention integer overflow on left shift Date: Fri, 25 Oct 2019 12:58:11 +0100 Message-Id: <20191025115811.20433-1-colin.king@canonical.com> X-Mailer: git-send-email 2.20.1 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: Colin Ian King Shifting the integer value 1 is evaluated using 32-bit arithmetic and then used in an expression that expects a 64-bit value, so there is potentially an integer overflow. Fix this by using the BIT_ULL macro to perform the shift and avoid the overflow. Addresses-Coverity: ("Unintentional integer overflow") Fixes: 04a1839950d9 ("net: aquantia: implement data PTP datapath") Signed-off-by: Colin Ian King --- drivers/net/ethernet/aquantia/atlantic/aq_ptp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_ptp.c b/drivers/net/ethernet/aquantia/atlantic/aq_ptp.c index 232df785488c..3eb9d22f7402 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_ptp.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_ptp.c @@ -713,7 +713,7 @@ static int aq_ptp_poll(struct napi_struct *napi, int budget) if (work_done < budget) { napi_complete_done(napi, work_done); aq_nic->aq_hw_ops->hw_irq_enable(aq_nic->aq_hw, - 1 << aq_ptp->ptp_ring_param.vec_idx); + BIT_ULL(aq_ptp->ptp_ring_param.vec_idx)); } err_exit: -- 2.20.1