lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-f01703b3d2e6faf7233cedf78f1e2d31b39fa90f@git.kernel.org>
Date:   Sun, 23 Jun 2019 16:53:54 -0700
From:   tip-bot for Vincenzo Frascino <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     sthotton@...vell.com, hpa@...or.com, tglx@...utronix.de,
        andre.przywara@....com, 0x7f454c46@...il.com, arnd@...db.de,
        linux@...musvillemoes.dk, linux-kernel@...r.kernel.org,
        will.deacon@....com, pcc@...gle.com, paul.burton@...s.com,
        mingo@...nel.org, shuah@...nel.org, catalin.marinas@....com,
        daniel.lezcano@...aro.org, salyzyn@...roid.com,
        huw@...eweavers.com, vincenzo.frascino@....com,
        ralf@...ux-mips.org, linux@...linux.org.uk
Subject: [tip:timers/vdso] arm64: compat: Get sigreturn trampolines from
 vDSO

Commit-ID:  f01703b3d2e6faf7233cedf78f1e2d31b39fa90f
Gitweb:     https://git.kernel.org/tip/f01703b3d2e6faf7233cedf78f1e2d31b39fa90f
Author:     Vincenzo Frascino <vincenzo.frascino@....com>
AuthorDate: Fri, 21 Jun 2019 10:52:41 +0100
Committer:  Thomas Gleixner <tglx@...utronix.de>
CommitDate: Sat, 22 Jun 2019 21:21:09 +0200

arm64: compat: Get sigreturn trampolines from vDSO

When the compat vDSO is enabled, the sigreturn trampolines are not
anymore available through [sigpage] but through [vdso].

Add the relevant code the enable the feature.

Signed-off-by: Vincenzo Frascino <vincenzo.frascino@....com>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Tested-by: Shijith Thotton <sthotton@...vell.com>
Tested-by: Andre Przywara <andre.przywara@....com>
Cc: linux-arch@...r.kernel.org
Cc: linux-arm-kernel@...ts.infradead.org
Cc: linux-mips@...r.kernel.org
Cc: linux-kselftest@...r.kernel.org
Cc: Catalin Marinas <catalin.marinas@....com>
Cc: Will Deacon <will.deacon@....com>
Cc: Arnd Bergmann <arnd@...db.de>
Cc: Russell King <linux@...linux.org.uk>
Cc: Ralf Baechle <ralf@...ux-mips.org>
Cc: Paul Burton <paul.burton@...s.com>
Cc: Daniel Lezcano <daniel.lezcano@...aro.org>
Cc: Mark Salyzyn <salyzyn@...roid.com>
Cc: Peter Collingbourne <pcc@...gle.com>
Cc: Shuah Khan <shuah@...nel.org>
Cc: Dmitry Safonov <0x7f454c46@...il.com>
Cc: Rasmus Villemoes <linux@...musvillemoes.dk>
Cc: Huw Davies <huw@...eweavers.com>
Link: https://lkml.kernel.org/r/20190621095252.32307-15-vincenzo.frascino@arm.com

---
 arch/arm64/include/asm/vdso.h |  3 +++
 arch/arm64/kernel/signal32.c  | 26 ++++++++++++++++++++++++++
 2 files changed, 29 insertions(+)

diff --git a/arch/arm64/include/asm/vdso.h b/arch/arm64/include/asm/vdso.h
index 1f94ec19903c..9c15e0a06301 100644
--- a/arch/arm64/include/asm/vdso.h
+++ b/arch/arm64/include/asm/vdso.h
@@ -17,6 +17,9 @@
 #ifndef __ASSEMBLY__
 
 #include <generated/vdso-offsets.h>
+#ifdef CONFIG_COMPAT_VDSO
+#include <generated/vdso32-offsets.h>
+#endif
 
 #define VDSO_SYMBOL(base, name)						   \
 ({									   \
diff --git a/arch/arm64/kernel/signal32.c b/arch/arm64/kernel/signal32.c
index 8a9a5ceb63b7..12a585386c2f 100644
--- a/arch/arm64/kernel/signal32.c
+++ b/arch/arm64/kernel/signal32.c
@@ -18,6 +18,7 @@
 #include <asm/traps.h>
 #include <linux/uaccess.h>
 #include <asm/unistd.h>
+#include <asm/vdso.h>
 
 struct compat_vfp_sigframe {
 	compat_ulong_t	magic;
@@ -341,6 +342,30 @@ static void compat_setup_return(struct pt_regs *regs, struct k_sigaction *ka,
 		retcode = ptr_to_compat(ka->sa.sa_restorer);
 	} else {
 		/* Set up sigreturn pointer */
+#ifdef CONFIG_COMPAT_VDSO
+		void *vdso_base = current->mm->context.vdso;
+		void *vdso_trampoline;
+
+		if (ka->sa.sa_flags & SA_SIGINFO) {
+			if (thumb) {
+				vdso_trampoline = VDSO_SYMBOL(vdso_base,
+							compat_rt_sigreturn_thumb);
+			} else {
+				vdso_trampoline = VDSO_SYMBOL(vdso_base,
+							compat_rt_sigreturn_arm);
+			}
+		} else {
+			if (thumb) {
+				vdso_trampoline = VDSO_SYMBOL(vdso_base,
+							compat_sigreturn_thumb);
+			} else {
+				vdso_trampoline = VDSO_SYMBOL(vdso_base,
+							compat_sigreturn_arm);
+			}
+		}
+
+		retcode = ptr_to_compat(vdso_trampoline) + thumb;
+#else
 		unsigned int idx = thumb << 1;
 
 		if (ka->sa.sa_flags & SA_SIGINFO)
@@ -348,6 +373,7 @@ static void compat_setup_return(struct pt_regs *regs, struct k_sigaction *ka,
 
 		retcode = (unsigned long)current->mm->context.vdso +
 			  (idx << 2) + thumb;
+#endif
 	}
 
 	regs->regs[0]	= usig;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