vhost: check header for legacy dequeue offload
authorXiao Wang <xiao.w.wang@intel.com>
Mon, 21 Jun 2021 08:21:04 +0000 (16:21 +0800)
committerChenbo Xia <chenbo.xia@intel.com>
Wed, 21 Jul 2021 05:56:13 +0000 (07:56 +0200)
commit706ba48665844b859fcf0bd9526ec5da28b915da
tree457c6400350d8aa01fdbf3fc8ee9140bf59f9824
parentdfee779a0983f65f14cb63a1d12cf49af5e5d539
vhost: check header for legacy dequeue offload

When parsing the virtio net header and packet header for dequeue offload,
we need to perform sanity check on the packet header to ensure:
  - No out-of-boundary memory access.
  - The packet header and virtio_net header are valid and aligned.

Fixes: d0cf91303d73 ("vhost: add Tx offload capabilities")
Cc: stable@dpdk.org
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
lib/vhost/virtio_net.c