vhost: fix batch dequeue potential buffer overflow
authorMarvin Liu <yong.liu@intel.com>
Wed, 31 Mar 2021 06:49:39 +0000 (14:49 +0800)
committerChenbo Xia <chenbo.xia@intel.com>
Wed, 31 Mar 2021 07:34:17 +0000 (09:34 +0200)
commitaf584d21bf66047e36ad3b9ccdcfd83ecdccd5db
tree0e379629c9aae636b73e89cf39a0321f0d0ff174
parent93ed2f49dec5bee1dfc221c8644c22b351496776
vhost: fix batch dequeue potential buffer overflow

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

Fixes: 75ed51697820 ("vhost: add packed ring batch dequeue")
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