diff options
author | Jason Wang <[email protected]> | 2021-10-19 15:01:44 +0800 |
---|---|---|
committer | Michael S. Tsirkin <[email protected]> | 2021-11-01 05:26:48 -0400 |
commit | 28962ec595d701ec9d39369f9774895dfa408273 (patch) | |
tree | f3f44b8e7d47cf40053f364f417859c5eb8c1213 /drivers/usb/cdns3/cdns3-trace.c | |
parent | 63b4ffa4fad0b14e9ebfedd7f7bb709b1c92472f (diff) |
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 <[email protected]>
Signed-off-by: Jason Wang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Michael S. Tsirkin <[email protected]>
Diffstat (limited to 'drivers/usb/cdns3/cdns3-trace.c')
0 files changed, 0 insertions, 0 deletions