get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/115599/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 115599,
    "url": "https://patches.dpdk.org/api/patches/115599/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20220829150936.1455069-1-david.marchand@redhat.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20220829150936.1455069-1-david.marchand@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220829150936.1455069-1-david.marchand@redhat.com",
    "date": "2022-08-29T15:09:35",
    "name": "[1/2] vhost: discard too small descriptor chains",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "c23b8649e5baf5a0b6fb7fa0dab084cb37214c47",
    "submitter": {
        "id": 1173,
        "url": "https://patches.dpdk.org/api/people/1173/?format=api",
        "name": "David Marchand",
        "email": "david.marchand@redhat.com"
    },
    "delegate": {
        "id": 2642,
        "url": "https://patches.dpdk.org/api/users/2642/?format=api",
        "username": "mcoquelin",
        "first_name": "Maxime",
        "last_name": "Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20220829150936.1455069-1-david.marchand@redhat.com/mbox/",
    "series": [
        {
            "id": 24448,
            "url": "https://patches.dpdk.org/api/series/24448/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=24448",
            "date": "2022-08-29T15:09:36",
            "name": "[1/2] vhost: discard too small descriptor chains",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/24448/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/115599/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/115599/checks/",
    "tags": {},
    "related": [],
    "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])\n\tby inbox.dpdk.org (Postfix) with ESMTP id D7355A0542;\n\tMon, 29 Aug 2022 17:10:20 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id CBB6A41181;\n\tMon, 29 Aug 2022 17:10:20 +0200 (CEST)",
            "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.129.124])\n by mails.dpdk.org (Postfix) with ESMTP id 73DB841147\n for <dev@dpdk.org>; Mon, 29 Aug 2022 17:10:19 +0200 (CEST)",
            "from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com\n [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n us-mta-307-VwepVixIPm-27OVCUVw-EA-1; Mon, 29 Aug 2022 11:10:01 -0400",
            "from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com\n [10.11.54.2])\n (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n (No client certificate requested)\n by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 387E03C216C8;\n Mon, 29 Aug 2022 15:10:01 +0000 (UTC)",
            "from fchome.redhat.com (unknown [10.40.193.251])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 5725740C141D;\n Mon, 29 Aug 2022 15:09:59 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1661785819;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding;\n bh=Ot8wbt7X0ODS7YDVjMkqP3DNCyT17iKaXGMGsYsie1M=;\n b=DLE6KCXMtemvcKfrjyLINr3Uxb1mNs3DTlO+HIr2tJlD6bJQkBeezmTQhTJeL1iFl41abs\n kb+AXvsUpNPESNVfyh/wksX6bqpASMpwudh4ml5tfH2bTQnN9uKOTqI53MfBofcIiTxygD\n 0CBQXeeqJXsorXoMS54SszeS+XI1CKQ=",
        "X-MC-Unique": "VwepVixIPm-27OVCUVw-EA-1",
        "From": "David Marchand <david.marchand@redhat.com>",
        "To": "dev@dpdk.org",
        "Cc": "Maxime Coquelin <maxime.coquelin@redhat.com>, stable@dpdk.org,\n Chenbo Xia <chenbo.xia@intel.com>, Tiwei Bie <tiwei.bie@intel.com>,\n Flavio Leitner <fbl@sysclose.org>, Yuan Wang <yuanx.wang@intel.com>,\n Xuan Ding <xuan.ding@intel.com>",
        "Subject": "[PATCH 1/2] vhost: discard too small descriptor chains",
        "Date": "Mon, 29 Aug 2022 17:09:35 +0200",
        "Message-Id": "<20220829150936.1455069-1-david.marchand@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 2.84 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>,\n <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>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "From: Maxime Coquelin <maxime.coquelin@redhat.com>\n\nThis patch discards descriptor chains which are smaller\nthan the Virtio-net header size, and ones that are equal.\n\nIndeed, such descriptor chains sizes mean there is no\npacket data.\n\nThis patch also has the advantage of requesting the exact\npackets sizes for the mbufs.\n\nCVE-2022-2132\nFixes: 62250c1d0978 (\"vhost: extract split ring handling from Rx and Tx functions\")\nFixes: c3ff0ac70acb (\"vhost: improve performance by supporting large buffer\")\nFixes: 84d5204310d7 (\"vhost: support async dequeue for split ring\")\nCc: stable@dpdk.org\n\nSigned-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>\nAcked-by: Chenbo Xia <chenbo.xia@intel.com>\nReviewed-by: David Marchand <david.marchand@redhat.com>\n---\n lib/vhost/virtio_net.c | 26 ++++++++++++++++++++++++--\n 1 file changed, 24 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c\nindex 35fa4670fd..757d8dee17 100644\n--- a/lib/vhost/virtio_net.c\n+++ b/lib/vhost/virtio_net.c\n@@ -2677,8 +2677,10 @@ desc_to_mbuf(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \tbuf_iova = buf_vec[vec_idx].buf_iova;\n \tbuf_len = buf_vec[vec_idx].buf_len;\n \n-\tif (unlikely(buf_len < dev->vhost_hlen && nr_vec <= 1))\n-\t\treturn -1;\n+\t/*\n+\t * The caller has checked the descriptors chain is larger than the\n+\t * header size.\n+\t */\n \n \tif (virtio_net_with_host_offload(dev)) {\n \t\tif (unlikely(buf_len < sizeof(struct virtio_net_hdr))) {\n@@ -2922,6 +2924,14 @@ virtio_dev_tx_split(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \n \t\tupdate_shadow_used_ring_split(vq, head_idx, 0);\n \n+\t\tif (unlikely(buf_len <= dev->vhost_hlen)) {\n+\t\t\tdropped += 1;\n+\t\t\ti++;\n+\t\t\tbreak;\n+\t\t}\n+\n+\t\tbuf_len -= dev->vhost_hlen;\n+\n \t\terr = virtio_dev_pktmbuf_prep(dev, pkts[i], buf_len);\n \t\tif (unlikely(err)) {\n \t\t\t/*\n@@ -3124,6 +3134,11 @@ vhost_dequeue_single_packed(struct virtio_net *dev,\n \t\t\t\t\t VHOST_ACCESS_RO) < 0))\n \t\treturn -1;\n \n+\tif (unlikely(buf_len <= dev->vhost_hlen))\n+\t\treturn -1;\n+\n+\tbuf_len -= dev->vhost_hlen;\n+\n \tif (unlikely(virtio_dev_pktmbuf_prep(dev, pkts, buf_len))) {\n \t\tif (!allocerr_warned) {\n \t\t\tVHOST_LOG_DATA(dev->ifname, ERR,\n@@ -3448,6 +3463,13 @@ virtio_dev_tx_async_split(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \t\t\tbreak;\n \t\t}\n \n+\t\tif (unlikely(buf_len <= dev->vhost_hlen)) {\n+\t\t\tdropped = true;\n+\t\t\tbreak;\n+\t\t}\n+\n+\t\tbuf_len -= dev->vhost_hlen;\n+\n \t\terr = virtio_dev_pktmbuf_prep(dev, pkt, buf_len);\n \t\tif (unlikely(err)) {\n \t\t\t/**\n",
    "prefixes": [
        "1/2"
    ]
}