From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id EC86A239 for ; Tue, 21 Nov 2017 14:24:59 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id A0B1620B3E; Tue, 21 Nov 2017 08:24:59 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Tue, 21 Nov 2017 08:24:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=Acd3Hjj/JQEQ8r8Yn yUev4n62OJ9SM/+n4tB5iQW/30=; b=N9Qnt83TVKHS0LH0oNRRb0lakc8p4ZCAH 3kf9Auleu8z8kcG4YG+4Wd0CySn2v03TY2khz5CllBG+CB8VQbDwZH9i2cOyk9jK EmNTxqqnR5Od1HRNuJLBt+Y71ea3pCYeKsrXHRgc508pZ/hmr0V+5i/OxHt3/chH oZTLEjiO/gsg8oENG2XwjFVc+3Dl8+v6hJYNWS8DhSepkc+DnC2i+5pouTxbjvSC c31GtUMHeLysWsH3EtUkQh/g8vlg3eyoYobkYcXs0ZZAnEykflo7SI3nVNivRsnC 8sVl0MOiu4BoSL/Ie7FMTvgIPcgTUX9n+STmJ01uWRgqmXaimM3EA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=Acd3Hjj/JQEQ8r8YnyUev4n62OJ9SM/+n4tB5iQW/30=; b=SWyuUIX2 NcqQ1d0ssgVUWt6URZvM6gM+u9wYVlBav+h/O+3+sgtdvL5EsnDLaav8Qh7kD92x kNqK+PJR/HZEgvatoCRIzHeehgstyJTZCNvzhPqW0rRerRJEiQfdLbEbLjN8TKDH LA5d+PBzOQpEWxT5FWkc/K232CgMKEhkTJ0I9t+uBlI553QTUcSkdyWI7hgepJZK bQI1qzzAyTV3BI5DBO6J3/TD9sZy97j3GXWOoH+tS9n37HVGhpGDNuGcySXQPytI jCXPc4W2//w+/XMmDjznYccQ8+ByMoYNt4sJqSUfRgTc6j1ZJs7coGIYcRdrDvzj 1wH8OQM69HkjBw== X-ME-Sender: Received: from localhost.localdomain (unknown [180.158.62.0]) by mail.messagingengine.com (Postfix) with ESMTPA id 27402248B4; Tue, 21 Nov 2017 08:24:55 -0500 (EST) From: Yuanhan Liu To: Daniel Mrzyglod Cc: Jianfeng Tan , Yuanhan Liu , dpdk stable Date: Tue, 21 Nov 2017 21:17:10 +0800 Message-Id: <1511270333-31002-88-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511270333-31002-1-git-send-email-yliu@fridaylinux.org> References: <1511270333-31002-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'net/virtio: fix untrusted scalar value' has been queued to stable release 17.08.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 13:25:00 -0000 Hi, FYI, your patch has been queued to stable release 17.08.1 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/24/17. So please shout if anyone has objections. Thanks. --yliu --- >>From 22e47fe5e4e470ed2be68f37a9c60191f40d7023 Mon Sep 17 00:00:00 2001 From: Daniel Mrzyglod 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 Acked-by: Jianfeng Tan Acked-by: Yuanhan Liu --- 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 4ad7b21..97bd832 100644 --- a/drivers/net/virtio/virtio_user/vhost_user.c +++ b/drivers/net/virtio/virtio_user/vhost_user.c @@ -130,6 +130,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.7.4