summaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-07-21 13:53:54 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-07-21 13:53:54 +0000
commita222dffebbb0ae61b8ad0577c79837dda6431753 (patch)
tree9bc56e86600a030b2ccc4cced6a0021f93a8d862 /target
parent8f21449a258d3f596ac1324750043a645c8fc7dc (diff)
kernel: fix crash in act_connmark in 3.9 and 3.10 (fixes #13916, #13876)
Signed-off-by: Felix Fietkau <nbd@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@37493 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rw-r--r--target/linux/generic/patches-3.10/621-sched_act_connmark.patch35
-rw-r--r--target/linux/generic/patches-3.9/621-sched_act_connmark.patch35
2 files changed, 46 insertions, 24 deletions
diff --git a/target/linux/generic/patches-3.10/621-sched_act_connmark.patch b/target/linux/generic/patches-3.10/621-sched_act_connmark.patch
index 0393f15893..e6c050aaa2 100644
--- a/target/linux/generic/patches-3.10/621-sched_act_connmark.patch
+++ b/target/linux/generic/patches-3.10/621-sched_act_connmark.patch
@@ -1,6 +1,6 @@
--- /dev/null
+++ b/net/sched/act_connmark.c
-@@ -0,0 +1,137 @@
+@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) 2011 Felix Fietkau <nbd@openwrt.org>
+ *
@@ -81,19 +81,30 @@
+ return TC_ACT_PIPE;
+}
+
-+static int tcf_connmark_init(struct nlattr *nla, struct nlattr *est,
-+ struct tc_action *a, int ovr, int bind)
++static int tcf_connmark_init(struct net *net, struct nlattr *nla,
++ struct nlattr *est, struct tc_action *a,
++ int ovr, int bind)
+{
+ struct tcf_common *pc;
-+
-+ pc = tcf_hash_create(0, est, a, sizeof(*pc), bind,
-+ &connmark_idx_gen, &connmark_hash_info);
-+ if (IS_ERR(pc))
-+ return PTR_ERR(pc);
-+
-+ tcf_hash_insert(pc, &connmark_hash_info);
-+
-+ return ACT_P_CREATED;
++ int ret = 0;
++
++ pc = tcf_hash_check(0, a, bind, &connmark_hash_info);
++ if (!pc) {
++ pc = tcf_hash_create(0, est, a, sizeof(*pc), bind,
++ &connmark_idx_gen, &connmark_hash_info);
++ if (IS_ERR(pc))
++ return PTR_ERR(pc);
++
++ tcf_hash_insert(pc, &connmark_hash_info);
++ ret = ACT_P_CREATED;
++ } else {
++ if (!ovr) {
++ tcf_hash_release(pc, bind, &connmark_hash_info);
++ return -EEXIST;
++ }
++ }
++
++ return ret;
+}
+
+static inline int tcf_connmark_cleanup(struct tc_action *a, int bind)
diff --git a/target/linux/generic/patches-3.9/621-sched_act_connmark.patch b/target/linux/generic/patches-3.9/621-sched_act_connmark.patch
index 0393f15893..e6c050aaa2 100644
--- a/target/linux/generic/patches-3.9/621-sched_act_connmark.patch
+++ b/target/linux/generic/patches-3.9/621-sched_act_connmark.patch
@@ -1,6 +1,6 @@
--- /dev/null
+++ b/net/sched/act_connmark.c
-@@ -0,0 +1,137 @@
+@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) 2011 Felix Fietkau <nbd@openwrt.org>
+ *
@@ -81,19 +81,30 @@
+ return TC_ACT_PIPE;
+}
+
-+static int tcf_connmark_init(struct nlattr *nla, struct nlattr *est,
-+ struct tc_action *a, int ovr, int bind)
++static int tcf_connmark_init(struct net *net, struct nlattr *nla,
++ struct nlattr *est, struct tc_action *a,
++ int ovr, int bind)
+{
+ struct tcf_common *pc;
-+
-+ pc = tcf_hash_create(0, est, a, sizeof(*pc), bind,
-+ &connmark_idx_gen, &connmark_hash_info);
-+ if (IS_ERR(pc))
-+ return PTR_ERR(pc);
-+
-+ tcf_hash_insert(pc, &connmark_hash_info);
-+
-+ return ACT_P_CREATED;
++ int ret = 0;
++
++ pc = tcf_hash_check(0, a, bind, &connmark_hash_info);
++ if (!pc) {
++ pc = tcf_hash_create(0, est, a, sizeof(*pc), bind,
++ &connmark_idx_gen, &connmark_hash_info);
++ if (IS_ERR(pc))
++ return PTR_ERR(pc);
++
++ tcf_hash_insert(pc, &connmark_hash_info);
++ ret = ACT_P_CREATED;
++ } else {
++ if (!ovr) {
++ tcf_hash_release(pc, bind, &connmark_hash_info);
++ return -EEXIST;
++ }
++ }
++
++ return ret;
+}
+
+static inline int tcf_connmark_cleanup(struct tc_action *a, int bind)