linzhecheng d434e5ac5d virtio-serial: fix heap-over-flow
Check device having the feature of VIRTIO_CONSOLE_F_EMERG_WRITE before
get config->emerg_wr. It is neccessary because sizeof(virtio_console_config)
is 8 byte if VirtIOSerial doesn't have the feature of
VIRTIO_CONSOLE_F_EMERG_WRITE(see virtio_serial_device_realize),
read/write emerg_wr will lead to heap-over-flow.

Signed-off-by: linzhecheng <linzhecheng@huawei.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2018-04-09 17:35:46 +03:00
..
2017-07-17 13:36:08 +01:00
2017-12-18 17:07:03 +03:00
2017-07-14 11:04:33 +02:00
2017-07-14 11:04:33 +02:00
2017-07-14 11:04:33 +02:00
2017-07-14 11:04:33 +02:00
2018-03-08 15:49:23 +01:00
2017-12-18 17:07:02 +03:00