dm: validate input of virtio_console_control_tx()
this patch validates input of virtio_console_control_tx() function to avoid potential progream crash with malicious input from guest. Tracked-On: #6851 Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
This commit is contained in:
parent
a085b1eaaf
commit
0940b35340
|
@ -283,6 +283,9 @@ virtio_console_control_tx(struct virtio_console_port *port, void *arg,
|
|||
console = port->console;
|
||||
ctrl = (struct virtio_console_control *)iov->iov_base;
|
||||
|
||||
if ((console == NULL) || (ctrl == NULL))
|
||||
return;
|
||||
|
||||
switch (ctrl->event) {
|
||||
case VIRTIO_CONSOLE_DEVICE_READY:
|
||||
console->ready = true;
|
||||
|
|
Loading…
Reference in New Issue