Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2725124imj; Mon, 11 Feb 2019 07:33:22 -0800 (PST) X-Google-Smtp-Source: AHgI3IbyqmPZOhYV+d9aO/YtikLPshQlGBE//+aZnpiW33NQ4F7Hl7qIgxPvhvN3uu0NlyD2Jn6K X-Received: by 2002:a17:902:b83:: with SMTP id 3mr36590105plr.42.1549899202100; Mon, 11 Feb 2019 07:33:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549899202; cv=none; d=google.com; s=arc-20160816; b=rRhnXcEFVB3dau1x1VVL9wja3RJpRjca79Xs7Ax1zQriFHLaqlW7WZXqHBvaW+mVUq mvcMOzcifLHZ1Vo3eJutlbFqm0YzrYPBneCTAbRYEoInRKjn2IjXvgHGSiUabtc22RgQ XNXwMuDzsolltWkCF088G/Ntwyo/zW6ILOPzxL24zekOZOI9+M8dWHpMN4y49XJHqUVZ 8riZ7LI4ASGNMRp3qVobXDps0LRyqda+MgRIhDa/Qy4cgDNvMP7OppKWRGcM7aNHOEIu UODmt7OgH7jl1QHY+sbFtlESHWRj6xN5TOIskXScN4LTtdvYbH0hVmD4UzsMqqvy0esy Fxgw== 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=pcO91RZlD3u43hhfaqqjiVH5/WvCAFSMAWADAc3Gx3E=; b=NpAMuRFtE+uZ7XRGeE6UgE4l9wwCmygHAsPHHwMaeIok8IL6EkO0f93obHDdAwBwFX G68jHk6im/CtrpVDfT3OKsEz/AHrki+zhVRUYXlMO4XluOq5pme0OwbmxmaSKdqHsr2A auXwAszEaaIjuPkLj6ZlwFZVvciJHKxOUO4TD8CllloTt4+xejevGZuHqBTRGTb2kCJP D3P/jPXbn1vDs9CmWiPRYciJAsF5mFv0Tyh2+fz+MKv5stTCKXnN8GT/0tTTr4bNTCgr nHERjyNnsKSwc2EzfKfxvEwEB0K8THXz2LmaxmEDgfU9gTcd3Lo8El15CmZ96DRx6UWP fy3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yrQrhw9o; 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 1si594039plb.103.2019.02.11.07.33.06; Mon, 11 Feb 2019 07:33:22 -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=yrQrhw9o; 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 S2388920AbfBKOzJ (ORCPT + 99 others); Mon, 11 Feb 2019 09:55:09 -0500 Received: from mail.kernel.org ([198.145.29.99]:42046 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388518AbfBKOzH (ORCPT ); Mon, 11 Feb 2019 09:55:07 -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 B58DD222A6; Mon, 11 Feb 2019 14:55:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549896906; bh=cDKcoyNH60BxyY8ZaSRF56U3CTCL+7LpbKzRFmIjVWI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yrQrhw9oUW6DQYjuGYX0Q/hURP446IsJUpSFfnP1Rc0DkYK14v7CZ/0WpQ7+6eHbS pId9O6tGc4rS0U4lYDZw0CQuhKDmokeYbRUqzupog3JFzAQtsmyKKYyh4d6gqWBblC IOMR+slAHVWjHe/EWGaMG1hlKflrEVBv7demEdJ0= 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.14 027/205] drm/rockchip: fix for mailbox read size Date: Mon, 11 Feb 2019 15:17:05 +0100 Message-Id: <20190211141829.544144217@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141827.214852402@linuxfoundation.org> References: <20190211141827.214852402@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.14-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 b14d211f6c21..0ed7e91471f6 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