From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98444C282C8 for ; Mon, 28 Jan 2019 17:48:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6432320881 for ; Mon, 28 Jan 2019 17:48:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548697722; bh=d/Bf4LUC8RVEHryUovEHlCKsUc+6pTOP4DFtJngc3P0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=poWVbOAOgraEhLgcL+DQgIP6GGOhepLTA2N2RGDgVBAjZpxVhUrmfbKkucnbdAC29 c77o8Wrhr52PtyoNA577lN0NT0zYmAboL2Pb7L3Uw70w3OFHKPjYDjxa9mV0ZjYy5p 2tT6LQF/fLhQxZ6dZGBgczqTpJ3ee2BjjPgHwfj4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728079AbfA1Rsk (ORCPT ); Mon, 28 Jan 2019 12:48:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:58850 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727781AbfA1Pp2 (ORCPT ); Mon, 28 Jan 2019 10:45:28 -0500 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 A7C062177B; Mon, 28 Jan 2019 15:45:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548690328; bh=d/Bf4LUC8RVEHryUovEHlCKsUc+6pTOP4DFtJngc3P0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q6+egxLWLxetWGdHHRWe7i231dj9mGPpY52iShfdoko0yCGvrHrMxZ/uORojQeD/c LLAp1kL9nADBr++4MijmBJkXADJ3Rr+e45HCx/JeAw6JY8fA5KMmK4qTOwqYOlVunY pKJrCaZhSpeto5cccLIYLdyad6Yd7jbDIa5ZWVTY= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Damian Kos , Heiko Stuebner , Sasha Levin , dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org Subject: [PATCH AUTOSEL 4.20 053/304] drm/rockchip: fix for mailbox read size Date: Mon, 28 Jan 2019 10:39:30 -0500 Message-Id: <20190128154341.47195-53-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190128154341.47195-1-sashal@kernel.org> References: <20190128154341.47195-1-sashal@kernel.org> MIME-Version: 1.0 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: Damian Kos [ Upstream commit fa68d4f8476bea4cdf441062b614b41bb85ef1da ] Some of the functions (like cdn_dp_dpcd_read, cdn_dp_get_edid_block) allow to read 64KiB, but the cdn_dp_mailbox_read_receive, that is used by them, can read only up to 255 bytes at once. Normally, it's not a big issue as DPCD or EDID reads won't (hopefully) exceed that value. The real issue here is the revocation list read during the HDCP authentication process. (problematic use case: https://chromium.googlesource.com/chromiumos/third_party/kernel/+/chromeos-4.4/drivers/gpu/drm/rockchip/cdn-dp-reg.c#1152) The list can reach 127*5+4 bytes (num devs * 5 bytes per ID/Bksv + 4 bytes of an additional info). In other words - CTSes with HDCP Repeater won't pass without this fix. Oh, and the driver will most likely stop working (best case scenario). Signed-off-by: Damian Kos Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/1541518625-25984-1-git-send-email-dkos@cadence.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/rockchip/cdn-dp-reg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/cdn-dp-reg.c b/drivers/gpu/drm/rockchip/cdn-dp-reg.c index 3105965fc260..5a485489a1e2 100644 --- a/drivers/gpu/drm/rockchip/cdn-dp-reg.c +++ b/drivers/gpu/drm/rockchip/cdn-dp-reg.c @@ -147,7 +147,7 @@ static int cdn_dp_mailbox_validate_receive(struct cdn_dp_device *dp, } static int cdn_dp_mailbox_read_receive(struct cdn_dp_device *dp, - u8 *buff, u8 buff_size) + u8 *buff, u16 buff_size) { u32 i; int ret; -- 2.19.1