aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/hack-4.14
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2018-03-23 20:09:23 +0100
committerFelix Fietkau <nbd@nbd.name>2018-03-23 20:56:34 +0100
commitdb108cdf14129698cb0740efe72f37f816d40267 (patch)
tree3d70d15fd0a10c5b3695462abf9268cc35403435 /target/linux/generic/hack-4.14
parent2c7b0e9f31630c97f4864ee729be64a2b7ba98e4 (diff)
downloadupstream-db108cdf14129698cb0740efe72f37f816d40267.tar.gz
upstream-db108cdf14129698cb0740efe72f37f816d40267.tar.bz2
upstream-db108cdf14129698cb0740efe72f37f816d40267.zip
kernel: fix crash in flow offload when removing net devices
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'target/linux/generic/hack-4.14')
-rw-r--r--target/linux/generic/hack-4.14/650-netfilter-add-xt_OFFLOAD-target.patch8
1 files changed, 5 insertions, 3 deletions
diff --git a/target/linux/generic/hack-4.14/650-netfilter-add-xt_OFFLOAD-target.patch b/target/linux/generic/hack-4.14/650-netfilter-add-xt_OFFLOAD-target.patch
index 5c40961c37..85826b8706 100644
--- a/target/linux/generic/hack-4.14/650-netfilter-add-xt_OFFLOAD-target.patch
+++ b/target/linux/generic/hack-4.14/650-netfilter-add-xt_OFFLOAD-target.patch
@@ -98,7 +98,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
obj-$(CONFIG_NETFILTER_XT_TARGET_LED) += xt_LED.o
--- /dev/null
+++ b/net/netfilter/xt_FLOWOFFLOAD.c
-@@ -0,0 +1,338 @@
+@@ -0,0 +1,340 @@
+/*
+ * Copyright (C) 2018 Felix Fietkau <nbd@nbd.name>
+ *
@@ -121,6 +121,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
+struct xt_flowoffload_hook {
+ struct hlist_node list;
+ struct nf_hook_ops ops;
++ struct net *net;
+ bool registered;
+ bool used;
+};
@@ -201,8 +202,9 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
+ continue;
+
+ hook->registered = true;
++ hook->net = dev_net(hook->ops.dev);
+ spin_unlock_bh(&hooks_lock);
-+ nf_register_net_hook(dev_net(hook->ops.dev), &hook->ops);
++ nf_register_net_hook(hook->net, &hook->ops);
+ spin_lock_bh(&hooks_lock);
+ goto restart;
+ }
@@ -221,7 +223,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
+
+ hlist_del(&hook->list);
+ spin_unlock_bh(&hooks_lock);
-+ nf_unregister_net_hook(dev_net(hook->ops.dev), &hook->ops);
++ nf_unregister_net_hook(hook->net, &hook->ops);
+ kfree(hook);
+ spin_lock_bh(&hooks_lock);
+ goto restart;