[PATCH v2 4/4] drm/virtio: Add memory barriers for capset cache.

2019-06-10 Thread davidriley
From: David Riley After data is copied to the cache entry, atomic_set is used indicate that the data is the entry is valid without appropriate memory barriers. Similarly the read side was missing the corresponding memory barriers. Signed-off-by: David Riley ---

[PATCH v2 3/4] drm/virtio: Fix cache entry creation race.

2019-06-10 Thread davidriley
From: David Riley virtio_gpu_cmd_get_capset would check for the existence of an entry under lock. If it was not found, it would unlock and call virtio_gpu_cmd_get_capset to create a new entry. The new entry would be added it to the list without checking if it was added by another task during

[PATCH v2 2/4] drm/virtio: Wake up all waiters when capset response comes in.

2019-06-10 Thread davidriley
From: David Riley If multiple callers occur simultaneously, wake them all up. Signed-off-by: David Riley --- drivers/gpu/drm/virtio/virtgpu_vq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_vq.c b/drivers/gpu/drm/virtio/virtgpu_vq.c index

[PATCH v2 1/4] drm/virtio: Ensure cached capset entries are valid before copying.

2019-06-10 Thread davidriley
From: David Riley virtio_gpu_get_caps_ioctl could return success with invalid data if a second caller to the function occurred after the entry was created in virtio_gpu_cmd_get_capset but prior to the virtio_gpu_cmd_capset_cb callback being called. This could leak contents of memory as well

[PATCH v2 0/4] drm/virtio: Ensure cached capset entries are valid before copying.

2019-06-10 Thread davidriley
From: David Riley v2: Updated barriers. David Riley (4): drm/virtio: Ensure cached capset entries are valid before copying. drm/virtio: Wake up all waiters when capset response comes in. drm/virtio: Fix cache entry creation race. drm/virtio: Add memory barriers for capset cache.

[PATCH 4/4] drm/virtio: Add memory barriers for capset cache.

2019-06-05 Thread davidriley
From: David Riley After data is copied to the cache entry, atomic_set is used indicate that the data is the entry is valid without appropriate memory barriers. Similarly the read side was missing the same memory barries. Signed-off-by: David Riley --- drivers/gpu/drm/virtio/virtgpu_ioctl.c |

[PATCH 2/4] drm/virtio: Wake up all waiters when capset response comes in.

2019-06-05 Thread davidriley
From: David Riley If multiple callers occur simultaneously, wake them all up. Signed-off-by: David Riley --- drivers/gpu/drm/virtio/virtgpu_vq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_vq.c b/drivers/gpu/drm/virtio/virtgpu_vq.c index

[PATCH 1/4] drm/virtio: Ensure cached capset entries are valid before copying.

2019-06-05 Thread davidriley
From: David Riley virtio_gpu_get_caps_ioctl could return success with invalid data if a second caller to the function occurred after the entry was created in virtio_gpu_cmd_get_capset but prior to the virtio_gpu_cmd_capset_cb callback being called. This could leak contents of memory as well

[PATCH 3/4] drm/virtio: Fix cache entry creation race.

2019-06-05 Thread davidriley
From: David Riley virtio_gpu_cmd_get_capset would check for the existence of an entry under lock. If it was not found, it would unlock and call virtio_gpu_cmd_get_capset to create a new entry. The new entry would be added it to the list without checking if it was added by another task during