Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp848903ybi; Fri, 12 Jul 2019 05:40:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqzDK0PuQqaIhanQjXXkGa3deG6EJuxy17Cxf/twOTAxt1k6xO50a36yv8GO0vPJNzHptDKe X-Received: by 2002:a17:90a:bb01:: with SMTP id u1mr11369244pjr.92.1562935205829; Fri, 12 Jul 2019 05:40:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562935205; cv=none; d=google.com; s=arc-20160816; b=W2GO0901uDp/i96sD4ALE1zOu2RW97ceXqm73qwTzGjZlXWzpUug8XiBJ+274j9hjm nkYNftl/QRLaIGLHBi+vckS3ac98oRc/Wg1aI6OUfv6is83E9bs+zgkky2ddUii6F4s4 0z5P3ubo4263QJN2ZotG2rwn/hkZcCTC6swa1vTZIx7v42VZ+u3jDRUXeHcoSPyLzoeR GdyeZbgILwA2JcII7o4P6tTAZFodPT9FhhE2iqKAEhcc+HntLKXh62UpBnwpWRTU4/hA ZF9PeFsXjm44PFVuFbE625gdOTsqJ/+wNcgLvf4JKZDXumA1B1zuQpveWR0nJdO3E0dS fkZw== 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=+LSDKjJz75QBs2LCGPRYsdAhz3eide6e4pmD38rdIjw=; b=QnMNZwO6OZhCqIVCjbfp9u/pRaQx8IvBB/pJmh8wSuVQCCc6LJV4QWarYd5TH0oYfZ 7oUnL9T52dgDMuvRyIa1/e9MR+PKHgKLHH3S1qSdPw0atGfXzGapOM7bbmEi51dkrVPv 1y1kc1zQqsUXCZQ3GYpmYTk58+Tvh84SFJv/ny5DV5rJr6PYQ9Mlxuv4968J7gByc+R+ /6EmcA+6vjKOl/fjrKel775NcufXdwAyOI2YIE9bRaFDjItIwjKHp4JDH0kHVTXI5NiR /3bYeWNaAw5o+qq4HRco8SLWb8T9AaAa7nl5b7GiPfcTFjYC7ZXnOAHYMRBL4qxESm93 3tPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NM0AI47K; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bj12si7310633plb.378.2019.07.12.05.39.50; Fri, 12 Jul 2019 05:40:05 -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; dkim=pass header.i=@kernel.org header.s=default header.b=NM0AI47K; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729256AbfGLMaw (ORCPT + 99 others); Fri, 12 Jul 2019 08:30:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:46906 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728362AbfGLMat (ORCPT ); Fri, 12 Jul 2019 08:30:49 -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 66B7A208E4; Fri, 12 Jul 2019 12:30:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562934648; bh=rXRNbh8gFJXrcUfJ44byTu2hgd8LB8LUIugDhTjpGEc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NM0AI47KN670ZNr0v2J4BfpBssvDZxi1AOy17MbXjlkzyFW91jXf3nHxyIYFn5z4f vk4UFXYCRtJG+OH7k0A7FdezJsgDaWui6IUSNTUiuwBJDyJ58Rcfx9sFAwaxPGW1wh YD+pxQC9GzTgafS0PHf3dJWU5HR/0fKg760U32LY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King , Dan Carpenter , "David S. Miller" , Sasha Levin Subject: [PATCH 5.1 081/138] net: lio_core: fix potential sign-extension overflow on large shift Date: Fri, 12 Jul 2019 14:19:05 +0200 Message-Id: <20190712121631.844221707@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190712121628.731888964@linuxfoundation.org> References: <20190712121628.731888964@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 [ Upstream commit 9476274093a0e79b905f4cd6cf6d149f65e02c17 ] Left shifting the signed int value 1 by 31 bits has undefined behaviour and the shift amount oq_no can be as much as 63. Fix this by using BIT_ULL(oq_no) instead. Addresses-Coverity: ("Bad shift operation") Fixes: f21fb3ed364b ("Add support of Cavium Liquidio ethernet adapters") Signed-off-by: Colin Ian King Reviewed-by: Dan Carpenter Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/cavium/liquidio/lio_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/cavium/liquidio/lio_core.c b/drivers/net/ethernet/cavium/liquidio/lio_core.c index 1c50c10b5a16..d7e805749a5b 100644 --- a/drivers/net/ethernet/cavium/liquidio/lio_core.c +++ b/drivers/net/ethernet/cavium/liquidio/lio_core.c @@ -964,7 +964,7 @@ static void liquidio_schedule_droq_pkt_handlers(struct octeon_device *oct) if (droq->ops.poll_mode) { droq->ops.napi_fn(droq); - oct_priv->napi_mask |= (1 << oq_no); + oct_priv->napi_mask |= BIT_ULL(oq_no); } else { tasklet_schedule(&oct_priv->droq_tasklet); } -- 2.20.1