diff options
author | Marek Olšák <[email protected]> | 2017-06-27 19:32:48 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-07-04 15:40:37 +0200 |
commit | 03c5ef195df4972d864d84c0ffaf917505afc13d (patch) | |
tree | 46a280e591042b394e3f0a4db9eec0c488509574 /src/gallium/winsys/radeon/drm | |
parent | 047c34f0ac6ebd55c2f408f743fc4b0a9e4848a9 (diff) |
gallium/radeon: disallow exports of sparse and suballocated BOs
I think it's unsafe, because the slabs can reuse exported storage.
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/winsys/radeon/drm')
-rw-r--r-- | src/gallium/winsys/radeon/drm/radeon_drm_bo.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c index e79c2b7da47..0354e200ebf 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c +++ b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c @@ -1290,10 +1290,9 @@ static bool radeon_winsys_bo_get_handle(struct pb_buffer *buffer, struct radeon_bo *bo = radeon_bo(buffer); struct radeon_drm_winsys *ws = bo->rws; - if (!bo->handle) { - offset += bo->va - bo->u.slab.real->va; - bo = bo->u.slab.real; - } + /* Don't allow exports of slab entries. */ + if (!bo->handle) + return false; memset(&flink, 0, sizeof(flink)); |