net/virtio: fix untrusted scalar value
authorDaniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Fri, 22 Sep 2017 15:21:49 +0000 (17:21 +0200)
committerYuanhan Liu <yliu@fridaylinux.org>
Tue, 10 Oct 2017 13:52:27 +0000 (15:52 +0200)
commit7b3249c56e29bec5f710624335bd4246c2a356fb
treedb07cbbdffcd25253962dab89de95747d20e1bc3
parent16e48c9ed71d2160ccd7ade231b386638613fc82
net/virtio: fix untrusted scalar value

The unscrutinized value may be incorrectly assumed to be within a certain
range by later operations.

In vhost_user_read: An unscrutinized value from an untrusted source used
in a trusted context - the value of sz_payload may be harmfull and we need
limit them to the max value of payload.

Coverity issue: 139601
Fixes: 6a84c37e3975 ("net/virtio-user: add vhost-user adapter layer")
Cc: stable@dpdk.org
Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
drivers/net/virtio/virtio_user/vhost_user.c