Files
linux/drivers/char
Jason Wang b477d6bb11 UPSTREAM: virtio_console: validate max_nr_ports before trying to use it
We calculate nr_ports based on the max_nr_ports:

nr_queues = use_multiport(portdev) ? (nr_ports + 1) * 2 : 2;

If the device advertises a large max_nr_ports, we will end up with a
integer overflow. Fixing this by validating the max_nr_ports and fail
the probe for invalid max_nr_ports in this case.

Cc: Amit Shah <amit@kernel.org>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Link: https://lore.kernel.org/r/20211019070152.8236-3-jasowang@redhat.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 28962ec595)
Bug: 196772804
Signed-off-by: Keir Fraser <keirf@google.com>
Change-Id: Idb5462a1268d2bde5f867f5455da0957ca68035a
2022-03-08 09:46:52 +00:00
..
2018-06-05 11:24:55 -07:00
2020-08-31 07:17:17 +02:00
2020-03-19 07:41:02 +01:00
2020-09-07 10:46:35 +02:00
2022-02-23 12:26:12 +01:00