Michael S. Tsirkin ead7a57df3 ssd0323: fix buffer overun on invalid state load
CVE-2013-4538

s->cmd_len used as index in ssd0323_transfer() to store 32-bit field.
Possible this field might then be supplied by guest to overwrite a
return addr somewhere. Same for row/col fields, which are indicies into
framebuffer array.

To fix validate after load.

Additionally, validate that the row/col_start/end are within bounds;
otherwise the guest can provoke an overrun by either setting the _end
field so large that the row++ increments just walk off the end of the
array, or by setting the _start value to something bogus and then
letting the "we hit end of row" logic reset row to row_start.

For completeness, validate mode as well.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Juan Quintela <quintela@redhat.com>
2014-05-05 22:15:02 +02:00
..
2014-04-28 10:21:55 +02:00
2013-07-04 17:42:45 +02:00
2014-04-28 10:21:55 +02:00
2014-04-28 10:21:55 +02:00
2013-11-05 19:57:47 -08:00
2014-04-28 10:21:55 +02:00
2014-04-28 10:21:55 +02:00
2014-04-28 11:03:32 +02:00
2014-04-28 11:03:32 +02:00
2014-04-28 10:21:55 +02:00