From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39587) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ejpDc-000078-Sf for qemu-devel@nongnu.org; Thu, 08 Feb 2018 11:38:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ejpDY-0004nu-Uk for qemu-devel@nongnu.org; Thu, 08 Feb 2018 11:38:40 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:46708 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ejpDY-0004nf-PO for qemu-devel@nongnu.org; Thu, 08 Feb 2018 11:38:36 -0500 References: <1516291445-4572-1-git-send-email-xieyongji@baidu.com> From: Maxime Coquelin Message-ID: <811ef72e-a502-8d7b-8409-8eef5d51a98a@redhat.com> Date: Thu, 8 Feb 2018 17:38:27 +0100 MIME-Version: 1.0 In-Reply-To: <1516291445-4572-1-git-send-email-xieyongji@baidu.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] libvhost-user: Support across-memory-boundary access List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Yongji Xie , mst@redhat.com, marcandre.lureau@redhat.com Cc: dgilbert@redhat.com, f4bug@amsat.org, qemu-devel@nongnu.org On 01/18/2018 05:04 PM, Yongji Xie wrote: > The sg list/indirect descriptor table may be contigious > in GPA but not in HVA address space. But libvhost-user > wasn't aware of that. This would cause out-of-bounds > access. Even a malicious guest could use it to get > information from the vhost-user backend. > > Introduce a plen parameter in vu_gpa_to_va() so we can > handle this case, returning the actual mapped length. > > Signed-off-by: Yongji Xie > --- > contrib/libvhost-user/libvhost-user.c | 133 +++++++++++++++++++++++++++++---- > contrib/libvhost-user/libvhost-user.h | 3 +- > 2 files changed, 122 insertions(+), 14 deletions(-) > Reviewed-by: Maxime Coquelin Thanks, Maxime