mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-29 13:28:27 +00:00
dump: Be more specific about inability to dump 32bit tasks on x86
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
f95d509d2e
commit
b5dfd452cc
@ -46,12 +46,12 @@ void parasite_setup_regs(unsigned long new_ip, user_regs_struct_t *regs)
|
|||||||
regs->ARM_cpsr &= PSR_f | PSR_s | PSR_x | PSR_T_BIT | MODE32_BIT;
|
regs->ARM_cpsr &= PSR_f | PSR_s | PSR_x | PSR_T_BIT | MODE32_BIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
int task_in_compat_mode(pid_t pid)
|
bool arch_can_dump_task(pid_t pid)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* TODO: Add proper check here
|
* TODO: Add proper check here
|
||||||
*/
|
*/
|
||||||
return 0;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int syscall_seized(struct parasite_ctl *ctl, int nr, unsigned long *ret,
|
int syscall_seized(struct parasite_ctl *ctl, int nr, unsigned long *ret,
|
||||||
|
@ -46,7 +46,7 @@ void parasite_setup_regs(unsigned long new_ip, user_regs_struct_t *regs)
|
|||||||
regs->flags &= ~(X86_EFLAGS_TF | X86_EFLAGS_DF | X86_EFLAGS_IF);
|
regs->flags &= ~(X86_EFLAGS_TF | X86_EFLAGS_DF | X86_EFLAGS_IF);
|
||||||
}
|
}
|
||||||
|
|
||||||
int task_in_compat_mode(pid_t pid)
|
static int task_in_compat_mode(pid_t pid)
|
||||||
{
|
{
|
||||||
unsigned long cs, ds;
|
unsigned long cs, ds;
|
||||||
|
|
||||||
@ -68,6 +68,16 @@ int task_in_compat_mode(pid_t pid)
|
|||||||
return cs != 0x33 || ds == 0x2b;
|
return cs != 0x33 || ds == 0x2b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool arch_can_dump_task(pid_t pid)
|
||||||
|
{
|
||||||
|
if (task_in_compat_mode(pid)) {
|
||||||
|
pr_err("Can't dump task %d running in 32-bit mode\n", pid);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
int syscall_seized(struct parasite_ctl *ctl, int nr, unsigned long *ret,
|
int syscall_seized(struct parasite_ctl *ctl, int nr, unsigned long *ret,
|
||||||
unsigned long arg1,
|
unsigned long arg1,
|
||||||
unsigned long arg2,
|
unsigned long arg2,
|
||||||
|
@ -74,6 +74,6 @@ int syscall_seized(struct parasite_ctl *ctl, int nr, unsigned long *ret,
|
|||||||
unsigned long arg6);
|
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);
|
||||||
extern int task_in_compat_mode(pid_t pid);
|
extern bool arch_can_dump_task(pid_t pid);
|
||||||
|
|
||||||
#endif /* __CR_PARASITE_SYSCALL_H__ */
|
#endif /* __CR_PARASITE_SYSCALL_H__ */
|
||||||
|
@ -767,10 +767,8 @@ struct parasite_ctl *parasite_prep_ctl(pid_t pid, struct vm_area_list *vma_area_
|
|||||||
struct parasite_ctl *ctl = NULL;
|
struct parasite_ctl *ctl = NULL;
|
||||||
struct vma_area *vma_area;
|
struct vma_area *vma_area;
|
||||||
|
|
||||||
if (task_in_compat_mode(pid)) {
|
if (!arch_can_dump_task(pid))
|
||||||
pr_err("Can't checkpoint task running in compat mode\n");
|
|
||||||
goto err;
|
goto err;
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Control block early setup.
|
* Control block early setup.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user