Commit b8c7d7bc authored by Daniel Vetter's avatar Daniel Vetter

drm/atomic: -EACCESS for lease-denied crtc lookup

With the previous patch drm_crtc_find will return NULL when the crtc
isn't in our lease, which will then disable the plane/connector. No
longer an issue since the lessor can't escape their lease terms
anymore, but not quite great semantics yet either.

Catch this and return -EACCES, so that at least evil test cases have a
better chance of making sure the kernel works correctly.
Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190228144910.26488-8-daniel.vetter@ffwll.ch
parent 36e4523a
...@@ -539,6 +539,8 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane, ...@@ -539,6 +539,8 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane,
} else if (property == config->prop_crtc_id) { } else if (property == config->prop_crtc_id) {
struct drm_crtc *crtc = drm_crtc_find(dev, file_priv, val); struct drm_crtc *crtc = drm_crtc_find(dev, file_priv, val);
if (val && !crtc)
return -EACCES;
return drm_atomic_set_crtc_for_plane(state, crtc); return drm_atomic_set_crtc_for_plane(state, crtc);
} else if (property == config->prop_crtc_x) { } else if (property == config->prop_crtc_x) {
state->crtc_x = U642I64(val); state->crtc_x = U642I64(val);
...@@ -677,6 +679,8 @@ static int drm_atomic_connector_set_property(struct drm_connector *connector, ...@@ -677,6 +679,8 @@ static int drm_atomic_connector_set_property(struct drm_connector *connector,
if (property == config->prop_crtc_id) { if (property == config->prop_crtc_id) {
struct drm_crtc *crtc = drm_crtc_find(dev, file_priv, val); struct drm_crtc *crtc = drm_crtc_find(dev, file_priv, val);
if (val && !crtc)
return -EACCES;
return drm_atomic_set_crtc_for_connector(state, crtc); return drm_atomic_set_crtc_for_connector(state, crtc);
} else if (property == config->dpms_property) { } else if (property == config->dpms_property) {
/* setting DPMS property requires special handling, which /* setting DPMS property requires special handling, which
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment