Message ID | 20231020084804.3625099-1-maxime.coquelin@redhat.com (mailing list archive) |
---|---|
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 64DC8431BA; Fri, 20 Oct 2023 10:48:23 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AE82D40693; Fri, 20 Oct 2023 10:48:17 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id E8F51402B7 for <dev@dpdk.org>; Fri, 20 Oct 2023 10:48:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697791694; 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=IhelQX9qmoWH6YWZWxIx0XNb81FGztC6WUu0FQDF9LI=; b=FsQusXNgkhuUNx49DSPVNBGQ6UmY+Irb5Krv2KgiL67qcBZBQ99FgWRh2ZgqTLPDyXbJDA vPXKwhfKIBsk0UXHJhgbSSIYLKiMy70Cb+zyFznnpTU9XnkhJ3O5qhA60CIjpBaFVCFDJe hkQAdZ5B4yUIudtBotxOxErae22oCZc= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-141-ivmfphVCNlarUxxphWhwRQ-1; Fri, 20 Oct 2023 04:48:09 -0400 X-MC-Unique: ivmfphVCNlarUxxphWhwRQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BFE981C0BB5A; Fri, 20 Oct 2023 08:48:08 +0000 (UTC) Received: from max-p1.redhat.com (unknown [10.39.208.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9E4C240C6F7D; Fri, 20 Oct 2023 08:48:07 +0000 (UTC) From: Maxime Coquelin <maxime.coquelin@redhat.com> To: dev@dpdk.org, david.marchand@redhat.com, chenbo.xia@outlook.com, fengli@smartx.com Cc: Maxime Coquelin <maxime.coquelin@redhat.com> Subject: [PATCH v2 0/7] vhost: ensure virtqueue access status is checked Date: Fri, 20 Oct 2023 10:47:57 +0200 Message-ID: <20231020084804.3625099-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org |
Series |
vhost: ensure virtqueue access status is checked
|
|
Message
Maxime Coquelin
Oct. 20, 2023, 8:47 a.m. UTC
Li Feng initially reported segmentation fault in rte_vhost_vring_call() because of not checking the virtqueue metadata can be accessed. This should be achieved by checking the access_ok status field of the virtqueue. This series also takes the opportunity to fix the other APIs. This is split in multiple patches to ease LTS maintainers backports, but could be squashed if preferred. Changes in v2: -------------- - Rebased to apply on -rc1 (David) - Add Fixes tag in patch 1 (David) - Fix various typos in commit logs (David) Maxime Coquelin (7): vhost: fix missing vring call check on virtqueue access vhost: fix missing check on virtqueue access vhost: fix checking virtqueue access when notifying guest vhost: fix check on virtqueue access in async registration vhost: fix check on virtqueue access in in-flight getter vhost: fix missing lock protection in power monitor API vhost: fix checking virtqueue access in stats API lib/vhost/vhost.c | 92 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 85 insertions(+), 7 deletions(-)
Comments
On Fri, Oct 20, 2023 at 10:48 AM Maxime Coquelin <maxime.coquelin@redhat.com> wrote: > > Li Feng initially reported segmentation fault in rte_vhost_vring_call() > because of not checking the virtqueue metadata can be accessed. > > This should be achieved by checking the access_ok status field of > the virtqueue. > > This series also takes the opportunity to fix the other APIs. > This is split in multiple patches to ease LTS maintainers backports, > but could be squashed if preferred. As a followup on this topic, I took some time to annotate this code around access_ok/access_lock. For those interested: https://patchwork.dpdk.org/project/dpdk/list/?series=29950&state=%2A&archive=both
On Fri, Oct 20, 2023 at 10:48 AM Maxime Coquelin <maxime.coquelin@redhat.com> wrote: > > Li Feng initially reported segmentation fault in rte_vhost_vring_call() > because of not checking the virtqueue metadata can be accessed. > > This should be achieved by checking the access_ok status field of > the virtqueue. > > This series also takes the opportunity to fix the other APIs. > This is split in multiple patches to ease LTS maintainers backports, > but could be squashed if preferred. > > Changes in v2: > -------------- > - Rebased to apply on -rc1 (David) > - Add Fixes tag in patch 1 (David) > - Fix various typos in commit logs (David) > > Maxime Coquelin (7): > vhost: fix missing vring call check on virtqueue access > vhost: fix missing check on virtqueue access > vhost: fix checking virtqueue access when notifying guest > vhost: fix check on virtqueue access in async registration > vhost: fix check on virtqueue access in in-flight getter > vhost: fix missing lock protection in power monitor API > vhost: fix checking virtqueue access in stats API > > lib/vhost/vhost.c | 92 +++++++++++++++++++++++++++++++++++++++++++---- > 1 file changed, 85 insertions(+), 7 deletions(-) For the series, Acked-by: David Marchand <david.marchand@redhat.com>
On 10/20/23 10:47, Maxime Coquelin wrote: > Li Feng initially reported segmentation fault in rte_vhost_vring_call() > because of not checking the virtqueue metadata can be accessed. > > This should be achieved by checking the access_ok status field of > the virtqueue. > > This series also takes the opportunity to fix the other APIs. > This is split in multiple patches to ease LTS maintainers backports, > but could be squashed if preferred. > > Changes in v2: > -------------- > - Rebased to apply on -rc1 (David) > - Add Fixes tag in patch 1 (David) > - Fix various typos in commit logs (David) > > Maxime Coquelin (7): > vhost: fix missing vring call check on virtqueue access > vhost: fix missing check on virtqueue access > vhost: fix checking virtqueue access when notifying guest > vhost: fix check on virtqueue access in async registration > vhost: fix check on virtqueue access in in-flight getter > vhost: fix missing lock protection in power monitor API > vhost: fix checking virtqueue access in stats API > > lib/vhost/vhost.c | 92 +++++++++++++++++++++++++++++++++++++++++++---- > 1 file changed, 85 insertions(+), 7 deletions(-) > Applied to next-virtio/for-next-net Thanks, Maxime