need to save/restore arm register(r11) when it is corrupted in kernel-arch-arm

asked 2017-07-03 11:50:48 +0300

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

updated 2018-07-17 09:53:15 +0300

lpr gravatar image

In cpu_v7_do_suspend routine, r11 is used while it is NOT saved/restored, different compiler may have different usage of ARM general registers, so it may cause issues during calling cpu_v7_do_suspend.

We meet kernel fault occurs when using GCC 4.8.3, r11 contains valid value before calling into cpu_v7_do_suspend, but when returned from this routine, r11 is corrupted and lead to kernel fault. Doing save/restore for those corrupted registers is a must in assemble code.

Patch for kernel 3.4 is available

File affected: kernel-adaptation-sbj-3.4.108.20161101.1/arch/arm/mm/proc-v7.S lines 97-103; 108-114

edit retag flag offensive close delete

Comments

1

CVE info missing

coderus ( 2017-07-03 12:06:26 +0300 )edit
2

@coderus This is not a security vulnerability, therefore there is no CVE.

raimue ( 2017-07-03 14:52:51 +0300 )edit