<div dir="ltr">Hello David,<div><br></div><div>Could you please add this patch and other patches to the upstream?</div><div><br></div><div>Thanks.<br><div class="gmail_extra"><br><div class="gmail_quote">2016-12-28 1:08 GMT+08:00 Marc-André Lureau <span dir="ltr"><<a href="mailto:mlureau@redhat.com" target="_blank">mlureau@redhat.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-"><br>
<br>
----- Original Message -----<br>
> The 'num_elements' can be controlled by the guest but the<br>
> 'vrend_vertex_element_array' has a fixed 'elements' field.<br>
> This can cause a heap overflow. Add sanity check of 'num_elements'.<br>
><br>
> Signed-off-by: Li Qiang <<a href="mailto:liq3ea@gmail.com">liq3ea@gmail.com</a>><br>
> ---<br>
<br>
</span>Reviewed-by: Marc-André Lureau <<a href="mailto:marcandre.lureau@redhat.com">marcandre.lureau@redhat.com</a>><br>
<div class="gmail-HOEnZb"><div class="gmail-h5"><br>
> src/vrend_renderer.c | 3 +++<br>
> 1 file changed, 3 insertions(+)<br>
><br>
> diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c<br>
> index 00b61eb..32e2e7d 100644<br>
> --- a/src/vrend_renderer.c<br>
> +++ b/src/vrend_renderer.c<br>
> @@ -1656,6 +1656,9 @@ int vrend_create_vertex_elements_<wbr>state(struct<br>
> vrend_context *ctx,<br>
> if (!v)<br>
> return ENOMEM;<br>
><br>
> + if (num_elements > PIPE_MAX_ATTRIBS)<br>
> + return EINVAL;<br>
> +<br>
> v->count = num_elements;<br>
> for (i = 0; i < num_elements; i++) {<br>
> memcpy(&v->elements[i].base, &elements[i], sizeof(struct<br>
> pipe_vertex_element));<br>
> --<br>
> 2.7.4<br>
><br>
><br>
</div></div></blockquote></div><br></div></div></div>