diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2015-09-09 21:19:49 +0100 |
---|---|---|
committer | Jeff Vander Stoep <jeffv@google.com> | 2016-01-25 09:27:29 -0800 |
commit | b59db83c6edc5e9c48ea4ddaaaa7cd7f174df3a5 (patch) | |
tree | 12d7d182b250f0050f1cc7e4e28987b3a6ab2842 | |
parent | 0e18e5355bb66e54159bb685e2766779aa75ac74 (diff) | |
download | hikey-linaro-b59db83c6edc5e9c48ea4ddaaaa7cd7f174df3a5.tar.gz |
UPSTREAM: ARM: uaccess: fix undefined instruction on ARMv7M/noMMU
The use of get_domain() in copy_thread() results in an oops on
ARMv7M/noMMU systems. The thread cpu_domain value is only used when
CONFIG_CPU_USE_DOMAINS is enabled, so there's no need to save the
value in copy_thread() except when this is enabled, and this option
will never be enabled on these platforms.
Unhandled exception: IPSR = 00000006 LR = fffffff1
CPU: 0 PID: 0 Comm: swapper Not tainted 4.2.0-next-20150909-00001-gb8ec5ad #41
Hardware name: NXP LPC18xx/43xx (Device Tree)
task: 2823fbe0 ti: 2823c000 task.ti: 2823c000
PC is at copy_thread+0x18/0x92
LR is at copy_thread+0x19/0x92
pc : [<2800a46e>] lr : [<2800a46f>] psr: 4100000b
sp : 2823df00 ip : 00000000 fp : 287c81c0
r10: 00000000 r9 : 00800300 r8 : 287c8000
r7 : 287c8000 r6 : 2818908d r5 : 00000000 r4 : 287ca000
r3 : 00000000 r2 : 00000000 r1 : fffffff0 r0 : 287ca048
xPSR: 4100000b
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Bug: 25672827
Patchset: PAN emulation
(cherry picked from commit af4cb25df93d2e7a97d65db2bfacaa4400988dea)
Signed-off-by: Kees Cook <keescook@google.com>
Change-Id: I2aa2bf6c1153732c68919ff465ada7878d327310
-rw-r--r-- | arch/arm/kernel/process.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 6cc5ba29ad47..21a80630c9cb 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c @@ -296,6 +296,7 @@ copy_thread(unsigned long clone_flags, unsigned long stack_start, memset(&thread->cpu_context, 0, sizeof(struct cpu_context_save)); +#ifdef CONFIG_CPU_USE_DOMAINS /* * Copy the initial value of the domain access control register * from the current thread: thread->addr_limit will have been @@ -303,6 +304,7 @@ copy_thread(unsigned long clone_flags, unsigned long stack_start, * kernel/fork.c */ thread->cpu_domain = get_domain(); +#endif if (likely(!(p->flags & PF_KTHREAD))) { *childregs = *current_pt_regs(); |