Skip to contentSkip to conversation

Patch "drm: Reject getfb for multi-plane framebuffers" has been added to the 4.15-stable tree

PATCH [email protected] 1 participant 1 message Mar 25, 2018

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

drm: Reject getfb for multi-plane framebuffers

to the 4.15-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
drm-reject-getfb-for-multi-plane-framebuffers.patch
and it can be found in the queue-4.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From b24791fe00f8b089d5b10cb7bcc4e1ae88b4831b Mon Sep 17 00:00:00 2001

From: Daniel Stone <[email protected]>
Date: Tue, 20 Mar 2018 22:58:39 +0000
Subject: drm: Reject getfb for multi-plane framebuffers

From: Daniel Stone <[email protected]>

commit b24791fe00f8b089d5b10cb7bcc4e1ae88b4831b upstream.

getfb can only return a single plane, so reject attempts to use it with multi-plane framebuffers.

Fixes 308e5bcbdb10 ("drm: add an fb creation ioctl that takes a pixel format v5")

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105518

---
 drivers/gpu/drm/drm_framebuffer.c |    7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/drm_framebuffer.c +7 -0
@@ -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;

Patches currently in stable-queue which might be from [email protected] are

queue-4.15/drm-reject-getfb-for-multi-plane-framebuffers.patch