[dpdk-stable] patch 'net/virtio: fix untrusted scalar value' has been queued to LTS release 16.11.4
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Mon Oct 30 16:34:47 CET 2017
Hi,
FYI, your patch has been queued to LTS release 16.11.4
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/01/17. So please
shout if anyone has objections.
Thanks.
Kind regards,
Luca Boccassi
---
>From 2048b2fac091653be9183cf788e7df26cf22cacf Mon Sep 17 00:00:00 2001
From: Daniel Mrzyglod <danielx.t.mrzyglod at intel.com>
Date: Fri, 22 Sep 2017 17:21:49 +0200
Subject: [PATCH] net/virtio: fix untrusted scalar value
[ upstream commit 7b3249c56e29bec5f710624335bd4246c2a356fb ]
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")
Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod at intel.com>
Acked-by: Jianfeng Tan <jianfeng.tan at intel.com>
Acked-by: Yuanhan Liu <yliu at fridaylinux.org>
---
drivers/net/virtio/virtio_user/vhost_user.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/virtio/virtio_user/vhost_user.c b/drivers/net/virtio/virtio_user/vhost_user.c
index 082e8217e..6f4845b70 100644
--- a/drivers/net/virtio/virtio_user/vhost_user.c
+++ b/drivers/net/virtio/virtio_user/vhost_user.c
@@ -97,6 +97,10 @@ vhost_user_read(int fd, struct vhost_user_msg *msg)
}
sz_payload = msg->size;
+
+ if ((size_t)sz_payload > sizeof(msg->payload))
+ goto fail;
+
if (sz_payload) {
ret = recv(fd, (void *)((char *)msg + sz_hdr), sz_payload, 0);
if (ret < sz_payload) {
--
2.11.0
More information about the stable
mailing list