mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-21 21:19:35 +00:00
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
1a856f121d
commit
5cbe49ab65
@ -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
Block a user