From: Kees Cook <keescook@chromium.org>
To: Andy Lutomirski <luto@kernel.org>
Cc: x86@kernel.org, LKML <linux-kernel@vger.kernel.org>,
Florian Weimer <fweimer@redhat.com>, Jann Horn <jannh@google.com>,
Borislav Petkov <bp@alien8.de>,
Kernel Hardening <kernel-hardening@lists.openwall.com>,
Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH v2 7/8] x86/vsyscall: Add __ro_after_init to global variables
Date: Thu, 27 Jun 2019 10:30:14 -0700 [thread overview]
Message-ID: <201906271030.A5C7F4A202@keescook> (raw)
In-Reply-To: <a386925835e49d319e70c4d7404b1f6c3c2e3702.1561610354.git.luto@kernel.org>
On Wed, Jun 26, 2019 at 09:45:08PM -0700, Andy Lutomirski wrote:
> The vDSO is only configurable by command-line options, so make its
> global variables __ro_after_init. This seems highly unlikely to
> ever stop an exploit, but I think it's nice anyway.
>
> Cc: Kees Cook <keescook@chromium.org>
> Cc: Borislav Petkov <bp@alien8.de>
> Cc: Kernel Hardening <kernel-hardening@lists.openwall.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Signed-off-by: Andy Lutomirski <luto@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
-Kees
> ---
> arch/x86/entry/vsyscall/vsyscall_64.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/entry/vsyscall/vsyscall_64.c b/arch/x86/entry/vsyscall/vsyscall_64.c
> index 9c58ab807aeb..07003f3f1bfc 100644
> --- a/arch/x86/entry/vsyscall/vsyscall_64.c
> +++ b/arch/x86/entry/vsyscall/vsyscall_64.c
> @@ -42,7 +42,7 @@
> #define CREATE_TRACE_POINTS
> #include "vsyscall_trace.h"
>
> -static enum { EMULATE, XONLY, NONE } vsyscall_mode =
> +static enum { EMULATE, XONLY, NONE } vsyscall_mode __ro_after_init =
> #ifdef CONFIG_LEGACY_VSYSCALL_NONE
> NONE;
> #elif defined(CONFIG_LEGACY_VSYSCALL_XONLY)
> @@ -305,7 +305,7 @@ static const char *gate_vma_name(struct vm_area_struct *vma)
> static const struct vm_operations_struct gate_vma_ops = {
> .name = gate_vma_name,
> };
> -static struct vm_area_struct gate_vma = {
> +static struct vm_area_struct gate_vma __ro_after_init = {
> .vm_start = VSYSCALL_ADDR,
> .vm_end = VSYSCALL_ADDR + PAGE_SIZE,
> .vm_page_prot = PAGE_READONLY_EXEC,
> --
> 2.21.0
>
--
Kees Cook
next prev parent reply other threads:[~2019-06-27 17:30 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-27 4:45 [PATCH v2 0/8] vsyscall xonly mode Andy Lutomirski
2019-06-27 4:45 ` [PATCH v2 1/8] x86/vsyscall: Remove the vsyscall=native documentation Andy Lutomirski
2019-06-27 17:26 ` Kees Cook
2019-06-27 22:13 ` [tip:x86/entry] Documentation/admin: " tip-bot for Andy Lutomirski
2019-06-27 4:45 ` [PATCH v2 2/8] x86/vsyscall: Add a new vsyscall=xonly mode Andy Lutomirski
2019-06-27 17:26 ` Kees Cook
2019-06-27 22:13 ` [tip:x86/entry] " tip-bot for Andy Lutomirski
2019-06-27 4:45 ` [PATCH v2 3/8] x86/vsyscall: Show something useful on a read fault Andy Lutomirski
2019-06-27 17:28 ` Kees Cook
2019-06-27 22:14 ` [tip:x86/entry] " tip-bot for Andy Lutomirski
2019-06-27 4:45 ` [PATCH v2 4/8] x86/vsyscall: Document odd SIGSEGV error code for vsyscalls Andy Lutomirski
2019-06-27 17:28 ` Kees Cook
2019-06-27 22:15 ` [tip:x86/entry] " tip-bot for Andy Lutomirski
2019-06-27 4:45 ` [PATCH v2 5/8] selftests/x86/vsyscall: Verify that vsyscall=none blocks execution Andy Lutomirski
2019-06-27 17:29 ` Kees Cook
2019-06-27 22:16 ` [tip:x86/entry] " tip-bot for Andy Lutomirski
2019-06-27 4:45 ` [PATCH v2 6/8] x86/vsyscall: Change the default vsyscall mode to xonly Andy Lutomirski
2019-06-27 17:30 ` Kees Cook
2019-06-27 22:16 ` [tip:x86/entry] " tip-bot for Andy Lutomirski
2019-06-27 4:45 ` [PATCH v2 7/8] x86/vsyscall: Add __ro_after_init to global variables Andy Lutomirski
2019-06-27 17:30 ` Kees Cook [this message]
2019-06-27 22:17 ` [tip:x86/entry] " tip-bot for Andy Lutomirski
2019-06-27 4:45 ` [PATCH v2 8/8] selftests/x86: Add a test for process_vm_readv() on the vsyscall page Andy Lutomirski
2019-06-27 17:30 ` Kees Cook
2019-06-27 22:18 ` [tip:x86/entry] " tip-bot for Andy Lutomirski
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=201906271030.A5C7F4A202@keescook \
--to=keescook@chromium.org \
--cc=bp@alien8.de \
--cc=fweimer@redhat.com \
--cc=jannh@google.com \
--cc=kernel-hardening@lists.openwall.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).