[CRIU] [PATCHv2 3/2] signal/arm32: copy the whole rt_sa_mask
Dmitry Safonov
dsafonov at virtuozzo.com
Fri Jun 24 03:47:58 PDT 2016
I wounder, was it ever working on ARM32?
Maybe I don't get this code right?
Cc: Christopher Covington <cov at codeaurora.org>
Cc: Cyrill Gorcunov <gorcunov at openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov at virtuozzo.com>
---
v2: add BUILD_BUG_ON for sizeof() check on rt_sa_mask
criu/cr-restore.c | 3 ++-
criu/parasite-syscall.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/criu/cr-restore.c b/criu/cr-restore.c
index e53c8848281c..d0decc609f25 100644
--- a/criu/cr-restore.c
+++ b/criu/cr-restore.c
@@ -319,7 +319,8 @@ static int restore_one_sigaction(int sig, struct cr_img *img, int pid)
ASSIGN_TYPED(act.rt_sa_handler, decode_pointer(e->sigaction));
ASSIGN_TYPED(act.rt_sa_flags, e->flags);
ASSIGN_TYPED(act.rt_sa_restorer, decode_pointer(e->restorer));
- ASSIGN_TYPED(act.rt_sa_mask.sig[0], e->mask);
+ BUILD_BUG_ON(sizeof(e->mask) != sizeof(act.rt_sa_mask.sig));
+ memcpy(act.rt_sa_mask.sig, &e->mask, sizeof(act.rt_sa_mask.sig));
sa_entry__free_unpacked(e, NULL);
diff --git a/criu/parasite-syscall.c b/criu/parasite-syscall.c
index e8e31fb2da4a..c2467dcfaf22 100644
--- a/criu/parasite-syscall.c
+++ b/criu/parasite-syscall.c
@@ -675,7 +675,8 @@ int parasite_dump_sigacts_seized(struct parasite_ctl *ctl, struct cr_imgset *cr_
ASSIGN_TYPED(se.sigaction, encode_pointer(args->sas[i].rt_sa_handler));
ASSIGN_TYPED(se.flags, args->sas[i].rt_sa_flags);
ASSIGN_TYPED(se.restorer, encode_pointer(args->sas[i].rt_sa_restorer));
- ASSIGN_TYPED(se.mask, args->sas[i].rt_sa_mask.sig[0]);
+ BUILD_BUG_ON(sizeof(se.mask) != sizeof(args->sas[0].rt_sa_mask.sig));
+ memcpy(&se.mask, args->sas[i].rt_sa_mask.sig, sizeof(se.mask));
if (pb_write_one(img, &se, PB_SIGACT) < 0)
return -1;
--
2.9.0
More information about the CRIU
mailing list