]> git.baikalelectronics.ru Git - kernel.git/commit
net: bpfilter: restart bpfilter_umh when error occurred
authorTaehee Yoo <ap420073@gmail.com>
Tue, 8 Jan 2019 17:24:53 +0000 (02:24 +0900)
committerDavid S. Miller <davem@davemloft.net>
Sat, 12 Jan 2019 02:05:41 +0000 (18:05 -0800)
commit3ea6ca5ec84a7d4984041fb9ffad70f019c36704
treeb7e58c69a150b8624bb32c4f28cea3de3e1fcedd
parentfefc85bba2ad31701d99dacd183588e41f3c7ee9
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: 6507af9e4e23 ("net: add skeleton of bpfilter kernel module")
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/bpfilter.h
net/bpfilter/bpfilter_kern.c
net/bpfilter/bpfilter_umh_blob.S
net/ipv4/bpfilter/sockopt.c