Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1137/?format=api
https://patches.dpdk.org/api/patches/1137/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1415171435-24252-4-git-send-email-changchun.ouyang@intel.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": "<1415171435-24252-4-git-send-email-changchun.ouyang@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1415171435-24252-4-git-send-email-changchun.ouyang@intel.com", "date": "2014-11-05T07:10:35", "name": "[dpdk-dev,v4,3/3] vhost: Check offset value", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "6ab3c381d45c114df494802cf5e870ebfa50a64c", "submitter": { "id": 31, "url": "https://patches.dpdk.org/api/people/31/?format=api", "name": "Ouyang Changchun", "email": "changchun.ouyang@intel.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1415171435-24252-4-git-send-email-changchun.ouyang@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/1137/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/1137/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id BE8B57F3D;\n\tWed, 5 Nov 2014 08:01:31 +0100 (CET)", "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 398F12E89\n\tfor <dev@dpdk.org>; Wed, 5 Nov 2014 08:01:27 +0100 (CET)", "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby fmsmga102.fm.intel.com with ESMTP; 04 Nov 2014 23:10:48 -0800", "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby fmsmga001.fm.intel.com with ESMTP; 04 Nov 2014 23:10:48 -0800", "from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com\n\t[10.239.29.89])\n\tby shvmail01.sh.intel.com with ESMTP id sA57Ak5M031934;\n\tWed, 5 Nov 2014 15:10:46 +0800", "from shecgisg004.sh.intel.com (localhost [127.0.0.1])\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP\n\tid sA57Ah3V024306; Wed, 5 Nov 2014 15:10:45 +0800", "(from couyang@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id sA57AhG3024302; \n\tWed, 5 Nov 2014 15:10:43 +0800" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.07,317,1413270000\"; d=\"scan'208\";a=\"617371145\"", "From": "Ouyang Changchun <changchun.ouyang@intel.com>", "To": "dev@dpdk.org", "Date": "Wed, 5 Nov 2014 15:10:35 +0800", "Message-Id": "<1415171435-24252-4-git-send-email-changchun.ouyang@intel.com>", "X-Mailer": "git-send-email 1.7.12.2", "In-Reply-To": "<1415171435-24252-1-git-send-email-changchun.ouyang@intel.com>", "References": "<1415084708-8192-1-git-send-email-changchun.ouyang@intel.com>\n\t<1415171435-24252-1-git-send-email-changchun.ouyang@intel.com>", "Subject": "[dpdk-dev] [PATCH v4 3/3] vhost: Check offset value", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "patches and discussions about DPDK <dev.dpdk.org>", "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://dpdk.org/ml/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "This patch checks the packet length offset value, and checks if the extra bytes inside buffer\ncross page boundary.\n\nSigned-off-by: Changchun Ouyang <changchun.ouyang@intel.com>\n---\n examples/vhost/main.c | 7 +++++--\n 1 file changed, 5 insertions(+), 2 deletions(-)", "diff": "diff --git a/examples/vhost/main.c b/examples/vhost/main.c\nindex 2916313..a93f7a0 100644\n--- a/examples/vhost/main.c\n+++ b/examples/vhost/main.c\n@@ -1110,7 +1110,8 @@ virtio_tx_route(struct vhost_dev *vdev, struct rte_mbuf *m, uint16_t vlan_tag)\n \t}\n \n \tif (vm2vm_mode == VM2VM_HARDWARE) {\n-\t\tif (find_local_dest(dev, m, &offset, &vlan_tag) != 0) {\n+\t\tif (find_local_dest(dev, m, &offset, &vlan_tag) != 0 ||\n+\t\t\toffset > rte_pktmbuf_tailroom(m)) {\n \t\t\trte_pktmbuf_free(m);\n \t\t\treturn;\n \t\t}\n@@ -1896,7 +1897,9 @@ virtio_dev_tx_zcp(struct virtio_net *dev)\n \n \t\t/* Buffer address translation. */\n \t\tbuff_addr = gpa_to_vva(dev, desc->addr);\n-\t\tphys_addr = gpa_to_hpa(vdev, desc->addr, desc->len, &addr_type);\n+\t\t/* Need check extra VLAN_HLEN size for inserting VLAN tag */\n+\t\tphys_addr = gpa_to_hpa(vdev, desc->addr, desc->len + VLAN_HLEN,\n+\t\t\t&addr_type);\n \n \t\tif (likely(packet_success < (free_entries - 1)))\n \t\t\t/* Prefetch descriptor index. */\n", "prefixes": [ "dpdk-dev", "v4", "3/3" ] }{ "id": 1137, "url": "