]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ARM: 7410/1: Add extra clobber registers for assembly in kernel_execve
authorTim Bird <tim.bird@am.sony.com>
Wed, 2 May 2012 21:55:39 +0000 (22:55 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Wed, 2 May 2012 22:37:23 +0000 (23:37 +0100)
commit77ee3c14360695e229c2f001ef54307bd63d0d6b
tree6c7f87b678267478b3fcb3a7a126c215c5f116d6
parent69964ea4c7b68c9399f7977aa5b9aa6539a6a98a
ARM: 7410/1: Add extra clobber registers for assembly in kernel_execve

The inline assembly in kernel_execve() uses r8 and r9.  Since this
code sequence does not return, it usually doesn't matter if the
register clobber list is accurate.  However, I saw a case where a
particular version of gcc used r8 as an intermediate for the value
eventually passed to r9.  Because r8 is used in the inline
assembly, and not mentioned in the clobber list, r9 was set
to an incorrect value.

This resulted in a kernel panic on execution of the first user-space
program in the system.  r9 is used in ret_to_user as the thread_info
pointer, and if it's wrong, bad things happen.

Cc: <stable@vger.kernel.org>
Signed-off-by: Tim Bird <tim.bird@am.sony.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/kernel/sys_arm.c