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

Alexander Kartashov alekskartashov at parallels.com
Tue May 7 01:28:37 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.

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



More information about the CRIU mailing list