lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1420440610-20621-3-git-send-email-simon.horman@netronome.com>
Date:	Mon,  5 Jan 2015 15:50:06 +0900
From:	Simon Horman <simon.horman@...ronome.com>
To:	John Fastabend <john.fastabend@...il.com>
Cc:	netdev@...r.kernel.org, Simon Horman <simon.horman@...ronome.com>
Subject: [PATCH/RFC rocker-net-next 2/6] net: flow: Handle error when putting a field while putting a flow

Signed-off-by: Simon Horman <simon.horman@...ronome.com>
---
 net/core/flow_table.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/net/core/flow_table.c b/net/core/flow_table.c
index 2af831e..753ebe0 100644
--- a/net/core/flow_table.c
+++ b/net/core/flow_table.c
@@ -981,8 +981,9 @@ done:
 
 int net_flow_put_flow(struct sk_buff *skb, struct net_flow_flow *flow)
 {
-	struct nlattr *flows, *matches;
+	struct nlattr *flows;
 	struct nlattr *actions = NULL; /* must be null to unwind */
+	struct nlattr *matches = NULL; /* must be null to unwind */
 	int err, j, i = 0;
 
 	flows = nla_nest_start(skb, NET_FLOW_FLOW);
@@ -1005,7 +1006,11 @@ int net_flow_put_flow(struct sk_buff *skb, struct net_flow_flow *flow)
 			if (!f->header)
 				continue;
 
-			nla_put(skb, NET_FLOW_FIELD_REF, sizeof(*f), f);
+			err = nla_put(skb, NET_FLOW_FIELD_REF, sizeof(*f), f);
+			if (err) {
+				nla_nest_cancel(skb, matches);
+				goto flows_put_failure;
+			}
 		}
 		nla_nest_end(skb, matches);
 	}
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