From patchwork Mon Oct 19 17:34:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Coquelin X-Patchwork-Id: 81396 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 289B4A04DC; Mon, 19 Oct 2020 19:34:32 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 91B8ED027; Mon, 19 Oct 2020 19:34:30 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by dpdk.org (Postfix) with ESMTP id B2CFFC830 for ; Mon, 19 Oct 2020 19:34:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603128867; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B6lUKqx+PXZ6/JA5Raf7AiZE9qH35bY8z0giuBKxYzQ=; b=VErsIcqisU6pAmMfbsyIu0FTK2xPBBbgL93ttqQ6Jex55SDNSPBZEs3LqJBWbeBZbjr6OU 8Sf4wNu+XKFP/UKVuuKFbQsJiWS5uTzTO+ZeZEhMmbDAn12rJx/TpAKl0L6xicv+fVp8Y9 P39IEh+IQjm/fPhliISBrTZ4VK7wdR0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-316-t9pzppu3OKGg5FNEv7u-Iw-1; Mon, 19 Oct 2020 13:34:25 -0400 X-MC-Unique: t9pzppu3OKGg5FNEv7u-Iw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 30D361006C88; Mon, 19 Oct 2020 17:34:24 +0000 (UTC) Received: from localhost.localdomain (unknown [10.36.110.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id C05E373662; Mon, 19 Oct 2020 17:34:19 +0000 (UTC) From: Maxime Coquelin To: dev@dpdk.org, chenbo.xia@intel.com, amorenoz@redhat.com Cc: Maxime Coquelin Date: Mon, 19 Oct 2020 19:34:08 +0200 Message-Id: <20201019173415.582407-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [dpdk-dev] [PATCH 0/7] vhost: make VQ metadata dereferencing robust X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The series aims at improving virtqueue metadata pointers dereferencing robust. First patch fixes a real issue reported by our QE. Five next patches validates queue index passed as input of the Vhost API. They are split in 5 patches to ease backporting to LTSes. Last patch is not mandatory now that patch 1 ensures there won't be holes in the array of virtqueue metadata pointers, but I think it is a nice to have anyway. Maxime Coquelin (7): vhost: fix virtqueues metadata allocation vhost: validate index in available entries API vhost: validate index in guest notification API vhost: validate index in live-migration API vhost: validate index in inflight API vhost: validate index in async API vhost: check virtqueue metadata pointer lib/librte_vhost/vhost.c | 76 ++++++++++++++++++++++++++++------- lib/librte_vhost/vhost_user.c | 12 ++++++ 2 files changed, 74 insertions(+), 14 deletions(-)