All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH libdrm] drm/atomic: Refuse to add invalid objects to requests
@ 2018-03-07 12:42 Daniel Stone
  2018-03-07 16:42 ` Daniel Vetter
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Stone @ 2018-03-07 12:42 UTC (permalink / raw)
  To: dri-devel

Object and property IDs cannot be zero. Prevent them from being added to
the request stream at all, rather than breaking at commit time.

Signed-off-by: Daniel Stone <daniels@collabora.com>
---
 xf86drmMode.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xf86drmMode.c b/xf86drmMode.c
index 15957ffc..bd59ef25 100644
--- a/xf86drmMode.c
+++ b/xf86drmMode.c
@@ -1313,6 +1313,9 @@ int drmModeAtomicAddProperty(drmModeAtomicReqPtr req,
 	if (!req)
 		return -EINVAL;
 
+	if (object_id == 0 || property_id == 0)
+		return -EINVAL;
+
 	if (req->cursor >= req->size_items) {
 		drmModeAtomicReqItemPtr new;
 
-- 
2.14.3

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH libdrm] drm/atomic: Refuse to add invalid objects to requests
  2018-03-07 12:42 [PATCH libdrm] drm/atomic: Refuse to add invalid objects to requests Daniel Stone
@ 2018-03-07 16:42 ` Daniel Vetter
  2018-03-07 17:20   ` Daniel Stone
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Vetter @ 2018-03-07 16:42 UTC (permalink / raw)
  To: Daniel Stone; +Cc: dri-devel

On Wed, Mar 07, 2018 at 12:42:15PM +0000, Daniel Stone wrote:
> Object and property IDs cannot be zero. Prevent them from being added to
> the request stream at all, rather than breaking at commit time.
> 
> Signed-off-by: Daniel Stone <daniels@collabora.com>
> ---
>  xf86drmMode.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/xf86drmMode.c b/xf86drmMode.c
> index 15957ffc..bd59ef25 100644
> --- a/xf86drmMode.c
> +++ b/xf86drmMode.c
> @@ -1313,6 +1313,9 @@ int drmModeAtomicAddProperty(drmModeAtomicReqPtr req,
>  	if (!req)
>  		return -EINVAL;
>  
> +	if (object_id == 0 || property_id == 0)
> +		return -EINVAL;

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

... and gives us a perfect spot to gdb into a backtrace and figure out wtf
is going on with drm_hwc :-)
-Daniel

> +
>  	if (req->cursor >= req->size_items) {
>  		drmModeAtomicReqItemPtr new;
>  
> -- 
> 2.14.3
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH libdrm] drm/atomic: Refuse to add invalid objects to requests
  2018-03-07 16:42 ` Daniel Vetter
@ 2018-03-07 17:20   ` Daniel Stone
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Stone @ 2018-03-07 17:20 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: dri-devel

On 7 March 2018 at 16:42, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Wed, Mar 07, 2018 at 12:42:15PM +0000, Daniel Stone wrote:
>> Object and property IDs cannot be zero. Prevent them from being added to
>> the request stream at all, rather than breaking at commit time.
>
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>
> ... and gives us a perfect spot to gdb into a backtrace and figure out wtf
> is going on with drm_hwc :-)

Heh, and pushed now. Thanks Daniel!

Cheers,
Daniel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-03-07 17:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-07 12:42 [PATCH libdrm] drm/atomic: Refuse to add invalid objects to requests Daniel Stone
2018-03-07 16:42 ` Daniel Vetter
2018-03-07 17:20   ` Daniel Stone

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.