Skip to contentSkip to conversation

c/r of pdeath

DISCUSSION Serge E. Hallyn 2 participants 4 messages Jun 19, 2009 – Jun 20, 2009 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

Hi Oren,

commit 9a45e26c0aabda6a94e2ac620befd8ee12a7363d adds reset of pdeath_signal. It does so unconditionally. I don't think that's safe. Perhaps if pdeath_signal is anything other than 0, it should only be restored if the task is capable(CAP_KILL)?

-serge

A message that is not in the archive (sent off-list or not yet received): 20090619182114.GA27320-r/[email protected]

#2 lore raw
Quoted 7 lines · Serge E. Hallyn

Hi Oren,

commit 9a45e26c0aabda6a94e2ac620befd8ee12a7363d adds reset of pdeath_signal. It does so unconditionally. I don't think that's safe. Perhaps if pdeath_signal is anything other than 0, it should only be restored if the task is capable(CAP_KILL)?

Hmmm... maybe I'm missing something here, but --

pdeath_signal indicates that the process wishes to receive a signal, not to send one. It may change through prctl() without requiring any capabilities from the caller. Finally it is reset at fork/clone.

So at worse it will kill the specific task that holds it ?

--

As a side note - for a brief moment I worried that it may break restart with zombies, if the to-be-zombie process has a child that already restarted (including pdeath_signal) and then exits, then the child will receive a signal unwillingly.

I then realized that it's safe as long as we restore parents before their children. In turn this depends on the checkpoint order, which indeed operates this way.

Otherwise we would have needed set this to all processes after all zombies indeed have terminated - which means another sync point at restart, or a sweep by coordinator on all tasks.

Oren.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 5 lines · Oren Laadan
Quoted 2 lines · Serge E. Hallyn

Hi Oren,

Quoted 7 lines
Quoted 5 lines

commit 9a45e26c0aabda6a94e2ac620befd8ee12a7363d adds reset of pdeath_signal. It does so unconditionally. I don't think that's safe. Perhaps if pdeath_signal is anything other than 0, it should only be restored if the task is capable(CAP_KILL)?

Hmmm... maybe I'm missing something here, but --

Nope, you're not. I was thinking wrong.

Quoted 23 lines

pdeath_signal indicates that the process wishes to receive a signal, not to send one. It may change through prctl() without requiring any capabilities from the caller. Finally it is reset at fork/clone.

So at worse it will kill the specific task that holds it ?

--

As a side note - for a brief moment I worried that it may break restart with zombies, if the to-be-zombie process has a child that already restarted (including pdeath_signal) and then exits, then the child will receive a signal unwillingly.

I then realized that it's safe as long as we restore parents before their children. In turn this depends on the checkpoint order, which indeed operates this way.

Otherwise we would have needed set this to all processes after all zombies indeed have terminated - which means another sync point at restart, or a sweep by coordinator on all tasks.

Oren.

#5 lore raw
In reply to a message not in the archive
Quoted 21 lines · Oren Laadan
Quoted 7 lines · Serge E. Hallyn

Hi Oren,

commit 9a45e26c0aabda6a94e2ac620befd8ee12a7363d adds reset of pdeath_signal. It does so unconditionally. I don't think that's safe. Perhaps if pdeath_signal is anything other than 0, it should only be restored if the task is capable(CAP_KILL)?

Hmmm... maybe I'm missing something here, but --

pdeath_signal indicates that the process wishes to receive a signal, not to send one. It may change through prctl() without requiring any capabilities from the caller. Finally it is reset at fork/clone.

So at worse it will kill the specific task that holds it ?

--

Quoted 8 lines

As a side note - for a brief moment I worried that it may break restart with zombies, if the to-be-zombie process has a child that already restarted (including pdeath_signal) and then exits, then the child will receive a signal unwillingly.

I then realized that it's safe as long as we restore parents before their children. In turn this depends on the checkpoint order, which indeed operates this way.

Bahh... silly me -
it's handled by commit efd1403a4606e0d6bd84299dab0b74792531c712 "c/r: introduce PF_RESTARTING, and skip notification on exit"

Oren.