get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 573058,
    "url": "http://patchwork.ozlabs.org/api/patches/573058/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20160126033635.16387.56585.stgit@localhost.localdomain/",
    "project": {
        "id": 46,
        "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api",
        "name": "Intel Wired Ethernet development",
        "link_name": "intel-wired-lan",
        "list_id": "intel-wired-lan.osuosl.org",
        "list_email": "intel-wired-lan@osuosl.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20160126033635.16387.56585.stgit@localhost.localdomain>",
    "list_archive_url": null,
    "date": "2016-01-26T03:39:40",
    "name": "[next,3/3] ixgbe: Fix ATR so that it correctly handles IPv6 extension headers",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "7a1ceae42880686a28c5f92c37bdbcaee1b855e3",
    "submitter": {
        "id": 67293,
        "url": "http://patchwork.ozlabs.org/api/people/67293/?format=api",
        "name": "Alexander Duyck",
        "email": "aduyck@mirantis.com"
    },
    "delegate": {
        "id": 68,
        "url": "http://patchwork.ozlabs.org/api/users/68/?format=api",
        "username": "jtkirshe",
        "first_name": "Jeff",
        "last_name": "Kirsher",
        "email": "jeffrey.t.kirsher@intel.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20160126033635.16387.56585.stgit@localhost.localdomain/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/573058/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/573058/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@lists.osuosl.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Received": [
            "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ozlabs.org (Postfix) with ESMTP id D68D21402F0\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 26 Jan 2016 14:39:45 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 29CE89553F;\n\tTue, 26 Jan 2016 03:39:45 +0000 (UTC)",
            "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id aSQ2-8HeBJfQ; Tue, 26 Jan 2016 03:39:44 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 993E195539;\n\tTue, 26 Jan 2016 03:39:44 +0000 (UTC)",
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 24B421C1EE3\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 26 Jan 2016 03:39:44 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 1441E2F94F\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 26 Jan 2016 03:39:44 +0000 (UTC)",
            "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 22i76lr+pfer for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 26 Jan 2016 03:39:41 +0000 (UTC)",
            "from mail-pa0-f49.google.com (mail-pa0-f49.google.com\n\t[209.85.220.49])\n\tby silver.osuosl.org (Postfix) with ESMTPS id AB7122ED54\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 26 Jan 2016 03:39:41 +0000 (UTC)",
            "by mail-pa0-f49.google.com with SMTP id cy9so91338749pac.0\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 25 Jan 2016 19:39:41 -0800 (PST)",
            "from localhost.localdomain\n\t(static-50-53-29-36.bvtn.or.frontiernet.net. [50.53.29.36])\n\tby smtp.gmail.com with ESMTPSA id\n\tth10sm12436798pab.3.2016.01.25.19.39.40\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tMon, 25 Jan 2016 19:39:40 -0800 (PST)"
        ],
        "Authentication-Results": "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=mirantis.com header.i=@mirantis.com\n\theader.b=jeaTyOhT; dkim-atps=neutral",
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "from auto-whitelisted by SQLgrey-1.7.6",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=mirantis.com;\n\ts=google; \n\th=subject:from:to:cc:date:message-id:in-reply-to:references\n\t:user-agent:mime-version:content-type:content-transfer-encoding;\n\tbh=qmu2VQ2wL6fmNm3x4KJaHz+0HOpDFSF7eBXK0ChbOvM=;\n\tb=jeaTyOhTW8yb/W/6DcGJFY/UvuUon1IG668rYbZ+QoAwGobd32nwbKVClwLxUVnPLd\n\tW1rMtsCXLm4kEJEB+f9aaC7iR+o8dBoR0eoTEmbmhpO4L8GXOc9xBZ2TgG6uOSXkqczu\n\tQlZ+Hq5OQTiTiD7pYwhqILL4ZqD4Pnbe4xWKI=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:subject:from:to:cc:date:message-id:in-reply-to\n\t:references:user-agent:mime-version:content-type\n\t:content-transfer-encoding;\n\tbh=qmu2VQ2wL6fmNm3x4KJaHz+0HOpDFSF7eBXK0ChbOvM=;\n\tb=XWnCwqIz3jfRlQYuSUA3ddmtgX/IqMJsJLgW85CDIl/nq0IpGw9RpRzf5+bA4nRxlk\n\tWCHqq0H6ZGvIXezCuN2m9McjNcTsnFm8NVn0n7f/+KW324pW9v6znfpGrIjaOLMnMvdG\n\tm4ZyRVz7Jab3Aqn07gUNao3ELWkbMNzFUr9kqyDHSdrOVlRUg4Q2Qer4HZUZUOq/S2Cx\n\tN6ZY1BG9+1Bl+TlELqzOs4kPVt9HIFA8tDBZZgFVQr5x7pochboK4yHNw3G2HAM98fTd\n\t/42sxW5XcPmQIDCME1tbreHMYVWcl82awVTbPzCXb9AzSX4EfEWEqDTFfgyDa56IxHbc\n\tPsrQ==",
        "X-Gm-Message-State": "AG10YORbBb104JyN29sGXbjPwPYXqn056ipUBCCDWN2aG/+P5iWktOeLNQfeVOiSMWganu2U",
        "X-Received": "by 10.66.252.136 with SMTP id zs8mr30793878pac.110.1453779581433;\n\tMon, 25 Jan 2016 19:39:41 -0800 (PST)",
        "From": "Alexander Duyck <aduyck@mirantis.com>",
        "To": "intel-wired-lan@lists.osuosl.org, jeffrey.t.kirsher@intel.com",
        "Date": "Mon, 25 Jan 2016 19:39:40 -0800",
        "Message-ID": "<20160126033635.16387.56585.stgit@localhost.localdomain>",
        "In-Reply-To": "<20160126032616.16387.86351.stgit@localhost.localdomain>",
        "References": "<20160126032616.16387.86351.stgit@localhost.localdomain>",
        "User-Agent": "StGit/0.17.1-dirty",
        "MIME-Version": "1.0",
        "Subject": "[Intel-wired-lan] [next PATCH 3/3] ixgbe: Fix ATR so that it\n\tcorrectly handles IPv6 extension headers",
        "X-BeenThere": "intel-wired-lan@lists.osuosl.org",
        "X-Mailman-Version": "2.1.18-1",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.lists.osuosl.org>",
        "List-Unsubscribe": "<http://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@lists.osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@lists.osuosl.org?subject=help>",
        "List-Subscribe": "<http://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@lists.osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@lists.osuosl.org>"
    },
    "content": "The ATR code was assuming that it would be able to use tcp_hdr for\nevery TCP frame that came through.  However this isn't the case as it\nis possible for a frame to arrive that is TCP but sent through something\nlike a raw socket.  As a result the driver was setting up bad filters in\nwhich tcp_hdr was really pointing to the network header so the data was\nall invalid.\n\nIn order to correct this I have added a bit of parsing logic that will\ndetermine the TCP header location based off of the network header and\neither the offset in the case of the IPv4 header, or a walk through the\nIPv6 extension headers until it encounters the header that indicates\nIPPROTO_TCP.  In addition I have added checks to verify that the lowest\nprotocol provided is recognized as IPv4 or IPv6 to help mitigate raw\nsockets using ETH_P_ALL from having ATR applied to them.\n\nSigned-off-by: Alexander Duyck <aduyck@mirantis.com>\n\n---\n\nTesting Hints:\nIn order for me to verify the bug was there I ended up having to use tools\nsuch as tcpreplay and some raw socket apps to send TCP frames.  Without\ninstrumenting the driver this can be hard to see.  One approach might be to\nenable 9K jumbo frames between two hosts and then start using TCP replay or\nsomething similar to start walking through the same port and IP numbers,\nbut sending larger and larger packets.  On a system without this patch you\nshould see the following behavior:\n  1.  IP total length is interpreted as destination port\n  2.  Second octet of IP source address is interpreted as TCP flags.\n      - Fin resides at bit 0, so odd values will not cause issue.\n      - Syn is in second bit, so it is 20X more likely to cause issue\n        - In other words test with 190.2.100.X, not 190.1.100.X\n\nTesting with a range of frame sizes should start triggering table resets\nwithout any flow director matches due to how the headers are being\nmisread.\n\n drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |   45 ++++++++++++-------------\n 1 file changed, 21 insertions(+), 24 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\nindex 88368d2f7e1a..f3191b574dd3 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n@@ -7501,8 +7501,10 @@ static void ixgbe_atr(struct ixgbe_ring *ring,\n \t\tstruct ipv6hdr *ipv6;\n \t} hdr;\n \tstruct tcphdr *th;\n+\tunsigned int hlen;\n \tstruct sk_buff *skb;\n \t__be16 vlan_id;\n+\tint l4_proto;\n \n \t/* if ring doesn't have a interrupt vector, cannot perform ATR */\n \tif (!q_vector)\n@@ -7514,10 +7516,14 @@ static void ixgbe_atr(struct ixgbe_ring *ring,\n \n \tring->atr_count++;\n \n+\t/* currently only IPv4/IPv6 with TCP is supported */\n+\tif ((first->protocol != htons(ETH_P_IP)) &&\n+\t    (first->protocol != htons(ETH_P_IPV6)))\n+\t\treturn;\n+\n \t/* snag network header to get L4 type and address */\n \tskb = first->skb;\n \thdr.network = skb_network_header(skb);\n-\tth = tcp_hdr(skb);\n #ifdef CONFIG_IXGBE_VXLAN\n \tif (skb->encapsulation &&\n \t    first->protocol == htons(ETH_P_IP) &&\n@@ -7526,43 +7532,34 @@ static void ixgbe_atr(struct ixgbe_ring *ring,\n \n \t\t/* verify the port is recognized as VXLAN */\n \t\tif (adapter->vxlan_port &&\n-\t\t    udp_hdr(skb)->dest == adapter->vxlan_port) {\n+\t\t    udp_hdr(skb)->dest == adapter->vxlan_port)\n \t\t\thdr.network = skb_inner_network_header(skb);\n-\t\t\tth = inner_tcp_hdr(skb);\n-\t\t}\n \t}\n #endif /* CONFIG_IXGBE_VXLAN */\n \n \t/* Currently only IPv4/IPv6 with TCP is supported */\n \tswitch (hdr.ipv4->version) {\n \tcase IPVERSION:\n-\t\tif (hdr.ipv4->protocol != IPPROTO_TCP)\n-\t\t\treturn;\n+\t\t/* access ihl as u8 to avoid unaligned access on ia64 */\n+\t\thlen = (hdr.network[0] & 0x0F) << 2;\n+\t\tl4_proto = hdr.ipv4->protocol;\n \t\tbreak;\n \tcase 6:\n-\t\tif (likely((unsigned char *)th - hdr.network ==\n-\t\t\t   sizeof(struct ipv6hdr))) {\n-\t\t\tif (hdr.ipv6->nexthdr != IPPROTO_TCP)\n-\t\t\t\treturn;\n-\t\t} else {\n-\t\t\t__be16 frag_off;\n-\t\t\tu8 l4_hdr;\n-\n-\t\t\tipv6_skip_exthdr(skb, hdr.network - skb->data +\n-\t\t\t\t\t      sizeof(struct ipv6hdr),\n-\t\t\t\t\t &l4_hdr, &frag_off);\n-\t\t\tif (unlikely(frag_off))\n-\t\t\t\treturn;\n-\t\t\tif (l4_hdr != IPPROTO_TCP)\n-\t\t\t\treturn;\n-\t\t}\n+\t\thlen = hdr.network - skb->data;\n+\t\tl4_proto = ipv6_find_hdr(skb, &hlen, IPPROTO_TCP, NULL, NULL);\n+\t\thlen -= hdr.network - skb->data;\n \t\tbreak;\n \tdefault:\n \t\treturn;\n \t}\n \n-\t/* skip this packet since it is invalid or the socket is closing */\n-\tif (!th || th->fin)\n+\tif (l4_proto != IPPROTO_TCP)\n+\t\treturn;\n+\n+\tth = (struct tcphdr *)(hdr.network + hlen);\n+\n+\t/* skip this packet since the socket is closing */\n+\tif (th->fin)\n \t\treturn;\n \n \t/* sample on all syn packets or once every atr sample count */\n",
    "prefixes": [
        "next",
        "3/3"
    ]
}