vhost: fix packed ring potential buffer overflow
authorMarvin Liu <yong.liu@intel.com>
Wed, 31 Mar 2021 06:49:38 +0000 (14:49 +0800)
committerChenbo Xia <chenbo.xia@intel.com>
Wed, 31 Mar 2021 07:34:17 +0000 (09:34 +0200)
commit93ed2f49dec5bee1dfc221c8644c22b351496776
tree5edba5fd16898aca0ce696d56892c70d5dbb0455
parent134228ca39ef0cfe325bc5f1d0df38c733ec9752
vhost: fix packed ring potential buffer overflow

Similar as split ring, the multiple accesses of descriptor length will
lead to potential risk. One-time access of descriptor length can
eliminate this risk.

Fixes: 2f3225a7d69b ("vhost: add vector filling support for packed ring")
Cc: stable@dpdk.org
Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
lib/librte_vhost/virtio_net.c