Xie Yongji b5fba782cc virtio_console: Assure used length from device is limited
[ Upstream commit d00d8da5869a2608e97cfede094dfc5e11462a46 ]

The buf->len might come from an untrusted device. This
ensures the value would not exceed the size of the buffer
to avoid data corruption or loss.

Signed-off-by: Xie Yongji <xieyongji@bytedance.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Link: https://lore.kernel.org/r/20210525125622.1203-1-xieyongji@bytedance.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-07-20 16:16:12 +02:00
..
2018-03-14 19:13:47 +01:00
2018-06-05 11:24:55 -07:00
2019-12-13 08:50:58 +01:00
2019-10-05 13:10:11 +02:00
2018-05-16 07:23:35 +02:00
2019-12-17 20:35:13 +01:00
2021-03-04 09:39:31 +01:00
2018-06-12 16:19:22 -07:00
2018-08-02 17:16:03 +02:00