Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3625496imu; Mon, 28 Jan 2019 08:03:34 -0800 (PST) X-Google-Smtp-Source: ALg8bN457/pq9Ld6r5GwSKbQsXoZ0KTnUpEZQX2iNHWyRIppVlhADMDr6jgAj/MhhkBA7emP+jeY X-Received: by 2002:a63:6ac5:: with SMTP id f188mr20518056pgc.165.1548691414755; Mon, 28 Jan 2019 08:03:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548691414; cv=none; d=google.com; s=arc-20160816; b=IcnaipieBxDmmn6BtaPQkNknQzIbpHAHOeBDGxu5SyzpMgYXARkt8t5tyYyZQpVMZ6 LRCPlVIqJOyCq/uabgUtj7pbW8WjfdqttXXejFVmWgfM94T98HjTaR3Cf38+CYWSG49V CeL0oyvnEaz0zWxTcelkvZFP+gWxlT48aoZGPcBicdSb7bNym8qemdy218Qqd0hEvdyo gP6hW/bXh6eXFi2FhcUlgsN9nXW7ALx/i7+kRm0D/ROF6OeB03eQl8MW6r+TaCAwXjk3 x/bjU8ZttzLv79GpZhQyZTyqwH/RKKLGUl+k2yRx8MCvq6G05KszKSfDBGA8jXHRCVD7 ghtQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=hNobd1wwhiro2UifUv1xsYrISgwzDZXunV2vX87srnE=; b=qcOnHMmQPkVSNPIWMNk81L+siVo4hzSmVebFvbTQC9veqzWdmaQ4vQIeWAtYadDua+ bSoOR1iSVKQ4tOXxRBpKzjptifb36HY/pOFFT6cq60eyB7uEjZPV/Rv/YzQ1m0l8ql2n bmSG8zR2x5upSl63PuIzLhRpvIY+33OAXNX9eqgJ28934lj5LYqZQqqp7LMfSsQTAVVD +JOlKugw3uF7m3yx2IeSJ1DGUxSrqvPKmjqOVANKsmENuBNn4ykUV6tzEIVuXOkgv+R6 K0aYJOjJTNSBEvefON+447XdIJjpEJtHiu4jQTuOBZHuec+kRp3uUF8D3tjPBxBpCNGE bAxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pDd9ELOL; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q127si38269178pfq.19.2019.01.28.08.03.17; Mon, 28 Jan 2019 08:03:34 -0800 (PST) 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=pDd9ELOL; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731049AbfA1QB3 (ORCPT + 99 others); Mon, 28 Jan 2019 11:01:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:46720 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730575AbfA1QB0 (ORCPT ); Mon, 28 Jan 2019 11:01:26 -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 06DCE21848; Mon, 28 Jan 2019 16:01:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548691285; bh=d/Bf4LUC8RVEHryUovEHlCKsUc+6pTOP4DFtJngc3P0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pDd9ELOLe8N//ju8MmOLtWrRbn/O/NubQI5fxP/p8hCvpH0C0sTyZ1JRtlhi+yfyU +wY/MuZquyjdfR0frnNtA9cLRnSwBG1CsU4lEcR89/p9XtvMk+DdYIA+yYrybUNIuv WmfZU0ce2z4P+C64Jsjp3rn8tpCohsWtyX5gjbFU= 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.19 046/258] drm/rockchip: fix for mailbox read size Date: Mon, 28 Jan 2019 10:55:52 -0500 Message-Id: <20190128155924.51521-46-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190128155924.51521-1-sashal@kernel.org> References: <20190128155924.51521-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