get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 812521,
    "url": "http://patchwork.ozlabs.org/api/patches/812521/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/openvswitch/patch/1505152570-6143-6-git-send-email-gvrose8192@gmail.com/",
    "project": {
        "id": 47,
        "url": "http://patchwork.ozlabs.org/api/projects/47/?format=api",
        "name": "Open vSwitch",
        "link_name": "openvswitch",
        "list_id": "ovs-dev.openvswitch.org",
        "list_email": "ovs-dev@openvswitch.org",
        "web_url": "http://openvswitch.org/",
        "scm_url": "git@github.com:openvswitch/ovs.git",
        "webscm_url": "https://github.com/openvswitch/ovs",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<1505152570-6143-6-git-send-email-gvrose8192@gmail.com>",
    "list_archive_url": null,
    "date": "2017-09-11T17:56:01",
    "name": "[ovs-dev,06/15] datapath: fix skb_panic due to the incorrect actions attrlen",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "8dbe91f23343d93d47205d3c14413f826ef4d7f0",
    "submitter": {
        "id": 69140,
        "url": "http://patchwork.ozlabs.org/api/people/69140/?format=api",
        "name": "Gregory Rose",
        "email": "gvrose8192@gmail.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/openvswitch/patch/1505152570-6143-6-git-send-email-gvrose8192@gmail.com/mbox/",
    "series": [
        {
            "id": 2537,
            "url": "http://patchwork.ozlabs.org/api/series/2537/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/openvswitch/list/?series=2537",
            "date": "2017-09-11T17:55:56",
            "name": "[ovs-dev,01/15] acinclude: Check for SKB_GSO_UDP",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/2537/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/812521/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/812521/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<ovs-dev-bounces@openvswitch.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "dev@openvswitch.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "ovs-dev@mail.linuxfoundation.org"
        ],
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=openvswitch.org\n\t(client-ip=140.211.169.12; helo=mail.linuxfoundation.org;\n\tenvelope-from=ovs-dev-bounces@openvswitch.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"Ddtbgt8i\"; dkim-atps=neutral"
        ],
        "Received": [
            "from mail.linuxfoundation.org (mail.linuxfoundation.org\n\t[140.211.169.12])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xrbKf4yzjz9s7F\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 12 Sep 2017 03:59:34 +1000 (AEST)",
            "from mail.linux-foundation.org (localhost [127.0.0.1])\n\tby mail.linuxfoundation.org (Postfix) with ESMTP id A1129B56;\n\tMon, 11 Sep 2017 17:56:29 +0000 (UTC)",
            "from smtp1.linuxfoundation.org (smtp1.linux-foundation.org\n\t[172.17.192.35])\n\tby mail.linuxfoundation.org (Postfix) with ESMTPS id 48C25B30\n\tfor <dev@openvswitch.org>; Mon, 11 Sep 2017 17:56:26 +0000 (UTC)",
            "from mail-pf0-f196.google.com (mail-pf0-f196.google.com\n\t[209.85.192.196])\n\tby smtp1.linuxfoundation.org (Postfix) with ESMTPS id BC96AA4\n\tfor <dev@openvswitch.org>; Mon, 11 Sep 2017 17:56:25 +0000 (UTC)",
            "by mail-pf0-f196.google.com with SMTP id i23so401123pfi.2\n\tfor <dev@openvswitch.org>; Mon, 11 Sep 2017 10:56:25 -0700 (PDT)",
            "from gizo.domain (67-5-132-83.ptld.qwest.net. [67.5.132.83])\n\tby smtp.gmail.com with ESMTPSA id\n\th185sm16733084pfe.160.2017.09.11.10.56.23\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tMon, 11 Sep 2017 10:56:23 -0700 (PDT)"
        ],
        "X-Greylist": "whitelisted by SQLgrey-1.7.6",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=VyC5nfaIBsQFXfPun5s8FCA08bl6efNI8b/Cc/PCfkY=;\n\tb=Ddtbgt8iCeiq/KMbxxqjPL7vw45VNxWPRl5GDDvWR5r2mWbgS2FFK8pc3vwGOu1H4Y\n\tPLq62aqzbdx4D2kz9DvilRMKpyfbi5jsR+CaSDNGozer6Xu7PvE52w44gBbo0xudXeqt\n\tPaKSB/tBUMgfJlJ98K49hi8p3BbCWixOuVs0ezoRFbcL6YU0gz24HUcpwqkltcfkad+h\n\t+6N0ZNpvOV4ZRh2MM7VjZdAxbm9FPKt2W7lG955ZdQ9jzWsCb6OFW3HtM/CofYsZyAte\n\tBvRDq7YbC4qUEXgjfEGvjCaz7MsRwJ0uO+dOlJ50ZOsWZwBtz+T4U2oH3oEUTpzzSI+N\n\tYoTg==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=VyC5nfaIBsQFXfPun5s8FCA08bl6efNI8b/Cc/PCfkY=;\n\tb=UcEnwZ48A1hDhqHGkABx+1LBEkzxZyEOwcMTSUqXjh9PNxMFPL8b3fD/rQz6BNdkja\n\t5Slxb9a4NotIleGxMU8ZxN0Ql1tM5q/xtw7Sjt7Ro+C5//7H34oIhQdmyOdRuiuezBDa\n\tLJa37xiTrQUJCMTG+2DUNdIXIs+1v/iflHYxILYl1YuOgxz+u8arW8usB1OJNUNZwiHM\n\tx1pvnmm79pc3wRKPT1Pr/uC+u2Eim1l4H+cNasI/3gnAt8TF4chJbgzoq0Z2yQyEGqAi\n\tCFlJ+ZQXNFZgucZUZcbbXy4MSsg4e6BVY81xubnxYQ2UzIFPF5bhVZMlNxCfe69TEpEc\n\tpGiw==",
        "X-Gm-Message-State": "AHPjjUjzQ8YhKLaFHhUN1cF/bSKb1dz33SwVg3P9FaWmIlqEoUDLZWOk\n\tdMwtCgod9z9My7W8",
        "X-Google-Smtp-Source": "ADKCNb7iE6JrJ7GEOwFcTR0wxhMaybhpNoQITKg2CfYXGD2voeRVvef6B1neTvXJBf7PZbnzGdnVIA==",
        "X-Received": "by 10.98.236.17 with SMTP id k17mr11802579pfh.191.1505152584891; \n\tMon, 11 Sep 2017 10:56:24 -0700 (PDT)",
        "From": "Greg Rose <gvrose8192@gmail.com>",
        "To": "dev@openvswitch.org",
        "Date": "Mon, 11 Sep 2017 10:56:01 -0700",
        "Message-Id": "<1505152570-6143-6-git-send-email-gvrose8192@gmail.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1505152570-6143-1-git-send-email-gvrose8192@gmail.com>",
        "References": "<1505152570-6143-1-git-send-email-gvrose8192@gmail.com>",
        "X-Spam-Status": "No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID,\n\tDKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,\n\tRCVD_IN_DNSWL_NONE autolearn=disabled version=3.3.1",
        "X-Spam-Checker-Version": "SpamAssassin 3.3.1 (2010-03-16) on\n\tsmtp1.linux-foundation.org",
        "Subject": "[ovs-dev] [PATCH 06/15] datapath: fix skb_panic due to the\n\tincorrect actions attrlen",
        "X-BeenThere": "ovs-dev@openvswitch.org",
        "X-Mailman-Version": "2.1.12",
        "Precedence": "list",
        "List-Id": "<ovs-dev.openvswitch.org>",
        "List-Unsubscribe": "<https://mail.openvswitch.org/mailman/options/ovs-dev>,\n\t<mailto:ovs-dev-request@openvswitch.org?subject=unsubscribe>",
        "List-Archive": "<http://mail.openvswitch.org/pipermail/ovs-dev/>",
        "List-Post": "<mailto:ovs-dev@openvswitch.org>",
        "List-Help": "<mailto:ovs-dev-request@openvswitch.org?subject=help>",
        "List-Subscribe": "<https://mail.openvswitch.org/mailman/listinfo/ovs-dev>,\n\t<mailto:ovs-dev-request@openvswitch.org?subject=subscribe>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Sender": "ovs-dev-bounces@openvswitch.org",
        "Errors-To": "ovs-dev-bounces@openvswitch.org"
    },
    "content": "Upstream commit:\n    commit 494bea39f3201776cdfddc232705f54a0bd210c4\n    Author: Liping Zhang <zlpnobody@gmail.com>\n    Date:   Wed Aug 16 13:30:07 2017 +0800\n\n    openvswitch: fix skb_panic due to the incorrect actions attrlen\n\n    For sw_flow_actions, the actions_len only represents the kernel part's\n    size, and when we dump the actions to the userspace, we will do the\n    convertions, so it's true size may become bigger than the actions_len.\n\n    But unfortunately, for OVS_PACKET_ATTR_ACTIONS, we use the actions_len\n    to alloc the skbuff, so the user_skb's size may become insufficient and\n    oops will happen like this:\n      skbuff: skb_over_panic: text:ffffffff8148fabf len:1749 put:157 head:\n      ffff881300f39000 data:ffff881300f39000 tail:0x6d5 end:0x6c0 dev:<NULL>\n      ------------[ cut here ]------------\n      kernel BUG at net/core/skbuff.c:129!\n      [...]\n      Call Trace:\n       <IRQ>\n       [<ffffffff8148be82>] skb_put+0x43/0x44\n       [<ffffffff8148fabf>] skb_zerocopy+0x6c/0x1f4\n       [<ffffffffa0290d36>] queue_userspace_packet+0x3a3/0x448 [openvswitch]\n       [<ffffffffa0292023>] ovs_dp_upcall+0x30/0x5c [openvswitch]\n       [<ffffffffa028d435>] output_userspace+0x132/0x158 [openvswitch]\n       [<ffffffffa01e6890>] ? ip6_rcv_finish+0x74/0x77 [ipv6]\n       [<ffffffffa028e277>] do_execute_actions+0xcc1/0xdc8 [openvswitch]\n       [<ffffffffa028e3f2>] ovs_execute_actions+0x74/0x106 [openvswitch]\n       [<ffffffffa0292130>] ovs_dp_process_packet+0xe1/0xfd [openvswitch]\n       [<ffffffffa0292b77>] ? key_extract+0x63c/0x8d5 [openvswitch]\n       [<ffffffffa029848b>] ovs_vport_receive+0xa1/0xc3 [openvswitch]\n      [...]\n\n    Also we can find that the actions_len is much little than the orig_len:\n      crash> struct sw_flow_actions 0xffff8812f539d000\n      struct sw_flow_actions {\n        rcu = {\n          next = 0xffff8812f5398800,\n          func = 0xffffe3b00035db32\n        },\n        orig_len = 1384,\n        actions_len = 592,\n        actions = 0xffff8812f539d01c\n      }\n\n    So as a quick fix, use the orig_len instead of the actions_len to alloc\n    the user_skb.\n\n    Last, this oops happened on our system running a relative old kernel, but\n    the same risk still exists on the mainline, since we use the wrong\n    actions_len from the beginning.\n\n    Fixes: ccea74457bbd (\"openvswitch: include datapath actions with sampled-pac\n    Cc: Neil McKee <neil.mckee@inmon.com>\n    Signed-off-by: Liping Zhang <zlpnobody@gmail.com>\n    Acked-by: Pravin B Shelar <pshelar@ovn.org>\n    Signed-off-by: David S. Miller <davem@davemloft.net>\n\nFixes: 0e469d3b380c (\"datapath: Include datapath actions with sampled-packet upcall to userspace.\")\nSigned-off-by: Greg Rose <gvrose8192@gmail.com>\n---\n datapath/actions.c  | 1 +\n datapath/datapath.c | 7 ++++---\n datapath/datapath.h | 2 ++\n 3 files changed, 7 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/datapath/actions.c b/datapath/actions.c\nindex 59d91b2..ad18c2c 100644\n--- a/datapath/actions.c\n+++ b/datapath/actions.c\n@@ -1348,6 +1348,7 @@ int ovs_execute_actions(struct datapath *dp, struct sk_buff *skb,\n \t\tgoto out;\n \t}\n \n+\tOVS_CB(skb)->acts_origlen = acts->orig_len;\n \terr = do_execute_actions(dp, skb, key,\n \t\t\t\t acts->actions, acts->actions_len);\n \ndiff --git a/datapath/datapath.c b/datapath/datapath.c\nindex b565fc5..1780819 100644\n--- a/datapath/datapath.c\n+++ b/datapath/datapath.c\n@@ -388,7 +388,7 @@ static int queue_gso_packets(struct datapath *dp, struct sk_buff *skb,\n }\n \n static size_t upcall_msg_size(const struct dp_upcall_info *upcall_info,\n-\t\t\t      unsigned int hdrlen)\n+\t\t\t      unsigned int hdrlen, int actions_attrlen)\n {\n \tsize_t size = NLMSG_ALIGN(sizeof(struct ovs_header))\n \t\t+ nla_total_size(hdrlen) /* OVS_PACKET_ATTR_PACKET */\n@@ -405,7 +405,7 @@ static size_t upcall_msg_size(const struct dp_upcall_info *upcall_info,\n \n \t/* OVS_PACKET_ATTR_ACTIONS */\n \tif (upcall_info->actions_len)\n-\t\tsize += nla_total_size(upcall_info->actions_len);\n+\t\tsize += nla_total_size(actions_attrlen);\n \n \t/* OVS_PACKET_ATTR_MRU */\n \tif (upcall_info->mru)\n@@ -472,7 +472,8 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,\n \telse\n \t\thlen = skb->len;\n \n-\tlen = upcall_msg_size(upcall_info, hlen - cutlen);\n+\tlen = upcall_msg_size(upcall_info, hlen - cutlen,\n+\t\t\t      OVS_CB(skb)->acts_origlen);\n \tuser_skb = genlmsg_new(len, GFP_ATOMIC);\n \tif (!user_skb) {\n \t\terr = -ENOMEM;\ndiff --git a/datapath/datapath.h b/datapath/datapath.h\nindex f20deed..70ad0ac 100644\n--- a/datapath/datapath.h\n+++ b/datapath/datapath.h\n@@ -100,11 +100,13 @@ struct datapath {\n  * when a packet is received by OVS.\n  * @mru: The maximum received fragement size; 0 if the packet is not\n  * fragmented.\n+ * @acts_origlen: The netlink size of the flow actions applied to this skb.\n  * @cutlen: The number of bytes from the packet end to be removed.\n  */\n struct ovs_skb_cb {\n \tstruct vport\t\t*input_vport;\n \tu16\t\t\tmru;\n+\tu16\t\t\tacts_origlen;\n \tu32\t\t\tcutlen;\n };\n #define OVS_CB(skb) ((struct ovs_skb_cb *)(skb)->cb)\n",
    "prefixes": [
        "ovs-dev",
        "06/15"
    ]
}