Messages in this thread | | | Date | Wed, 17 Jan 2018 18:39:55 +0100 | From | Oleg Nesterov <> | Subject | Re: [PATCH v2 3/3] tty: Use RCU read lock to iterate tasks and threads in __do_SAK() |
| |
On 01/17, Eric W. Biederman wrote: > > __do_SAK() needs to be 100% accurate.
But it can't. A process/thread can open tty right after the check.
> I do not see the rcu_read_lock > guaranteeing that new processes created while the process list is being > iterated that happen to have a reference to the tty will be seen.
We can't miss the new child if its parent has this tty opened at fork() time, __do_SAK() sends SIGKILL and ->siglock serializes __do_SAK() with copy_process() which checks signal_pending() under the same ->siglock. So either fork() should fail or for_each_process() should see the new child.
Right?
Otherwise we do not care. The child can open tty later but this doesn't differ from the "race" above.
Oleg.
| |