Received: by 10.213.65.68 with SMTP id h4csp882658imn; Tue, 27 Mar 2018 10:31:18 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+cLO1heN6I/ShJ/BxbA/fP3sis4PfdAn2IBWp80H8zz7CoifFUKVQqGYG3Qiy8ClDv1FMF X-Received: by 10.99.132.72 with SMTP id k69mr127928pgd.367.1522171878275; Tue, 27 Mar 2018 10:31:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522171878; cv=none; d=google.com; s=arc-20160816; b=WcoG6hCqrXXOo8RcRI2ZIqatlRNXUzH7m0h60bO4jcMKsWPPvuyf7ZAPK3dkrNUbet Hg0goinXWDIN1OEcSkCjqxmEJ4tw9UT/60HLi+F0GgLmrjij0jZOD7GU9AO0GyJQHJjE zbEbWYudpgjfci+I8WM5U2mtU959SPd1/mObGpAUrPI83rTtzcl/8irk6TUKA7kscnP7 srd2mrdV9VI1c3n8Afs0Dwkj7WmH9ym3Z8cwAYdKFPrGv7XG3MihIm2jmjxT4GRmfPov 0/7il0wHcCy/5jMX7K68V2rLpCrGXufO5hOAlsZneluOxTGoXz7Rrpy5SmEkItZn6I2L 12Vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=ZCsyUMXV6yvUBP5m00WCRPteo0JfCBbh420Zz4kVYmM=; b=qRrDWYKg91hljFoZd0CZIOI3lf5GaO+VSN05JpPITQddE5kJ1BT1ZFSu7N+f+YrpWc fuNbyXp+PpEn6GHc7C/smhigk9Uk4VhqCOjvyvf8wjE45279inrf0jKO8LuY3Au4kbo6 GumlFW3p2iGkneON+FfgidEQPsO7tw7Y15OVtcoTkTgwHCa/bVhOZn3Bop7mDRIxmtRp wWJ453m9YOwASypM3KfWvQnWU3LXRmTQskFIaLgvtJB4TVcZDNHXqUyOWjufAP16B8+M aFSeN6xB9DJWX8OVmAd2CHH6xuwI/lh8/2J4OjaOhk80fcpKWu0I/jtd7xl2on6sFY8C jkLA== ARC-Authentication-Results: i=1; mx.google.com; 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 f22si1118181pga.497.2018.03.27.10.31.03; Tue, 27 Mar 2018 10:31:18 -0700 (PDT) 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; 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 S1754665AbeC0QgO (ORCPT + 99 others); Tue, 27 Mar 2018 12:36:14 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:45668 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751486AbeC0QgM (ORCPT ); Tue, 27 Mar 2018 12:36:12 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 3D1EE40C; Tue, 27 Mar 2018 16:36:12 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Stone , Daniel van Vugt , Rob Clark , Daniel Vetter Subject: [PATCH 4.14 056/101] drm: Reject getfb for multi-plane framebuffers Date: Tue, 27 Mar 2018 18:27:28 +0200 Message-Id: <20180327162753.435586616@linuxfoundation.org> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180327162749.993880276@linuxfoundation.org> References: <20180327162749.993880276@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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. ------------------ From: Daniel Stone commit b24791fe00f8b089d5b10cb7bcc4e1ae88b4831b upstream. getfb can only return a single plane, so reject attempts to use it with multi-plane framebuffers. Signed-off-by: Daniel Stone Reported-by: Daniel van Vugt Reviewed-by: Rob Clark Reviewed-by: Daniel Vetter Fixes: 308e5bcbdb10 ("drm: add an fb creation ioctl that takes a pixel format v5") Cc: stable@vger.kernel.org # v3.3+ Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105518 Link: https://patchwork.freedesktop.org/patch/msgid/20180320225839.30905-1-daniels@collabora.com Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/drm_framebuffer.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/drivers/gpu/drm/drm_framebuffer.c +++ b/drivers/gpu/drm/drm_framebuffer.c @@ -458,6 +458,12 @@ int drm_mode_getfb(struct drm_device *de if (!fb) return -ENOENT; + /* Multi-planar framebuffers need getfb2. */ + if (fb->format->num_planes > 1) { + ret = -EINVAL; + goto out; + } + r->height = fb->height; r->width = fb->width; r->depth = fb->format->depth; @@ -481,6 +487,7 @@ int drm_mode_getfb(struct drm_device *de ret = -ENODEV; } +out: drm_framebuffer_put(fb); return ret;