virtio: add the checks for descriptors chain len 20/32220/5
authorMohsin Kazmi <sykazmi@cisco.com>
Wed, 12 May 2021 12:51:29 +0000 (14:51 +0200)
committerBeno�t Ganne <bganne@cisco.com>
Mon, 17 May 2021 08:46:29 +0000 (08:46 +0000)
commit637c97c7d05813ee2cd60c07746ae6205fbb4202
tree71ffb530c6f12dea6b17c6c257f6aa143c0f9f02
parentaf97221c6ae8f08716b3de212fa111b13282f241
virtio: add the checks for descriptors chain len

Type: fix

virtio uses indirect descriptors for chain buffers.
indirect descriptor chain is mapped on a vlib_buffer_t.
Single descriptor is 16 bytes and vlib_buffer_t has
2048 bytes space. So maximum long chain can have
128 (=2048/16) indirect descriptors.

This patch adds check to make sure descriptors chain
len should not exceed 128.

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I060cfb7709568f42c9b5634527172690ce66a1a3
src/vnet/devices/virtio/device.c