summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTaehee Yoo <ap420073@gmail.com>2019-01-08 18:24:53 +0100
committerDavid S. Miller <davem@davemloft.net>2019-01-12 03:05:41 +0100
commit61fbf5933d42b02f552123af5a87a06335a3b4db (patch)
treeb7e58c69a150b8624bb32c4f28cea3de3e1fcedd /include
parentnet: bpfilter: use cleanup callback to release umh_info (diff)
downloadlinux-61fbf5933d42b02f552123af5a87a06335a3b4db.tar.xz
linux-61fbf5933d42b02f552123af5a87a06335a3b4db.zip
net: bpfilter: restart bpfilter_umh when error occurred
The bpfilter_umh will be stopped via __stop_umh() when the bpfilter error occurred. The bpfilter_umh() couldn't start again because there is no restart routine. The section of the bpfilter_umh_{start/end} is no longer .init.rodata because these area should be reused in the restart routine. hence the section name is changed to .bpfilter_umh. The bpfilter_ops->start() is restart callback. it will be called when bpfilter_umh is stopped. The stop bit means bpfilter_umh is stopped. this bit is set by both start and stop routine. Before this patch, Test commands: $ iptables -vnL $ kill -9 <pid of bpfilter_umh> $ iptables -vnL [ 480.045136] bpfilter: write fail -32 $ iptables -vnL All iptables commands will fail. After this patch, Test commands: $ iptables -vnL $ kill -9 <pid of bpfilter_umh> $ iptables -vnL $ iptables -vnL Now, all iptables commands will work. Fixes: d2ba09c17a06 ("net: add skeleton of bpfilter kernel module") Signed-off-by: Taehee Yoo <ap420073@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/bpfilter.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/bpfilter.h b/include/linux/bpfilter.h
index 70ffeed280e9..8ebcbdd70bdc 100644
--- a/include/linux/bpfilter.h
+++ b/include/linux/bpfilter.h
@@ -15,6 +15,8 @@ struct bpfilter_umh_ops {
int (*sockopt)(struct sock *sk, int optname,
char __user *optval,
unsigned int optlen, bool is_set);
+ int (*start)(void);
+ bool stop;
};
extern struct bpfilter_umh_ops bpfilter_ops;
#endif