Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp499950pxx; Wed, 28 Oct 2020 09:43:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwd7JkQ6tfEIysXBLussmAbClrrRmAarinMlGn+EWg9Mlo7o22fgJaTEXnLUu8rBveIdoX X-Received: by 2002:a17:906:d86:: with SMTP id m6mr7958367eji.331.1603903399353; Wed, 28 Oct 2020 09:43:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603903399; cv=none; d=google.com; s=arc-20160816; b=GPz0NUSyucVKGGYVud9JOkbl54XBDBD3DyUD446uROL6L7ZqdjsQIGVDw/jv2oMu3e DK5RgWJqZ7HiyjZGJ9FzUC9HQPLwKebUO/Af3sO7axuZbpPkfrjdwow903ksswmRLLf2 oxkEVqQ1gWFBStq7IhJ3iiw2LC5ZaPy1/ovxP3Zl71Kf7rogSgswWenRfcWI3BIEOVJu zvgkXFtpGxpn5E64HxTIxgEd0Z/gs2uOY0/caY2/FDwQ3jZU6JsBjb98GicAel+RNvET 0rpSrdt0n7fiJcib04x+cH+RuwF1fYxScamIbIQlRYxCSfX47GB/AW9r2sGoWq5eeffc KCcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YfIuEqx//zrR9pOutIHMQ0vRyGDtic38oVHhUvRJmcM=; b=pY0h3wbW1gQKoBufO6HB+eXHYaVc8+XbyYd4UEfawye0637YVKlWCn8RJ4ViuNof3K Pj3q5J6RA+twckEhQ5mtex7YfpazOwLqrhFjecMTdfUKNE7yfVOo02C2ldBXtNRr+YRp AVjk9epzPZ8IXeLe6x+XA5nZq6XwHrguPFuWeFHFGvRdR+Q0l44SirdCnBeeOq5SVzzL JhTqo2lQW8CcQvgup7NpHwt0Sn2IQKcDAvIN6pm+o1+MwWJL78Y0vyT4uGWLjB17Gsic ZTL2Y/Y+8/xzF/wJw5auNdm3y6f1Glsr7ZSqs6NF2h4RWxWMSGze8X8lH453gekNc1fd GSjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Hp5UVEJS; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e13si3955588ejq.552.2020.10.28.09.42.55; Wed, 28 Oct 2020 09:43:19 -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=Hp5UVEJS; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1818240AbgJ0RS3 (ORCPT + 99 others); Tue, 27 Oct 2020 13:18:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:56186 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1781302AbgJ0Ozd (ORCPT ); Tue, 27 Oct 2020 10:55:33 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 C0B7E2071A; Tue, 27 Oct 2020 14:55:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603810533; bh=K3jEGwLrdgANAaMUzoUcu2fC9MxVd3UElz8G4lSMyPk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Hp5UVEJSNqcvSh8EY3DYMtbpzlvx3cQ7tFiMVrV+rGSUsENlemjnXg4oSRJiJ5lZj i+RpGJ6yg8Zdl6OB7ZoEE6HU6dd3pK/tP/IKv0Ba6tdtN4ieYKOObbJWf2PKtaIs+j XEDFz1Qyixq0sJ6SYKx/X+3TJ3Xwzw1nm1wXIouk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King , Alex Deucher , Sasha Levin Subject: [PATCH 5.8 171/633] drm/amd/display: fix potential integer overflow when shifting 32 bit variable bl_pwm Date: Tue, 27 Oct 2020 14:48:34 +0100 Message-Id: <20201027135530.696278783@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King [ Upstream commit 1d5503331b12a76266049289747dfd94f1643fde ] The 32 bit unsigned integer bl_pwm is being shifted using 32 bit arithmetic and then being assigned to a 64 bit unsigned integer. There is a potential for a 32 bit overflow so cast bl_pwm to enforce a 64 bit shift operation to avoid this. Addresses-Coverity: ("unintentional integer overflow") Fixes: 3ba01817365c ("drm/amd/display: Move panel_cntl specific register from abm to panel_cntl.") Signed-off-by: Colin Ian King Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/dc/dce/dce_panel_cntl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_panel_cntl.c b/drivers/gpu/drm/amd/display/dc/dce/dce_panel_cntl.c index ebff9b1e312e5..124c081a0f2ca 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dce_panel_cntl.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_panel_cntl.c @@ -75,7 +75,7 @@ static unsigned int calculate_16_bit_backlight_from_pwm(struct dce_panel_cntl *d else bl_pwm &= 0xFFFF; - current_backlight = bl_pwm << (1 + bl_int_count); + current_backlight = (uint64_t)bl_pwm << (1 + bl_int_count); if (bl_period == 0) bl_period = 0xFFFF; -- 2.25.1