Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/980273/?format=api
{ "id": 980273, "url": "http://patchwork.ozlabs.org/api/patches/980273/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20181008031644.15989-12-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-12-dsahern@kernel.org>", "list_archive_url": null, "date": "2018-10-08T03:16:32", "name": "[v2,net-next,11/23] rtnetlink: Update rtnl_stats_dump for strict data checking", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "152c06464b0d03f52a2d474f6c244e5a0c36abaf", "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-12-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/980273/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/980273/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=\"hUiiPguk\"; dkim-atps=neutral" ], "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 42T5Bt1FH0z9sCV\n\tfor <patchwork-incoming-netdev@ozlabs.org>;\n\tMon, 8 Oct 2018 14:17:26 +1100 (AEDT)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1726918AbeJHK0z (ORCPT\n\t<rfc822;patchwork-incoming-netdev@ozlabs.org>);\n\tMon, 8 Oct 2018 06:26:55 -0400", "from mail.kernel.org ([198.145.29.99]:42664 \"EHLO mail.kernel.org\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1726921AbeJHK0U (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tMon, 8 Oct 2018 06:26:20 -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 CBDC62088F;\n\tMon, 8 Oct 2018 03:16:49 +0000 (UTC)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=default; t=1538968610;\n\tbh=9Gb3m8Btstf3BqEMQXmITgDoNoDS/hNQsIhr3R4+lIs=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=hUiiPgukS1eqyem07XINb2ssz8mO/ZbOzeuIRoK1jAVGPCp1pU7iJTMbGp9bJiKan\n\tXI4KIrbSbHF3o66FeJTulyyhg5jdgmaiJSq/6JWB8WCZjWEl8sQSB/mRN+XPgE/OgB\n\tXMN5bdl//RuFMxewc6HUsBwr7MM5X+q4e4xnCWAE=", "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 11/23] rtnetlink: Update rtnl_stats_dump for\n\tstrict data checking", "Date": "Sun, 7 Oct 2018 20:16:32 -0700", "Message-Id": "<20181008031644.15989-12-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 rtnl_stats_dump for strict data checking. If the flag is set,\nthe dump request is expected to have an if_stats_msg struct as the header.\nAll elements of the struct are expected to be 0 except filter_mask which\nmust be non-0 (legacy behavior). No attributes are supported.\n\nSigned-off-by: David Ahern <dsahern@gmail.com>\n---\n net/core/rtnetlink.c | 24 ++++++++++++++++++++++--\n 1 file changed, 22 insertions(+), 2 deletions(-)", "diff": "diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c\nindex e38e1f178611..f6d2609cfa9f 100644\n--- a/net/core/rtnetlink.c\n+++ b/net/core/rtnetlink.c\n@@ -4680,6 +4680,7 @@ static int rtnl_stats_get(struct sk_buff *skb, struct nlmsghdr *nlh,\n \n static int rtnl_stats_dump(struct sk_buff *skb, struct netlink_callback *cb)\n {\n+\tstruct netlink_ext_ack *extack = cb->extack;\n \tint h, s_h, err, s_idx, s_idxattr, s_prividx;\n \tstruct net *net = sock_net(skb->sk);\n \tunsigned int flags = NLM_F_MULTI;\n@@ -4696,13 +4697,32 @@ static int rtnl_stats_dump(struct sk_buff *skb, struct netlink_callback *cb)\n \n \tcb->seq = net->dev_base_seq;\n \n-\tif (nlmsg_len(cb->nlh) < sizeof(*ifsm))\n+\tif (nlmsg_len(cb->nlh) < sizeof(*ifsm)) {\n+\t\tNL_SET_ERR_MSG(extack, \"Invalid header for stats dump\");\n \t\treturn -EINVAL;\n+\t}\n \n \tifsm = nlmsg_data(cb->nlh);\n+\n+\t/* only requests using NLM_F_DUMP_PROPER_HDR can pass data to\n+\t * influence the dump. The legacy exception is filter_mask.\n+\t */\n+\tif (cb->strict_check) {\n+\t\tif (ifsm->pad1 || ifsm->pad2 || ifsm->ifindex) {\n+\t\t\tNL_SET_ERR_MSG(extack, \"Invalid values in header for stats dump request\");\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t\tif (nlmsg_attrlen(cb->nlh, sizeof(*ifsm))) {\n+\t\t\tNL_SET_ERR_MSG(extack, \"Invalid attributes after stats header\");\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t}\n+\n \tfilter_mask = ifsm->filter_mask;\n-\tif (!filter_mask)\n+\tif (!filter_mask) {\n+\t\tNL_SET_ERR_MSG(extack, \"Filter mask must be set for stats dump\");\n \t\treturn -EINVAL;\n+\t}\n \n \tfor (h = s_h; h < NETDEV_HASHENTRIES; h++, s_idx = 0) {\n \t\tidx = 0;\n", "prefixes": [ "v2", "net-next", "11/23" ] }