Commit ac21d417 authored by Dmitry Safonov's avatar Dmitry Safonov Committed by Pavel Emelyanov

restore: compare whole k_rtsigset on inherite check

k_rtsigset_t has two words on ARM32.
That for-cycle should be optimized to no-op on other archs by compiler
where _KNSIG_WORDS is 1.

So, if a child blocks the signal which number is > 32 in this mask,
and other signals properties are the same - it will not have it blocked
after C/R.

Impact: fix for signals restoring on ARM32.

Cc: Christopher Covington <cov@codeaurora.org>
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
Reviewed-by: 's avatarChristopher Covington <cov@codeaurora.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 8fa70268
......@@ -277,15 +277,20 @@ static rt_sigaction_t parent_act[SIGMAX];
static bool sa_inherited(int sig, rt_sigaction_t *sa)
{
rt_sigaction_t *pa;
int i;
if (current == root_item)
return false; /* XXX -- inherit from CRIU? */
pa = &parent_act[sig];
for (i = 0; i < _KNSIG_WORDS; i++)
if (pa->rt_sa_mask.sig[i] != sa->rt_sa_mask.sig[i])
return false;
return pa->rt_sa_handler == sa->rt_sa_handler &&
pa->rt_sa_flags == sa->rt_sa_flags &&
pa->rt_sa_restorer == sa->rt_sa_restorer &&
pa->rt_sa_mask.sig[0] == sa->rt_sa_mask.sig[0];
pa->rt_sa_restorer == sa->rt_sa_restorer;
}
/* Returns number of restored signals, -1 or negative errno on fail */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment