Re: [PATCH v2 00/15] Make the user mode driver code a better citizen
From: Alexei Starovoitov
Date: Mon Jun 29 2020 - 18:12:38 EST
On Mon, Jun 29, 2020 at 02:55:05PM -0500, Eric W. Biederman wrote:
>
> I have tested thes changes by booting with the code compiled in and
> by killing "bpfilter_umh" and running iptables -vnL to restart
> the userspace driver.
>
> I have compiled tested each change with and without CONFIG_BPFILTER
> enabled.
With
CONFIG_BPFILTER=y
CONFIG_BPFILTER_UMH=m
it doesn't build:
ERROR: modpost: "kill_pid_info" [net/bpfilter/bpfilter.ko] undefined!
I've added:
+EXPORT_SYMBOL(kill_pid_info);
to continue testing...
And then did:
while true; do iptables -L;rmmod bpfilter; done
Unfortunately sometimes 'rmmod bpfilter' hangs in wait_event().
I suspect patch 13 is somehow responsible:
+ if (tgid) {
+ kill_pid_info(SIGKILL, SEND_SIG_PRIV, tgid);
+ wait_event(tgid->wait_pidfd, !pid_task(tgid, PIDTYPE_TGID));
+ bpfilter_umh_cleanup(info);
+ }
I cannot figure out why it hangs. Some sort of race ?
Since adding short delay between kill and wait makes it work.