Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame^] | 1 | CVE: CVE-2021-3544 |
| 2 | Upstream-Status: Backport |
| 3 | Signed-off-by: Ross Burton <ross.burton@arm.com> |
| 4 | |
| 5 | From 86dd8fac2acc366930a5dc08d3fb1b1e816f4e1e Mon Sep 17 00:00:00 2001 |
| 6 | From: Li Qiang <liq3ea@163.com> |
| 7 | Date: Sat, 15 May 2021 20:03:57 -0700 |
| 8 | Subject: [PATCH 2/7] vhost-user-gpu: fix resource leak in |
| 9 | 'vg_resource_create_2d' (CVE-2021-3544) |
| 10 | MIME-Version: 1.0 |
| 11 | Content-Type: text/plain; charset=UTF-8 |
| 12 | Content-Transfer-Encoding: 8bit |
| 13 | |
| 14 | Call 'vugbm_buffer_destroy' in error path to avoid resource leak. |
| 15 | |
| 16 | Fixes: CVE-2021-3544 |
| 17 | Reported-by: Li Qiang <liq3ea@163.com> |
| 18 | Reviewed-by: Prasad J Pandit <pjp@fedoraproject.org> |
| 19 | Signed-off-by: Li Qiang <liq3ea@163.com> |
| 20 | Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> |
| 21 | Message-Id: <20210516030403.107723-3-liq3ea@163.com> |
| 22 | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> |
| 23 | --- |
| 24 | contrib/vhost-user-gpu/vhost-user-gpu.c | 1 + |
| 25 | 1 file changed, 1 insertion(+) |
| 26 | |
| 27 | diff --git a/contrib/vhost-user-gpu/vhost-user-gpu.c b/contrib/vhost-user-gpu/vhost-user-gpu.c |
| 28 | index f73f292c9f..b5e153d0d6 100644 |
| 29 | --- a/contrib/vhost-user-gpu/vhost-user-gpu.c |
| 30 | +++ b/contrib/vhost-user-gpu/vhost-user-gpu.c |
| 31 | @@ -349,6 +349,7 @@ vg_resource_create_2d(VuGpu *g, |
| 32 | g_critical("%s: resource creation failed %d %d %d", |
| 33 | __func__, c2d.resource_id, c2d.width, c2d.height); |
| 34 | g_free(res); |
| 35 | + vugbm_buffer_destroy(&res->buffer); |
| 36 | cmd->error = VIRTIO_GPU_RESP_ERR_OUT_OF_MEMORY; |
| 37 | return; |
| 38 | } |
| 39 | -- |
| 40 | 2.25.1 |
| 41 | |