Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/980263/?format=api
{ "id": 980263, "url": "http://patchwork.ozlabs.org/api/patches/980263/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20181008031644.15989-17-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-17-dsahern@kernel.org>", "list_archive_url": null, "date": "2018-10-08T03:16:37", "name": "[v2,net-next,16/23] net/neighbor: Update neightbl_dump_info for strict data checking", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "601fda1c5b717da79b306cafe3439a7d3eec8453", "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-17-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/980263/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/980263/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=\"Ta6Rh6+Q\"; dkim-atps=neutral" ], "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 42T5BR2p6lz9sCV\n\tfor <patchwork-incoming-netdev@ozlabs.org>;\n\tMon, 8 Oct 2018 14:17:03 +1100 (AEDT)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1727031AbeJHK0W (ORCPT\n\t<rfc822;patchwork-incoming-netdev@ozlabs.org>);\n\tMon, 8 Oct 2018 06:26:22 -0400", "from mail.kernel.org ([198.145.29.99]:42626 \"EHLO mail.kernel.org\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1725950AbeJHK0V (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tMon, 8 Oct 2018 06:26:21 -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 356B92087D;\n\tMon, 8 Oct 2018 03:16:51 +0000 (UTC)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=default; t=1538968611;\n\tbh=i44a+4XA3p7/GTdRtJ39GZ4enI/i8SUXH+lTwxbsAsE=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=Ta6Rh6+QC1g5d3OaEUuS7Liv8QZyuTOuxbeEj+H0Kiy3oHH6c+Md6wYZImecnJI3D\n\t1ZK1N/pqJVdApochvCYXUMSWtwmPIvIvCLTSE3lj/ERoDzmcSGJr1W0yX66JF50Int\n\tgpm+pchxim1rRu1Jv6WLpnMK1q7T/a6Ih7zIH7OY=", "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 16/23] net/neighbor: Update neightbl_dump_info\n\tfor strict data checking", "Date": "Sun, 7 Oct 2018 20:16:37 -0700", "Message-Id": "<20181008031644.15989-17-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 neightbl_dump_info for strict data checking. If the flag is set,\nthe dump request is expected to have an ndtmsg struct as the header.\nAll elements of the struct are expected to be 0 and no attributes can\nbe appended.\n\nSigned-off-by: David Ahern <dsahern@gmail.com>\n---\n net/core/neighbour.c | 38 +++++++++++++++++++++++++++++++++++---\n 1 file changed, 35 insertions(+), 3 deletions(-)", "diff": "diff --git a/net/core/neighbour.c b/net/core/neighbour.c\nindex 7c8a3a0ee059..dc1389b8beb1 100644\n--- a/net/core/neighbour.c\n+++ b/net/core/neighbour.c\n@@ -2164,15 +2164,47 @@ static int neightbl_set(struct sk_buff *skb, struct nlmsghdr *nlh,\n \treturn err;\n }\n \n+static int neightbl_valid_dump_info(const struct nlmsghdr *nlh,\n+\t\t\t\t struct netlink_ext_ack *extack)\n+{\n+\tstruct ndtmsg *ndtm;\n+\n+\tif (nlh->nlmsg_len < nlmsg_msg_size(sizeof(*ndtm))) {\n+\t\tNL_SET_ERR_MSG(extack, \"Invalid header for neighbor table dump request\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tndtm = nlmsg_data(nlh);\n+\tif (ndtm->ndtm_pad1 || ndtm->ndtm_pad2) {\n+\t\tNL_SET_ERR_MSG(extack, \"Invalid values in header for neighbor table dump request\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tif (nlmsg_attrlen(nlh, sizeof(*ndtm))) {\n+\t\tNL_SET_ERR_MSG(extack, \"Invalid data after header in neighbor table dump request\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\treturn 0;\n+}\n+\n static int neightbl_dump_info(struct sk_buff *skb, struct netlink_callback *cb)\n {\n+\tconst struct nlmsghdr *nlh = cb->nlh;\n \tstruct net *net = sock_net(skb->sk);\n \tint family, tidx, nidx = 0;\n \tint tbl_skip = cb->args[0];\n \tint neigh_skip = cb->args[1];\n \tstruct neigh_table *tbl;\n \n-\tfamily = ((struct rtgenmsg *) nlmsg_data(cb->nlh))->rtgen_family;\n+\tif (cb->strict_check) {\n+\t\tint err = neightbl_valid_dump_info(nlh, cb->extack);\n+\n+\t\tif (err < 0)\n+\t\t\treturn err;\n+\t}\n+\n+\tfamily = ((struct rtgenmsg *)nlmsg_data(nlh))->rtgen_family;\n \n \tfor (tidx = 0; tidx < NEIGH_NR_TABLES; tidx++) {\n \t\tstruct neigh_parms *p;\n@@ -2185,7 +2217,7 @@ static int neightbl_dump_info(struct sk_buff *skb, struct netlink_callback *cb)\n \t\t\tcontinue;\n \n \t\tif (neightbl_fill_info(skb, tbl, NETLINK_CB(cb->skb).portid,\n-\t\t\t\t cb->nlh->nlmsg_seq, RTM_NEWNEIGHTBL,\n+\t\t\t\t nlh->nlmsg_seq, RTM_NEWNEIGHTBL,\n \t\t\t\t NLM_F_MULTI) < 0)\n \t\t\tbreak;\n \n@@ -2200,7 +2232,7 @@ static int neightbl_dump_info(struct sk_buff *skb, struct netlink_callback *cb)\n \n \t\t\tif (neightbl_fill_param_info(skb, tbl, p,\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_NEWNEIGHTBL,\n \t\t\t\t\t\t NLM_F_MULTI) < 0)\n \t\t\t\tgoto out;\n", "prefixes": [ "v2", "net-next", "16/23" ] }