Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2649397imj; Mon, 11 Feb 2019 06:27:44 -0800 (PST) X-Google-Smtp-Source: AHgI3IaNLK3EiubzPW1OxmW+VwvZI9W9qbcys1AbIfzGeN01NYl4nYahHe/rVhf+kgDNbWRxOojC X-Received: by 2002:a63:ae0e:: with SMTP id q14mr18774446pgf.151.1549895264568; Mon, 11 Feb 2019 06:27:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549895264; cv=none; d=google.com; s=arc-20160816; b=LqHNNai2ps72VGpny/a/bnbX5pAoU5+W1Na80XPMgzeQ/aTZm3xj6sX4/dreFM6ncS TNKB1KhBEoELPHQz82NSbnBhCcOkzp+6X7PQM7ufnPxsOuI2WS8/FK7p7SkKq3ZyUSzp jN/6BY4VjNU/DmZo9//HV2mIYY+tbQFFO5NnLx/4e8cDAYKWRJvmSfrOasWYq2LSgvBW 5pWA/H/C5sJ2lV2ql80gB1TRZnC1vKv7NNx0K4dw8Pba+y+izeXrlTFWguxb6Lf19LRq GVUdmTjUgTefgjhGRDa38DdlpLES4hTGfHPj4b9/pqt9NZTp7ATy9P9vHWLnzhXgSPfz Lxbg== 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=FOtTsp3ADAo1Dx92NVMhLDJZj413gdiUweAI1T08/Jw=; b=04P/VzEKjDPAMowg+RNeGDJH7yvBpdrxu0ikr0TCVwHrIw1V6/sRN1PnsKaofG8PF1 RbSr03o18o8mIyW94Y8iHgXmz/xZiOJFWFRcCam4YeiwahpeVAL28ZdtgiHMCWpS3XFU htImaRkAFGu+pj0uhOrfmaVN2r/trxhyzgMxMkrfY8icnLEyCrqS6NBYbmwdXUhN0L3P UWra1p9knu230gRET5A6i+jqvhJ4ZJ9Al6V/QoVjy8VHtyCaM/NkPvWnOhyHqri6FlkB ZJzwHZEBu2FfrZTFfVZQlqIF+LjEdxLhTzXSn2102MAqaIgOsEdSQKX9lnByYMOZ1p7d T/hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ndCjtXrj; 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 130si6610895pfy.262.2019.02.11.06.27.28; Mon, 11 Feb 2019 06:27:44 -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=ndCjtXrj; 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 S1729153AbfBKOYV (ORCPT + 99 others); Mon, 11 Feb 2019 09:24:21 -0500 Received: from mail.kernel.org ([198.145.29.99]:57518 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727835AbfBKOYT (ORCPT ); Mon, 11 Feb 2019 09:24:19 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.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 8E93220821; Mon, 11 Feb 2019 14:24:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895059; bh=W90p2QLKJQzrqmsJ2M9k4fyB0EfsuLvZGGTsqYeOyq8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ndCjtXrjy2I8oKUF4ewXj1J8P/D3lFJLJ/UN1RF5AWpiOQSzmoF8DL6TzzCOSimZa 4BUOHG7zRiu4Ah+ujL8pCFWTxf6gAgY6xpK5cz6fQajUXo8yeWlqgaRzw8aqMB43CV gCNCOXIYQP6Jiani6nx5cTC4XvJUEp84ZPndlEcM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Damian Kos , Heiko Stuebner , Sasha Levin Subject: [PATCH 4.20 047/352] drm/rockchip: fix for mailbox read size Date: Mon, 11 Feb 2019 15:14:34 +0100 Message-Id: <20190211141849.271286570@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ 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