Only allow creator to change shared buffer mask.
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>
Wed, 17 Oct 2007 08:57:12 +0000 (10:57 +0200)
committerThomas Hellstrom <thomas-at-tungstengraphics-dot-com>
Wed, 17 Oct 2007 08:59:48 +0000 (10:59 +0200)
linux-core/drm_bo.c

index bdeefec..d40be07 100644 (file)
@@ -1540,8 +1540,16 @@ int drm_bo_handle_validate(struct drm_file * file_priv, uint32_t handle,
        if (!bo) {
                return -EINVAL;
        }
-
        
+       /*
+        * Only allow creator to change shared buffer mask.
+        */
+
+       if (bo->base.owner != file_priv) {
+               flags = 0x0;
+               mask = 0x0;
+       }
+               
        ret = drm_bo_do_validate(bo, flags, mask, hint, fence_class,
                                 no_wait, rep);