net/virtio-user: fix overflow
authorWenfeng Liu <liuwf@arraynetworks.com.cn>
Tue, 14 Mar 2017 10:09:56 +0000 (10:09 +0000)
committerYuanhan Liu <yuanhan.liu@linux.intel.com>
Sat, 1 Apr 2017 06:58:54 +0000 (08:58 +0200)
commit2269b9aec50de0da9aa4b26805f8f6ed20b3ee39
tree8c36735ae5557bd0d0717fd40260d0f880503056
parent250c99651a774d6e2d02ee90aa33a07a1ea6fc0b
net/virtio-user: fix overflow

virtio-user limits the qeueue number to 8 but provides no limit
check against the queue number input from user. If a bigger queue
number (> 8) is given, there is an overflow issue. Doing a sanity
check could avoid it.

Fixes: 37a7eb2ae816 ("net/virtio-user: add device emulation layer")
Cc: stable@dpdk.org
Signed-off-by: Wenfeng Liu <liuwf@arraynetworks.com.cn>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
drivers/net/virtio/virtio_pci.h
drivers/net/virtio/virtio_user/virtio_user_dev.c
drivers/net/virtio/virtio_user/virtio_user_dev.h
drivers/net/virtio/virtio_user_ethdev.c