lkml.org 
[lkml]   [2018]   [Jul]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 20/20] signal: Don't restart fork when signals come in.
On Tue, Jul 24, 2018 at 10:58 AM Eric W. Biederman
<ebiederm@xmission.com> wrote:
>
> Yes you are quite right. Easy enough to fix, but it definitely needs
> to be fixed.
>
> I will respin.

Would you mind trying a slightly different approach for this?

How about moving the "copy_signal()" and "copy_sighandler()" cases up
to fairly early in the "copy_process()" function (and clean up late,
obviously).

Then, instead of that "struct multiprocess_signals" thing, just add a
"struct hlist_node node" to "struct signal" itself, and add it to the
multiprocess hlist there.

And then you can just remove it in bad_fork_cleanup_signal.

Does this make "struct signal" a bit larger? Yes, but it's not a huge
deal. We *could* make is some union with existing fields if we cared.

But I think it would make the code *much* more understandable, and it
would allow us to not have that "sigpending" copy, because you can
just populate the final "signal->shared_pending" directly.

Hmm?

Linus

\
 
 \ /
  Last update: 2018-07-24 20:30    [W:0.105 / U:13.552 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site