numam-dpdk/drivers
Yuan Wang 9dc6bb0682 net/vhost: fix access to freed memory
This patch fixes heap-use-after-free reported by ASan.

It is possible for the rte_vhost_dequeue_burst() to access the vq
is freed when numa_realloc() gets called in the device running state.
The control plane will set the vq->access_lock to protected the vq
from the data plane. Unfortunately the lock will fail at the moment
the vq is freed, allowing the rte_vhost_dequeue_burst() to access
the fields of the vq, which will trigger a heap-use-after-free error.

In the case of multiple queues, the vhost pmd can access other queues
that are not ready when the first queue is ready, which makes no sense
and also allows numa_realloc() and rte_vhost_dequeue_burst() access to
vq to happen at the same time. By controlling vq->allow_queuing we can make
the pmd access only the queues that are ready.

Fixes: 1ce3c7fe14 ("net/vhost: emulate device start/stop behavior")

Signed-off-by: Yuan Wang <yuanx.wang@intel.com>
Tested-by: Wei Ling <weix.ling@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2022-05-09 21:15:38 +02:00
..
baseband baseband/acc100: avoid out-of-bounds access 2022-02-23 11:59:51 +01:00
bus bus/dpaa: remove unused thread-specific variables 2022-04-29 11:27:35 +02:00
common common/dpaax: fix short MAC-I IV calculation for ZUC 2022-04-29 11:27:35 +02:00
compress compress/octeontx: support OCTEON TX2 SoC family 2022-04-29 11:36:46 +02:00
crypto crypto/dpaa_sec: move cdb preparation to session create 2022-04-29 11:27:35 +02:00
dma dma/idxd: configure maximum batch size to high value 2022-02-23 16:45:16 +01:00
event event/dlb2: add shift value check in sparse dequeue 2022-03-03 10:25:17 +01:00
gpu gpu/cuda: add more NVIDIA devices 2022-04-14 10:01:11 +02:00
mempool mempool/cnxk: fix batch allocation failure path 2022-02-23 17:33:53 +01:00
net net/vhost: fix access to freed memory 2022-05-09 21:15:38 +02:00
raw raw/ifpga: fix build with optimization 2022-03-16 20:35:04 +01:00
regex remove extra blank line at EOF 2022-02-27 21:26:06 +01:00
vdpa common/mlx5: refactor devargs management 2022-02-21 11:36:56 +01:00
meson.build build: make ring mempool driver mandatory 2022-02-22 15:38:19 +01:00