get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 980260,
    "url": "http://patchwork.ozlabs.org/api/patches/980260/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20181008031644.15989-21-dsahern@kernel.org/",
    "project": {
        "id": 7,
        "url": "http://patchwork.ozlabs.org/api/projects/7/?format=api",
        "name": "Linux network development",
        "link_name": "netdev",
        "list_id": "netdev.vger.kernel.org",
        "list_email": "netdev@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20181008031644.15989-21-dsahern@kernel.org>",
    "list_archive_url": null,
    "date": "2018-10-08T03:16:41",
    "name": "[v2,net-next,20/23] net: Update netconf dump handlers for strict data checking",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "0b3d284913519f301295f43192ef191dde25f6bf",
    "submitter": {
        "id": 74101,
        "url": "http://patchwork.ozlabs.org/api/people/74101/?format=api",
        "name": "David Ahern",
        "email": "dsahern@kernel.org"
    },
    "delegate": {
        "id": 34,
        "url": "http://patchwork.ozlabs.org/api/users/34/?format=api",
        "username": "davem",
        "first_name": "David",
        "last_name": "Miller",
        "email": "davem@davemloft.net"
    },
    "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/20181008031644.15989-21-dsahern@kernel.org/mbox/",
    "series": [
        {
            "id": 69470,
            "url": "http://patchwork.ozlabs.org/api/series/69470/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=69470",
            "date": "2018-10-08T03:16:21",
            "name": "rtnetlink: Add support for rigid checking of data in dump request",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/69470/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/980260/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/980260/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<netdev-owner@vger.kernel.org>",
        "X-Original-To": "patchwork-incoming-netdev@ozlabs.org",
        "Delivered-To": "patchwork-incoming-netdev@ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org;\n\tdmarc=pass (p=none dis=none) header.from=kernel.org",
            "ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=kernel.org header.i=@kernel.org\n\theader.b=\"jXUjS1Sl\"; dkim-atps=neutral"
        ],
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 42T5BK2n5Gz9sCV\n\tfor <patchwork-incoming-netdev@ozlabs.org>;\n\tMon,  8 Oct 2018 14:16:57 +1100 (AEDT)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1727056AbeJHK0X (ORCPT\n\t<rfc822;patchwork-incoming-netdev@ozlabs.org>);\n\tMon, 8 Oct 2018 06:26:23 -0400",
            "from mail.kernel.org ([198.145.29.99]:42610 \"EHLO mail.kernel.org\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1726897AbeJHK0W (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tMon, 8 Oct 2018 06:26:22 -0400",
            "from kenny.it.cumulusnetworks.com. (fw.cumulusnetworks.com\n\t[216.129.126.126])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits)) (No client certificate requested)\n\tby mail.kernel.org (Postfix) with ESMTPSA id 4ED08208D9;\n\tMon,  8 Oct 2018 03:16:52 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=default; t=1538968612;\n\tbh=j0xfmd4rJApe6vqGFda9aWZ3JK4j7AZuDWv7KDhbnBc=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=jXUjS1SlliI1tfgEQ7u1uEr6DYI4w/VXJeypQW5t5p8ErTaJzz0aDZ+6gy4MQuYW+\n\t+hyR3n42mtBKwvlmjq8gsRtc/qC1aTkpFvwkECXhgwuIL69FyLIuf9lGFjjJsOsM0c\n\ta6i9l1ov8UYvh/EVxso14VKDyH96KDklUIIl4iHQ=",
        "From": "David Ahern <dsahern@kernel.org>",
        "To": "netdev@vger.kernel.org, davem@davemloft.net",
        "Cc": "christian@brauner.io, jbenc@redhat.com, stephen@networkplumber.org,\n\tDavid Ahern <dsahern@gmail.com>",
        "Subject": "[PATCH v2 net-next 20/23] net: Update netconf dump handlers for\n\tstrict data checking",
        "Date": "Sun,  7 Oct 2018 20:16:41 -0700",
        "Message-Id": "<20181008031644.15989-21-dsahern@kernel.org>",
        "X-Mailer": "git-send-email 2.11.0",
        "In-Reply-To": "<20181008031644.15989-1-dsahern@kernel.org>",
        "References": "<20181008031644.15989-1-dsahern@kernel.org>",
        "Sender": "netdev-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<netdev.vger.kernel.org>",
        "X-Mailing-List": "netdev@vger.kernel.org"
    },
    "content": "From: David Ahern <dsahern@gmail.com>\n\nUpdate inet_netconf_dump_devconf, inet6_netconf_dump_devconf, and\nmpls_netconf_dump_devconf for strict data checking. If the flag is set,\nthe dump request is expected to have an netconfmsg struct as the header.\nThe struct only has the family member and no attributes can be appended.\n\nSigned-off-by: David Ahern <dsahern@gmail.com>\n---\n net/ipv4/devinet.c  | 22 +++++++++++++++++++---\n net/ipv6/addrconf.c | 22 +++++++++++++++++++---\n net/mpls/af_mpls.c  | 18 +++++++++++++++++-\n 3 files changed, 55 insertions(+), 7 deletions(-)",
    "diff": "diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c\nindex 6f2bbd04e950..d122ebbe5980 100644\n--- a/net/ipv4/devinet.c\n+++ b/net/ipv4/devinet.c\n@@ -2086,6 +2086,7 @@ static int inet_netconf_get_devconf(struct sk_buff *in_skb,\n static int inet_netconf_dump_devconf(struct sk_buff *skb,\n \t\t\t\t     struct netlink_callback *cb)\n {\n+\tconst struct nlmsghdr *nlh = cb->nlh;\n \tstruct net *net = sock_net(skb->sk);\n \tint h, s_h;\n \tint idx, s_idx;\n@@ -2093,6 +2094,21 @@ static int inet_netconf_dump_devconf(struct sk_buff *skb,\n \tstruct in_device *in_dev;\n \tstruct hlist_head *head;\n \n+\tif (cb->strict_check) {\n+\t\tstruct netlink_ext_ack *extack = cb->extack;\n+\t\tstruct netconfmsg *ncm;\n+\n+\t\tif (nlh->nlmsg_len < nlmsg_msg_size(sizeof(*ncm))) {\n+\t\t\tNL_SET_ERR_MSG(extack, \"ipv4: Invalid header for netconf dump request\");\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\n+\t\tif (nlmsg_attrlen(nlh, sizeof(*ncm))) {\n+\t\t\tNL_SET_ERR_MSG(extack, \"ipv4: Invalid data after header in netconf dump request\");\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t}\n+\n \ts_h = cb->args[0];\n \ts_idx = idx = cb->args[1];\n \n@@ -2112,7 +2128,7 @@ static int inet_netconf_dump_devconf(struct sk_buff *skb,\n \t\t\tif (inet_netconf_fill_devconf(skb, dev->ifindex,\n \t\t\t\t\t\t      &in_dev->cnf,\n \t\t\t\t\t\t      NETLINK_CB(cb->skb).portid,\n-\t\t\t\t\t\t      cb->nlh->nlmsg_seq,\n+\t\t\t\t\t\t      nlh->nlmsg_seq,\n \t\t\t\t\t\t      RTM_NEWNETCONF,\n \t\t\t\t\t\t      NLM_F_MULTI,\n \t\t\t\t\t\t      NETCONFA_ALL) < 0) {\n@@ -2129,7 +2145,7 @@ static int inet_netconf_dump_devconf(struct sk_buff *skb,\n \t\tif (inet_netconf_fill_devconf(skb, NETCONFA_IFINDEX_ALL,\n \t\t\t\t\t      net->ipv4.devconf_all,\n \t\t\t\t\t      NETLINK_CB(cb->skb).portid,\n-\t\t\t\t\t      cb->nlh->nlmsg_seq,\n+\t\t\t\t\t      nlh->nlmsg_seq,\n \t\t\t\t\t      RTM_NEWNETCONF, NLM_F_MULTI,\n \t\t\t\t\t      NETCONFA_ALL) < 0)\n \t\t\tgoto done;\n@@ -2140,7 +2156,7 @@ static int inet_netconf_dump_devconf(struct sk_buff *skb,\n \t\tif (inet_netconf_fill_devconf(skb, NETCONFA_IFINDEX_DEFAULT,\n \t\t\t\t\t      net->ipv4.devconf_dflt,\n \t\t\t\t\t      NETLINK_CB(cb->skb).portid,\n-\t\t\t\t\t      cb->nlh->nlmsg_seq,\n+\t\t\t\t\t      nlh->nlmsg_seq,\n \t\t\t\t\t      RTM_NEWNETCONF, NLM_F_MULTI,\n \t\t\t\t\t      NETCONFA_ALL) < 0)\n \t\t\tgoto done;\ndiff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c\nindex ce071d85ad00..2496b12bf721 100644\n--- a/net/ipv6/addrconf.c\n+++ b/net/ipv6/addrconf.c\n@@ -666,6 +666,7 @@ static int inet6_netconf_get_devconf(struct sk_buff *in_skb,\n static int inet6_netconf_dump_devconf(struct sk_buff *skb,\n \t\t\t\t      struct netlink_callback *cb)\n {\n+\tconst struct nlmsghdr *nlh = cb->nlh;\n \tstruct net *net = sock_net(skb->sk);\n \tint h, s_h;\n \tint idx, s_idx;\n@@ -673,6 +674,21 @@ static int inet6_netconf_dump_devconf(struct sk_buff *skb,\n \tstruct inet6_dev *idev;\n \tstruct hlist_head *head;\n \n+\tif (cb->strict_check) {\n+\t\tstruct netlink_ext_ack *extack = cb->extack;\n+\t\tstruct netconfmsg *ncm;\n+\n+\t\tif (nlh->nlmsg_len < nlmsg_msg_size(sizeof(*ncm))) {\n+\t\t\tNL_SET_ERR_MSG_MOD(extack, \"Invalid header for netconf dump request\");\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\n+\t\tif (nlmsg_attrlen(nlh, sizeof(*ncm))) {\n+\t\t\tNL_SET_ERR_MSG_MOD(extack, \"Invalid data after header in netconf dump request\");\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t}\n+\n \ts_h = cb->args[0];\n \ts_idx = idx = cb->args[1];\n \n@@ -692,7 +708,7 @@ static int inet6_netconf_dump_devconf(struct sk_buff *skb,\n \t\t\tif (inet6_netconf_fill_devconf(skb, dev->ifindex,\n \t\t\t\t\t\t       &idev->cnf,\n \t\t\t\t\t\t       NETLINK_CB(cb->skb).portid,\n-\t\t\t\t\t\t       cb->nlh->nlmsg_seq,\n+\t\t\t\t\t\t       nlh->nlmsg_seq,\n \t\t\t\t\t\t       RTM_NEWNETCONF,\n \t\t\t\t\t\t       NLM_F_MULTI,\n \t\t\t\t\t\t       NETCONFA_ALL) < 0) {\n@@ -709,7 +725,7 @@ static int inet6_netconf_dump_devconf(struct sk_buff *skb,\n \t\tif (inet6_netconf_fill_devconf(skb, NETCONFA_IFINDEX_ALL,\n \t\t\t\t\t       net->ipv6.devconf_all,\n \t\t\t\t\t       NETLINK_CB(cb->skb).portid,\n-\t\t\t\t\t       cb->nlh->nlmsg_seq,\n+\t\t\t\t\t       nlh->nlmsg_seq,\n \t\t\t\t\t       RTM_NEWNETCONF, NLM_F_MULTI,\n \t\t\t\t\t       NETCONFA_ALL) < 0)\n \t\t\tgoto done;\n@@ -720,7 +736,7 @@ static int inet6_netconf_dump_devconf(struct sk_buff *skb,\n \t\tif (inet6_netconf_fill_devconf(skb, NETCONFA_IFINDEX_DEFAULT,\n \t\t\t\t\t       net->ipv6.devconf_dflt,\n \t\t\t\t\t       NETLINK_CB(cb->skb).portid,\n-\t\t\t\t\t       cb->nlh->nlmsg_seq,\n+\t\t\t\t\t       nlh->nlmsg_seq,\n \t\t\t\t\t       RTM_NEWNETCONF, NLM_F_MULTI,\n \t\t\t\t\t       NETCONFA_ALL) < 0)\n \t\t\tgoto done;\ndiff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c\nindex 0458c8aa5c11..7f891ffffc05 100644\n--- a/net/mpls/af_mpls.c\n+++ b/net/mpls/af_mpls.c\n@@ -1263,6 +1263,7 @@ static int mpls_netconf_get_devconf(struct sk_buff *in_skb,\n static int mpls_netconf_dump_devconf(struct sk_buff *skb,\n \t\t\t\t     struct netlink_callback *cb)\n {\n+\tconst struct nlmsghdr *nlh = cb->nlh;\n \tstruct net *net = sock_net(skb->sk);\n \tstruct hlist_head *head;\n \tstruct net_device *dev;\n@@ -1270,6 +1271,21 @@ static int mpls_netconf_dump_devconf(struct sk_buff *skb,\n \tint idx, s_idx;\n \tint h, s_h;\n \n+\tif (cb->strict_check) {\n+\t\tstruct netlink_ext_ack *extack = cb->extack;\n+\t\tstruct netconfmsg *ncm;\n+\n+\t\tif (nlh->nlmsg_len < nlmsg_msg_size(sizeof(*ncm))) {\n+\t\t\tNL_SET_ERR_MSG_MOD(extack, \"Invalid header for netconf dump request\");\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\n+\t\tif (nlmsg_attrlen(nlh, sizeof(*ncm))) {\n+\t\t\tNL_SET_ERR_MSG_MOD(extack, \"Invalid data after header in netconf dump request\");\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t}\n+\n \ts_h = cb->args[0];\n \ts_idx = idx = cb->args[1];\n \n@@ -1286,7 +1302,7 @@ static int mpls_netconf_dump_devconf(struct sk_buff *skb,\n \t\t\t\tgoto cont;\n \t\t\tif (mpls_netconf_fill_devconf(skb, mdev,\n \t\t\t\t\t\t      NETLINK_CB(cb->skb).portid,\n-\t\t\t\t\t\t      cb->nlh->nlmsg_seq,\n+\t\t\t\t\t\t      nlh->nlmsg_seq,\n \t\t\t\t\t\t      RTM_NEWNETCONF,\n \t\t\t\t\t\t      NLM_F_MULTI,\n \t\t\t\t\t\t      NETCONFA_ALL) < 0) {\n",
    "prefixes": [
        "v2",
        "net-next",
        "20/23"
    ]
}