vhost/crypto: fix data length check
authorFan Zhang <roy.fan.zhang@intel.com>
Mon, 28 Sep 2020 10:59:17 +0000 (11:59 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 28 Sep 2020 11:19:13 +0000 (13:19 +0200)
commite15b7c01120eccae3b0f14b80ef0ee439beb3221
treebff731c3fa1e0681ecf4aee123e031bdc2769d34
parent409c47c7c5b849b887ad9626f25c4ecdf06c9e68
vhost/crypto: fix data length check

This patch fixes the incorrect data length check to vhost crypto.
Instead of blindly accepting the descriptor length as data length, the
change compare the request provided data length and descriptor length
first. The security issue CVE-2020-14374 is not fixed alone by this
patch, part of the fix is done through:
"vhost/crypto: fix missed request check for copy mode".

CVE-2020-14374
Fixes: 3c79609fda7c ("vhost/crypto: handle virtually non-contiguous buffers")
Cc: stable@dpdk.org
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Chenbo Xia <chenbo.xia@intel.com>
lib/librte_vhost/vhost_crypto.c