All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Salyzyn <salyzyn@android.com>
To: linux-kernel@vger.kernel.org
Cc: Kevin Brodsky <kevin.brodsky@arm.com>,
	Mark Salyzyn <salyzyn@android.com>,
	James Morse <james.morse@arm.com>,
	Russell King <linux@armlinux.org.uk>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	Andy Lutomirski <luto@amacapital.net>,
	Dmitry Safonov <dsafonov@virtuozzo.com>,
	John Stultz <john.stultz@linaro.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Laura Abbott <labbott@redhat.com>,
	Kees Cook <keescook@chromium.org>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Andy Gross <andy.gross@linaro.org>,
	Andrew Pinski <apinski@cavium.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-arm-kernel@lists.infradead.org,
	Jeremy Linton <Jeremy.Linton@arm.com>,
	android-kernel@android.com, Dave Martin <Dave.Martin@arm.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>
Subject: RESEND [PATCH 1/6] arm64: compat: Use vDSO sigreturn trampolines if available
Date: Mon,  1 Oct 2018 10:58:38 -0700	[thread overview]
Message-ID: <20181001175845.168430-19-salyzyn@android.com> (raw)
In-Reply-To: <20181001175845.168430-1-salyzyn@android.com>

From: Kevin Brodsky <kevin.brodsky@arm.com>

If the compat vDSO is enabled, it replaces the sigreturn page.
Therefore, we use the sigreturn trampolines the vDSO provides instead.

Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Tested-by: Mark Salyzyn <salyzyn@android.com>
Cc: James Morse <james.morse@arm.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Laura Abbott <labbott@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Andy Gross <andy.gross@linaro.org>
Cc: Andrew Pinski <apinski@cavium.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: Jeremy Linton <Jeremy.Linton@arm.com>
Cc: android-kernel@android.com
---
 arch/arm64/include/asm/vdso.h |  3 +++
 arch/arm64/kernel/signal32.c  | 15 +++++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/arch/arm64/include/asm/vdso.h b/arch/arm64/include/asm/vdso.h
index 839ce0031bd5..f2a952338f1e 100644
--- a/arch/arm64/include/asm/vdso.h
+++ b/arch/arm64/include/asm/vdso.h
@@ -28,6 +28,9 @@
 #ifndef __ASSEMBLY__
 
 #include <generated/vdso-offsets.h>
+#ifdef CONFIG_VDSO32
+#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 6b421666b5b8..c3d9a74e3945 100644
--- a/arch/arm64/kernel/signal32.c
+++ b/arch/arm64/kernel/signal32.c
@@ -29,6 +29,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;
@@ -352,6 +353,19 @@ 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_VDSO32
+		void *vdso_base = current->mm->context.vdso;
+		void *trampoline =
+			(ka->sa.sa_flags & SA_SIGINFO
+			 ? (thumb
+			    ? VDSO_SYMBOL(vdso_base, compat_rt_sigreturn_thumb)
+			    : VDSO_SYMBOL(vdso_base, compat_rt_sigreturn_arm))
+			 : (thumb
+			    ? VDSO_SYMBOL(vdso_base, compat_sigreturn_thumb)
+			    : VDSO_SYMBOL(vdso_base, compat_sigreturn_arm)));
+
+		retcode = ptr_to_compat(trampoline) + thumb;
+#else
 		void *sigreturn_base = current->mm->context.vdso;
 		unsigned int idx = thumb << 1;
 
@@ -359,6 +373,7 @@ static void compat_setup_return(struct pt_regs *regs, struct k_sigaction *ka,
 			idx += 3;
 
 		retcode = ptr_to_compat(sigreturn_base) + (idx << 2) + thumb;
+#endif
 	}
 
 	regs->regs[0]	= usig;
-- 
2.19.0.605.g01d371f741-goog


WARNING: multiple messages have this Message-ID (diff)
From: salyzyn@android.com (Mark Salyzyn)
To: linux-arm-kernel@lists.infradead.org
Subject: RESEND [PATCH 1/6] arm64: compat: Use vDSO sigreturn trampolines if available
Date: Mon,  1 Oct 2018 10:58:38 -0700	[thread overview]
Message-ID: <20181001175845.168430-19-salyzyn@android.com> (raw)
In-Reply-To: <20181001175845.168430-1-salyzyn@android.com>

