]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.5.7/mips-fix-sigreturn-via-vdso-on-micromips-kernel.patch
Linux 4.14.95
[thirdparty/kernel/stable-queue.git] / releases / 4.5.7 / mips-fix-sigreturn-via-vdso-on-micromips-kernel.patch
1 From 13eb192d10bcc9ac518d57356179071d603bcb4e Mon Sep 17 00:00:00 2001
2 From: James Hogan <james.hogan@imgtec.com>
3 Date: Tue, 24 May 2016 09:35:10 +0100
4 Subject: MIPS: Fix sigreturn via VDSO on microMIPS kernel
5
6 From: James Hogan <james.hogan@imgtec.com>
7
8 commit 13eb192d10bcc9ac518d57356179071d603bcb4e upstream.
9
10 In microMIPS kernels, handle_signal() sets the isa16 mode bit in the
11 vdso address so that the sigreturn trampolines (which are offset from
12 the VDSO) get executed as microMIPS.
13
14 However commit ebb5e78cc634 ("MIPS: Initial implementation of a VDSO")
15 changed the offsets to come from the VDSO image, which already have the
16 isa16 mode bit set correctly since they're extracted from the VDSO
17 shared library symbol table.
18
19 Drop the isa16 mode bit handling from handle_signal() to fix sigreturn
20 for cores which support both microMIPS and normal MIPS. This doesn't fix
21 microMIPS only cores, since the VDSO is still built for normal MIPS, but
22 thats a separate problem.
23
24 Fixes: ebb5e78cc634 ("MIPS: Initial implementation of a VDSO")
25 Signed-off-by: James Hogan <james.hogan@imgtec.com>
26 Cc: Paul Burton <paul.burton@imgtec.com>
27 Cc: linux-mips@linux-mips.org
28 Patchwork: https://patchwork.linux-mips.org/patch/13348/
29 Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
30 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
31
32 ---
33 arch/mips/kernel/signal.c | 8 --------
34 1 file changed, 8 deletions(-)
35
36 --- a/arch/mips/kernel/signal.c
37 +++ b/arch/mips/kernel/signal.c
38 @@ -770,15 +770,7 @@ static void handle_signal(struct ksignal
39 sigset_t *oldset = sigmask_to_save();
40 int ret;
41 struct mips_abi *abi = current->thread.abi;
42 -#ifdef CONFIG_CPU_MICROMIPS
43 - void *vdso;
44 - unsigned long tmp = (unsigned long)current->mm->context.vdso;
45 -
46 - set_isa16_mode(tmp);
47 - vdso = (void *)tmp;
48 -#else
49 void *vdso = current->mm->context.vdso;
50 -#endif
51
52 if (regs->regs[0]) {
53 switch(regs->regs[2]) {