Commit a94512dc authored by Alexander Kartashov's avatar Alexander Kartashov Committed by Pavel Emelyanov

arm: reset the CPSR.T bit when executing the infected code

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: 's avatarAlexander Kartashov <alekskartashov@parallels.com>
Reported-by: 's avatarChanho Park <chanho61.park@samsusng.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 01c9ec61
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment