Re: [PATCH v1 1/6] virtio console: Harden multiport against invalid host input

Alexander Shishkin
2023-01-20T15:51:52Z

"Michael S. Tsirkin" <mst@redhat.com> 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