Re: [PATCH v1 1/6] virtio console: Harden multiport against invalid host input
From: Alexander Shishkin
Date: Fri Jan 20 2023 - 10:51:52 EST
"Michael S. Tsirkin" <mst@xxxxxxxxxx> writes:
> Weird. Don't we already check for that?
>
> /* Don't test MULTIPORT at all if we're rproc: not a valid feature! */
> if (!is_rproc_serial(vdev) &&
> virtio_cread_feature(vdev, VIRTIO_CONSOLE_F_MULTIPORT,
> struct virtio_console_config, max_nr_ports,
> &portdev->max_nr_ports) == 0) {
> if (portdev->max_nr_ports == 0 ||
> portdev->max_nr_ports > VIRTCONS_MAX_PORTS) {
> dev_err(&vdev->dev,
> "Invalidate max_nr_ports %d",
> portdev->max_nr_ports);
> err = -EINVAL;
> goto free;
> }
> multiport = true;
> }
Yes, I missed this earlier. I'll drop this patch.
Thanks,
--
Alex