diff options
Diffstat (limited to 'meta/recipes-graphics/virglrenderer/virglrenderer/CVE-2019-18390.patch')
-rw-r--r-- | meta/recipes-graphics/virglrenderer/virglrenderer/CVE-2019-18390.patch | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/meta/recipes-graphics/virglrenderer/virglrenderer/CVE-2019-18390.patch b/meta/recipes-graphics/virglrenderer/virglrenderer/CVE-2019-18390.patch new file mode 100644 index 0000000000..ad61c95be3 --- /dev/null +++ b/meta/recipes-graphics/virglrenderer/virglrenderer/CVE-2019-18390.patch | |||
@@ -0,0 +1,66 @@ | |||
1 | From 24f67de7a9088a873844a39be03cee6882260ac9 Mon Sep 17 00:00:00 2001 | ||
2 | From: Gert Wollny <gert.wollny@collabora.com> | ||
3 | Date: Mon, 7 Oct 2019 10:59:56 +0200 | ||
4 | Subject: [PATCH] vrend: check info formats in blits | ||
5 | |||
6 | Closes #141 | ||
7 | Closes #142 | ||
8 | |||
9 | v2 : drop colon in error description (Emil) | ||
10 | |||
11 | Signed-off-by: Gert Wollny <gert.wollny@collabora.com> | ||
12 | Reviewed-by: Emil Velikov <emil.velikov@collabora.com> | ||
13 | |||
14 | Upstream-Status: Backport | ||
15 | [https://gitlab.freedesktop.org/virgl/virglrenderer/commit/24f67de7a9088a873844a39be03cee6882260ac9] | ||
16 | CVE: CVE-2019-18390 | ||
17 | Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com> | ||
18 | --- | ||
19 | src/virgl_hw.h | 1 + | ||
20 | src/vrend_renderer.c | 11 +++++++++++ | ||
21 | 2 files changed, 12 insertions(+) | ||
22 | |||
23 | diff --git a/src/virgl_hw.h b/src/virgl_hw.h | ||
24 | index 145780bf..5ccf3073 100644 | ||
25 | --- a/src/virgl_hw.h | ||
26 | +++ b/src/virgl_hw.h | ||
27 | @@ -426,6 +426,7 @@ enum virgl_ctx_errors { | ||
28 | VIRGL_ERROR_CTX_ILLEGAL_CMD_BUFFER, | ||
29 | VIRGL_ERROR_CTX_GLES_HAVE_TES_BUT_MISS_TCS, | ||
30 | VIRGL_ERROR_GL_ANY_SAMPLES_PASSED, | ||
31 | + VIRGL_ERROR_CTX_ILLEGAL_FORMAT, | ||
32 | }; | ||
33 | |||
34 | #define VIRGL_RESOURCE_Y_0_TOP (1 << 0) | ||
35 | diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c | ||
36 | index 14fefb38..aa6a89c1 100644 | ||
37 | --- a/src/vrend_renderer.c | ||
38 | +++ b/src/vrend_renderer.c | ||
39 | @@ -758,6 +758,7 @@ static const char *vrend_ctx_error_strings[] = { | ||
40 | [VIRGL_ERROR_CTX_ILLEGAL_CMD_BUFFER] = "Illegal command buffer", | ||
41 | [VIRGL_ERROR_CTX_GLES_HAVE_TES_BUT_MISS_TCS] = "On GLES context and shader program has tesselation evaluation shader but no tesselation control shader", | ||
42 | [VIRGL_ERROR_GL_ANY_SAMPLES_PASSED] = "Query for ANY_SAMPLES_PASSED not supported", | ||
43 | + [VIRGL_ERROR_CTX_ILLEGAL_FORMAT] = "Illegal format ID", | ||
44 | }; | ||
45 | |||
46 | static void __report_context_error(const char *fname, struct vrend_context *ctx, | ||
47 | @@ -8492,6 +8493,16 @@ void vrend_renderer_blit(struct vrend_context *ctx, | ||
48 | if (ctx->in_error) | ||
49 | return; | ||
50 | |||
51 | + if (!info->src.format || (enum virgl_formats)info->src.format >= VIRGL_FORMAT_MAX) { | ||
52 | + report_context_error(ctx, VIRGL_ERROR_CTX_ILLEGAL_FORMAT, info->src.format); | ||
53 | + return; | ||
54 | + } | ||
55 | + | ||
56 | + if (!info->dst.format || (enum virgl_formats)info->dst.format >= VIRGL_FORMAT_MAX) { | ||
57 | + report_context_error(ctx, VIRGL_ERROR_CTX_ILLEGAL_FORMAT, info->dst.format); | ||
58 | + return; | ||
59 | + } | ||
60 | + | ||
61 | if (info->render_condition_enable == false) | ||
62 | vrend_pause_render_condition(ctx, true); | ||
63 | |||
64 | -- | ||
65 | 2.24.1 | ||
66 | |||