From: Kevin Brodsky <kevin.brodsky@arm.com>

If the compat vDSO is enabled, it replaces the sigreturn page.
Therefore, we use the sigreturn trampolines the vDSO provides instead.

Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Tested-by: Mark Salyzyn <salyzyn@android.com>
Cc: James Morse <james.morse@arm.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Laura Abbott <labbott@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Andy Gross <andy.gross@linaro.org>
Cc: Andrew Pinski <apinski@cavium.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: Jeremy Linton <Jeremy.Linton@arm.com>
Cc: android-kernel at android.com
---
 arch/arm64/include/asm/vdso.h |  3 +++
 arch/arm64/kernel/signal32.c  | 15 +++++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/arch/arm64/include/asm/vdso.h b/arch/arm64/include/asm/vdso.h
index 839ce0031bd5..f2a952338f1e 100644
--- a/arch/arm64/include/asm/vdso.h
+++ b/arch/arm64/include/asm/vdso.h
@@ -28,6 +28,9 @@
 #ifndef __ASSEMBLY__
 
 #include <generated/vdso-offsets.h>
+#ifdef CONFIG_VDSO32
+#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 6b421666b5b8..c3d9a74e3945 100644
--- a/arch/arm64/kernel/signal32.c
+++ b/arch/arm64/kernel/signal32.c
@@ -29,6 +29,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;
@@ -352,6 +353,19 @@ 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_VDSO32
+		void *vdso_base = current->mm->context.vdso;
+		void *trampoline =
+			(ka->sa.sa_flags & SA_SIGINFO
+			 ? (thumb
+			    ? VDSO_SYMBOL(vdso_base, compat_rt_sigreturn_thumb)
+			    : VDSO_SYMBOL(vdso_base, compat_rt_sigreturn_arm))
+			 : (thumb
+			    ? VDSO_SYMBOL(vdso_base, compat_sigreturn_thumb)
+			    : VDSO_SYMBOL(vdso_base, compat_sigreturn_arm)));
+
+		retcode = ptr_to_compat(trampoline) + thumb;
+#else
 		void *sigreturn_base = current->mm->context.vdso;
 		unsigned int idx = thumb << 1;
 
@@ -359,6 +373,7 @@ static void compat_setup_return(struct pt_regs *regs, struct k_sigaction *ka,
 			idx += 3;
 
 		retcode = ptr_to_compat(sigreturn_base) + (idx << 2) + thumb;
+#endif
 	}
 
 	regs->regs[0]	= usig;
