From: Dave Hansen <dave.hansen@linux.intel.com>
To: linux-kernel@vger.kernel.org
Cc: Dave Hansen <dave.hansen@linux.intel.com>,
thomas.lendacky@amd.com, efault@gmx.de, luto@kernel.org,
arjan@linux.intel.com, bp@alien8.de, dan.j.williams@intel.com,
dwmw2@infradead.org, gregkh@linuxfoundation.org,
hughd@google.com, jpoimboe@redhat.com, jgross@suse.com,
keescook@google.com, torvalds@linux-foundation.org,
namit@vmware.com, peterz@infradead.org, tglx@linutronix.de,
linux-mm@kvack.org
Subject: [PATCH] x86, boot: initialize __default_kernel_pte_mask in KASLR code
Date: Tue, 10 Apr 2018 13:10:11 -0700 [thread overview]
Message-ID: <20180410201011.F823E22B@viggo.jf.intel.com> (raw)
The somewhat discrete arch/x86/boot/compressed code shares headers with
the main kernel, but needs its own copies of some variables. The copy
of __default_kernel_pte_mask did not get initialized correctly and has
been reported to cause boot failures when KASLR is in use by Tom
Lendacky and Mike Galibrath.
I've oddly been unable to reproduce these, but the fix is simple and
confirmed to work by Tom and Mike.
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Fixes: 64c80759408f ("x86/mm: Do not auto-massage page protections")
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Hugh Dickins <hughd@google.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Kees Cook <keescook@google.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Nadav Amit <namit@vmware.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-mm@kvack.org
---
b/arch/x86/boot/compressed/kaslr.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff -puN arch/x86/boot/compressed/kaslr.c~x86-boot-initialize-__default_kernel_pte_mask arch/x86/boot/compressed/kaslr.c
--- a/arch/x86/boot/compressed/kaslr.c~x86-boot-initialize-__default_kernel_pte_mask 2018-04-10 13:02:22.359914088 -0700
+++ b/arch/x86/boot/compressed/kaslr.c 2018-04-10 13:02:40.389914043 -0700
@@ -54,8 +54,8 @@ unsigned int ptrs_per_p4d __ro_after_ini
extern unsigned long get_cmd_line_ptr(void);
-/* Used by PAGE_KERN* macros: */
-pteval_t __default_kernel_pte_mask __read_mostly;
+/* Used by PAGE_KERN* macros, do not mask off any bits by default: */
+pteval_t __default_kernel_pte_mask __read_mostly = ~0;
/* Simplified build-specific string for starting entropy. */
static const char build_str[] = UTS_RELEASE " (" LINUX_COMPILE_BY "@"
_
reply other threads:[~2018-04-10 20:13 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20180410201011.F823E22B@viggo.jf.intel.com \
--to=dave.hansen@linux.intel.com \
--cc=arjan@linux.intel.com \
--cc=bp@alien8.de \
--cc=dan.j.williams@intel.com \
--cc=dwmw2@infradead.org \
--cc=efault@gmx.de \
--cc=gregkh@linuxfoundation.org \
--cc=hughd@google.com \
--cc=jgross@suse.com \
--cc=jpoimboe@redhat.com \
--cc=keescook@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=luto@kernel.org \
--cc=namit@vmware.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=thomas.lendacky@amd.com \
--cc=torvalds@linux-foundation.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