vhost: validate index in inflight API
authorMaxime Coquelin <maxime.coquelin@redhat.com>
Mon, 19 Oct 2020 17:34:13 +0000 (19:34 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 3 Nov 2020 22:24:26 +0000 (23:24 +0100)
commitd2475e890307a6edd9fdfcfc83b82d543881545e
tree4833bbbb82246d4ef7cf5dcfc8627d0f69a5991f
parent943daec05c596c03471e3f9432b104eaaa2edf0f
vhost: validate index in inflight API

This patch validates the queue index parameter, in order
to ensure neither out-of-bound accesses nor NULL pointer
dereferencing happen.

Fixes: 4d891f77ddfa ("vhost: add APIs to get inflight ring")
Cc: stable@dpdk.org
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
lib/librte_vhost/vhost.c