From ae729638efe20783c93a7f25c9dd7479cd26fa40 Mon Sep 17 00:00:00 2001 From: Andrey Vagin Date: Wed, 24 Apr 2013 20:09:19 +0400 Subject: [PATCH] restore: fix restoring signal blocking mask on arm RT_SIGFRAME_UC(sigframe).uc_sigmask.sig = args->blk_sigset; blk_sigset is u64, but uc_sigmask.sig has type ulong [2], so only a part of mask is restore here. This patch reworks restoring of blocking masks symmetrically to dumping these masks. Signed-off-by: Andrey Vagin Tested-by: Alexander Kartashov Signed-off-by: Pavel Emelyanov --- cr-restore.c | 5 +++-- pie/restorer.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cr-restore.c b/cr-restore.c index d9f074b68..5161433c0 100644 --- a/cr-restore.c +++ b/cr-restore.c @@ -2025,7 +2025,8 @@ static int sigreturn_restore(pid_t pid, CoreEntry *core) thread_args[i].futex_rla = tcore->thread_core->futex_rla; thread_args[i].futex_rla_len = tcore->thread_core->futex_rla_len; thread_args[i].has_blk_sigset = tcore->thread_core->has_blk_sigset; - thread_args[i].blk_sigset = tcore->thread_core->blk_sigset; + memcpy(&thread_args[i].blk_sigset, + &tcore->thread_core->blk_sigset, sizeof(k_rtsigset_t)); ret = prep_sched_info(&thread_args[i].sp, tcore->thread_core); if (ret) @@ -2045,7 +2046,7 @@ static int sigreturn_restore(pid_t pid, CoreEntry *core) } - task_args->t->blk_sigset = core->tc->blk_sigset; + memcpy(&task_args->t->blk_sigset, &core->tc->blk_sigset, sizeof(k_rtsigset_t)); task_args->t->has_blk_sigset = true; /* diff --git a/pie/restorer.c b/pie/restorer.c index b92b54d11..50d08e608 100644 --- a/pie/restorer.c +++ b/pie/restorer.c @@ -259,7 +259,7 @@ static int restore_thread_common(struct rt_sigframe *sigframe, } if (args->has_blk_sigset) - RT_SIGFRAME_UC(sigframe).uc_sigmask.sig[0] = args->blk_sigset; + RT_SIGFRAME_UC(sigframe).uc_sigmask = args->blk_sigset; restore_sched_info(&args->sp); if (restore_fpu(sigframe, args))