-- 
2.19.0.605.g01d371f741-goog

  parent reply	other threads:[~2018-10-01 18:04 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-01 17:58 RESEND and REBASE arm+arm64+aarch32 vdso rewrite Mark Salyzyn
2018-10-01 17:58 ` Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH v5 01/12] arm: vdso: rename vdso_datapage variables Mark Salyzyn
2018-10-01 17:58   ` Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH v5 02/12] arm: vdso: add include file defining __get_datapage() Mark Salyzyn
2018-10-01 17:58   ` Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH v5 03/12] arm: vdso: inline assembler operations to compiler.h Mark Salyzyn
2018-10-01 17:58   ` Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH v5 04/12] arm: vdso: do calculations outside reader loops Mark Salyzyn
2018-10-01 17:58   ` Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH v6 05/12] arm: vdso: Add support for CLOCK_MONOTONIC_RAW Mark Salyzyn
2018-10-01 17:58   ` Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH v5 06/12] arm: vdso: add support for clock_getres Mark Salyzyn
2018-10-01 17:58   ` Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH v5 07/12] arm: vdso: disable profiling Mark Salyzyn
2018-10-01 17:58   ` Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH v5 08/12] arm: vdso: Add ARCH_CLOCK_FIXED_MASK Mark Salyzyn
2018-10-01 17:58   ` Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH v5 09/12] arm: vdso: move vgettimeofday.c to lib/vdso/ Mark Salyzyn
2018-10-01 17:58   ` Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH v5 10/12] arm64: vdso: replace gettimeofday.S with global vgettimeofday.C Mark Salyzyn
2018-10-01 17:58   ` Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH v6 11/12] lib: vdso: Add support for CLOCK_BOOTTIME Mark Salyzyn
2018-10-01 17:58   ` Mark Salyzyn
2018-10-01 18:15   ` Thomas Gleixner
2018-10-01 18:15     ` Thomas Gleixner
2018-10-01 20:52     ` Mark Salyzyn
2018-10-01 20:52       ` Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH v5 12/12] lib: vdso: do not expose gettimeofday, if no arch supported timer Mark Salyzyn
2018-10-01 17:58   ` Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH] lib: vdso: add support for time Mark Salyzyn
2018-10-01 17:58   ` Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH v3 1/3] arm64: compat: Split the sigreturn trampolines and kuser helpers (C sources) Mark Salyzyn
2018-10-01 17:58   ` Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH v3 2/3] arm64: compat: Split the sigreturn trampolines and kuser helpers (assembler sources) Mark Salyzyn
2018-10-01 17:58   ` Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH v3 3/3] arm64: compat: Add CONFIG_KUSER_HELPERS Mark Salyzyn
2018-10-01 17:58   ` Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH] arm64: compat: Expose offset to registers in sigframes Mark Salyzyn
2018-10-01 17:58   ` Mark Salyzyn
2018-10-01 17:58 ` Mark Salyzyn [this message]
2018-10-01 17:58   ` RESEND [PATCH 1/6] arm64: compat: Use vDSO sigreturn trampolines if available Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH 2/6] arm64: elf: Set AT_SYSINFO_EHDR in compat processes Mark Salyzyn
2018-10-01 17:58   ` Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH 3/6] arm64: Refactor vDSO init/setup Mark Salyzyn
2018-10-01 17:58   ` Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH v2 4/6] arm64: compat: Add a 32-bit vDSO Mark Salyzyn
2018-10-01 17:58   ` Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH 5/6] arm64: compat: 32-bit vDSO setup Mark Salyzyn
2018-10-01 17:58   ` Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH v2 6/6] arm64: Wire up and expose the new compat vDSO Mark Salyzyn
2018-10-01 17:58   ` Mark Salyzyn
2018-10-01 18:49 ` RESEND and REBASE arm+arm64+aarch32 vdso rewrite John Stultz
2018-10-01 18:49   ` John Stultz
2018-10-01 20:44   ` Mark Salyzyn
2018-10-01 20:44     ` Mark Salyzyn
2018-10-01 21:28     ` John Stultz
2018-10-01 21:28       ` John Stultz
2018-10-02  8:50     ` Russell King - ARM Linux
2018-10-02  8:50       ` Russell King - ARM Linux
2018-10-02 14:53       ` Mark Salyzyn
2018-10-02 14:53         ` Mark Salyzyn
2018-10-02 10:00     ` Catalin Marinas
2018-10-02 10:00       ` Catalin Marinas
2018-10-02 15:09       ` Mark Salyzyn
2018-10-02 15:09         ` Mark Salyzyn
  -- strict thread matches above, loose matches on Subject: below --
2018-06-18 15:05 RESEND " Mark Salyzyn
2018-06-18 15:06 ` RESEND [PATCH 1/6] arm64: compat: Use vDSO sigreturn trampolines if available Mark Salyzyn
2018-06-18 15:06   ` Mark Salyzyn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181001175845.168430-19-salyzyn@android.com \
    --to=salyzyn@android.com \
    --cc=Dave.Martin@arm.com \
    --cc=Jeremy.Linton@arm.com \
    --cc=android-kernel@android.com \
    --cc=andy.gross@linaro.org \
    --cc=apinski@cavium.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=catalin.marinas@arm.com \
    --cc=dsafonov@virtuozzo.com \
    --cc=ebiederm@xmission.com \
    --cc=james.morse@arm.com \
    --cc=john.stultz@linaro.org \
    --cc=keescook@chromium.org \
    --cc=kevin.brodsky@arm.com \
    --cc=labbott@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=luto@amacapital.net \
    --cc=mark.rutland@arm.com \
    --cc=tglx@linutronix.de \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.