Re: [PATCH v2 00/15] Make the user mode driver code a better citizen

2020-07-07 Thread Luis Chamberlain
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_BPFILT

Re: [PATCH v2 00/15] Make the user mode driver code a better citizen

2020-07-07 Thread Eric W. Biederman
Just to make certain I understand what is going on I instrumented a kernel with some print statements. a) The workqueues and timers start before populate_rootfs. b) populate_rootfs does indeed happen long before the bpfilter module is intialized. c) What prevents populate_rootfs and the umd

Re: [PATCH v2 00/15] Make the user mode driver code a better citizen

2020-07-03 Thread Tetsuo Handa
On 2020/07/04 7:25, Eric W. Biederman wrote: > Tetsuo Handa writes: > >> On 2020/07/02 22:08, Eric W. Biederman wrote: By the way, commit 4a9d4b024a3102fc ("switch fput to task_work_add") says that use of flush_delayed_fput() has to be careful. Al, is it safe to call flush_delayed_

Re: [PATCH v2 00/15] Make the user mode driver code a better citizen

2020-07-03 Thread Eric W. Biederman
Tetsuo Handa writes: > On 2020/07/02 22:08, Eric W. Biederman wrote: >>> By the way, commit 4a9d4b024a3102fc ("switch fput to task_work_add") says >>> that use of flush_delayed_fput() has to be careful. Al, is it safe to call >>> flush_delayed_fput() from blob_to_mnt() from umd_load_blob() (which

Re: [PATCH v2 00/15] Make the user mode driver code a better citizen

2020-07-03 Thread Tetsuo Handa
On 2020/07/02 22:08, Eric W. Biederman wrote: >> By the way, commit 4a9d4b024a3102fc ("switch fput to task_work_add") says >> that use of flush_delayed_fput() has to be careful. Al, is it safe to call >> flush_delayed_fput() from blob_to_mnt() from umd_load_blob() (which might be >> called from bot

Re: [PATCH v2 00/15] Make the user mode driver code a better citizen

2020-07-02 Thread Eric W. Biederman
Tetsuo Handa writes: > On 2020/07/02 22:08, Eric W. Biederman wrote: >> Tetsuo Handa writes: >> >>> On 2020/06/30 21:29, Eric W. Biederman wrote: Hmm. The wake up happens just of tgid->wait_pidfd happens just before release_task is called so there is a race. As it is possible to wak

Re: [PATCH v2 00/15] Make the user mode driver code a better citizen

2020-07-02 Thread Tetsuo Handa
On 2020/07/02 22:08, Eric W. Biederman wrote: > Tetsuo Handa writes: > >> On 2020/06/30 21:29, Eric W. Biederman wrote: >>> Hmm. The wake up happens just of tgid->wait_pidfd happens just before >>> release_task is called so there is a race. As it is possible to wake >>> up and then go back to s

Re: [PATCH v2 00/15] Make the user mode driver code a better citizen

2020-07-02 Thread Eric W. Biederman
Tetsuo Handa writes: > On 2020/06/30 21:29, Eric W. Biederman wrote: >> Hmm. The wake up happens just of tgid->wait_pidfd happens just before >> release_task is called so there is a race. As it is possible to wake >> up and then go back to sleep before pid_has_task becomes false. > > What is th

Re: [PATCH v2 00/15] Make the user mode driver code a better citizen

2020-07-01 Thread Eric W. Biederman
Alexei Starovoitov writes: > On Tue, Jun 30, 2020 at 07:29:34AM -0500, Eric W. Biederman wrote: >> >> diff --git a/net/bpfilter/bpfilter_kern.c b/net/bpfilter/bpfilter_kern.c >> index 91474884ddb7..3e1874030daa 100644 >> --- a/net/bpfilter/bpfilter_kern.c >> +++ b/net/bpfilter/bpfilter_kern.c >>

Re: [PATCH v2 00/15] Make the user mode driver code a better citizen

2020-06-30 Thread Alexei Starovoitov
On Tue, Jun 30, 2020 at 07:29:34AM -0500, Eric W. Biederman wrote: > > diff --git a/net/bpfilter/bpfilter_kern.c b/net/bpfilter/bpfilter_kern.c > index 91474884ddb7..3e1874030daa 100644 > --- a/net/bpfilter/bpfilter_kern.c > +++ b/net/bpfilter/bpfilter_kern.c > @@ -19,8 +19,8 @@ static void shutdo

Re: [PATCH v2 00/15] Make the user mode driver code a better citizen

2020-06-30 Thread Tetsuo Handa
On 2020/06/30 21:29, Eric W. Biederman wrote: > Hmm. The wake up happens just of tgid->wait_pidfd happens just before > release_task is called so there is a race. As it is possible to wake > up and then go back to sleep before pid_has_task becomes false. What is the reason we want to wait until

Re: [PATCH v2 00/15] Make the user mode driver code a better citizen

2020-06-30 Thread Eric W. Biederman
Alexei Starovoitov writes: 2> 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

Re: [PATCH v2 00/15] Make the user mode driver code a better citizen

2020-06-29 Thread Tetsuo Handa
On 2020/06/30 10:13, Eric W. Biederman wrote: > Alexei Starovoitov writes: > >> 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

Re: [PATCH v2 00/15] Make the user mode driver code a better citizen

2020-06-29 Thread Eric W. Biederman
Alexei Starovoitov writes: > 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

Re: [PATCH v2 00/15] Make the user mode driver code a better citizen

2020-06-29 Thread Alexei Starovoitov
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_BPFILT

[PATCH v2 00/15] Make the user mode driver code a better citizen

2020-06-29 Thread Eric W. Biederman
This is the second round of my changeset to split the user mode driver code from the user mode helper code, and to make the code use common facilities to get things done instead of recreating them just for the user mode driver code. I have split the changes into small enough pieces so they shoul