mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-30 22:05:36 +00:00
dump: update task registers if a signal is started handling
When we try to execute a parasite code, a signal can be started handling, so we need to update a task registers, which will be saved in a core file. Signed-off-by: Andrey Vagin <avagin@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
9b656a47d0
commit
0cda60e334
@@ -77,7 +77,8 @@ int syscall_seized(struct parasite_ctl *ctl, int nr, unsigned long *ret,
|
||||
regs.ARM_r5 = arg6;
|
||||
|
||||
parasite_setup_regs(ctl->syscall_ip, 0, ®s);
|
||||
err = __parasite_execute(ctl, ctl->pid.real, ®s);
|
||||
err = __parasite_execute(ctl, ctl->pid.real, ®s,
|
||||
&ctl->threads[0].regs_orig);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
|
@@ -101,7 +101,8 @@ int syscall_seized(struct parasite_ctl *ctl, int nr, unsigned long *ret,
|
||||
regs.r9 = arg6;
|
||||
|
||||
parasite_setup_regs(ctl->syscall_ip, 0, ®s);
|
||||
err = __parasite_execute(ctl, ctl->pid.real, ®s);
|
||||
err = __parasite_execute(ctl, ctl->pid.real, ®s,
|
||||
&ctl->threads[0].regs_orig);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
|
@@ -93,7 +93,9 @@ int syscall_seized(struct parasite_ctl *ctl, int nr, unsigned long *ret,
|
||||
unsigned long arg5,
|
||||
unsigned long arg6);
|
||||
|
||||
extern int __parasite_execute(struct parasite_ctl *ctl, pid_t pid, user_regs_struct_t *regs);
|
||||
extern int __parasite_execute(struct parasite_ctl *ctl, pid_t pid,
|
||||
user_regs_struct_t *regs,
|
||||
user_regs_struct_t *regs_orig);
|
||||
extern bool arch_can_dump_task(pid_t pid);
|
||||
|
||||
extern int parasite_fixup_vdso(struct parasite_ctl *ctl, pid_t pid,
|
||||
|
@@ -63,7 +63,9 @@ static struct vma_area *get_vma_by_ip(struct list_head *vma_area_list, unsigned
|
||||
}
|
||||
|
||||
/* we run at @regs->ip */
|
||||
int __parasite_execute(struct parasite_ctl *ctl, pid_t pid, user_regs_struct_t *regs)
|
||||
int __parasite_execute(struct parasite_ctl *ctl, pid_t pid,
|
||||
user_regs_struct_t *regs,
|
||||
user_regs_struct_t *regs_orig)
|
||||
{
|
||||
siginfo_t siginfo;
|
||||
int status;
|
||||
@@ -171,7 +173,7 @@ retry_signal:
|
||||
pr_perror("Can't obtain registers (pid: %d)", pid);
|
||||
goto err;
|
||||
}
|
||||
ctl->threads[0].regs_orig = r;
|
||||
*regs_orig = r;
|
||||
}
|
||||
|
||||
goto again;
|
||||
@@ -208,7 +210,7 @@ static int parasite_execute_by_id(unsigned int cmd, struct parasite_ctl *ctl, in
|
||||
|
||||
parasite_setup_regs(ctl->parasite_ip, thread->rstack, ®s);
|
||||
|
||||
ret = __parasite_execute(ctl, pid, ®s);
|
||||
ret = __parasite_execute(ctl, pid, ®s, &thread->regs_orig);
|
||||
if (ret == 0)
|
||||
ret = (int)REG_RES(regs);
|
||||
|
||||
|
Reference in New Issue
Block a user