[CRIU] [PATCH] arm: reset the CPSR.T bit when executing the infected code

Chanho Park chanho61.park at samsusng.com
Tue May 7 02:35:45 EDT 2013


> The infected code must be executed in the ARM mode but the dumpee may
> run in the Thumb mode while being dumped so the bit CPSR.T may be set
> when the control is transfered to the infected blobs so this code is
> executed in the Thumb mode too.
> 
> We have to clear the bit CPSR.T before transfering control to the
> infected code to prevent the behavior described above.
> 

Hi Alexander,
Thank you for your submission.
After applying this patch, I can run the test of "exec" call successfully.
In case of "dump", however, I've seen the segfault sometimes or failed to
dump.
Please see the below message of fail log.

Segfault log:
./dump_stress.sh: line 40:  5583 Killed                  setsid ./${PROG}
5583
./dump_stress.sh: line 40:  5590 Killed                  setsid ./${PROG}
5590
./dump_stress.sh: line 40:  5597 Killed                  setsid ./${PROG}
5597
./dump_stress.sh: line 40:  5604 Segmentation fault      (core dumped)
setsid ./${PROG}

Dump fail log:
(00.056605) Collecting fds (pid: 5664)
(00.056625) ----------------------------------------
(00.056725) Found 3 file descriptors
(00.056755) ----------------------------------------
(00.057121) Putting parasite blob into 0xb6f64000->0xb6cee000
(00.057490) Putting tsock into pid 5664
(00.057720) Error (parasite-syscall.c:224): Parasite exited with -22
(00.057756) Error (parasite-syscall.c:343): Can't init parasite
(00.057801) Error (parasite-syscall.c:762): 5664: Can't create a transport
socket
(00.057954) Error (parasite-syscall.c:224): Parasite exited with -2
(00.058219) Error (cr-dump.c:1408): Can't infect (pid: 5664) with parasite
(00.058398) Unlock network
(00.058427) Unfreezing tasks into 1
(00.058451)     Unseizing 5664 into 1
(00.058634) Error (cr-dump.c:1640): Dumping FAILED.

Could you run the test again using attached dump script?

> Signed-off-by: Alexander Kartashov <alekskartashov at parallels.com>
> Reported-by: Chanho Park <chanho61.park at samsusng.com>
> ---
>  arch/arm/crtools.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/crtools.c b/arch/arm/crtools.c index
> d90d4db..b9b2b8b 100644
> --- a/arch/arm/crtools.c
> +++ b/arch/arm/crtools.c
> @@ -43,7 +43,7 @@ void parasite_setup_regs(unsigned long new_ip,
> user_regs_struct_t *regs)
>  	regs->ARM_ORIG_r0 = -1;
> 
>  	/* Make sure flags are in known state */
> -	regs->ARM_cpsr &= PSR_f | PSR_s | PSR_x | PSR_T_BIT | MODE32_BIT;
> +	regs->ARM_cpsr &= PSR_f | PSR_s | PSR_x | MODE32_BIT;
>  }
> 
>  bool arch_can_dump_task(pid_t pid)
> --
> 1.7.10.4
> 
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dump_stress.sh
Type: application/octet-stream
Size: 661 bytes
Desc: not available
URL: <http://lists.openvz.org/pipermail/criu/attachments/20130507/919994f2/attachment.obj>


More information about the CRIU mailing list