From: Andy Lutomirski <luto@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>,
Steven Rostedt <rostedt@goodmis.org>
Cc: "security@kernel.org" <security@kernel.org>,
X86 ML <x86@kernel.org>, Borislav Petkov <bp@alien8.de>,
Sasha Levin <sasha.levin@oracle.com>,
linux-kernel@vger.kernel.org,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
Boris Ostrovsky <boris.ostrovsky@oracle.com>,
Andy Lutomirski <luto@kernel.org>
Subject: [PATCH v2 0/3] x86: modify_ldt improvement, test, and config option
Date: Tue, 21 Jul 2015 12:59:28 -0700 [thread overview]
Message-ID: <cover.1437508485.git.luto@kernel.org> (raw)
Here's v2. It fixes the "dazed and confused" issue, I hope. It's also
probably a good general attack surface reduction, and it replaces some
scary code with IMO less scary code.
Also, servers and embedded systems should probably turn off modify_ldt.
This makes that possible.
Xen people, can you take a look at this? I think that, with this change,
write_ldt_entry is unnecessary.
Changes from v1:
- The config option is new.
- The test case is new.
- Fixed a missing allocation failure check.
- Fixed a use-after-free on fork().
Andy Lutomirski (3):
x86/ldt: Make modify_ldt synchronous
x86/ldt: Make modify_ldt optional
selftests/x86, x86/ldt: Add a selftest for modify_ldt
arch/x86/Kconfig | 17 ++
arch/x86/include/asm/desc.h | 15 --
arch/x86/include/asm/mmu.h | 5 +-
arch/x86/include/asm/mmu_context.h | 63 ++++-
arch/x86/kernel/Makefile | 3 +-
arch/x86/kernel/cpu/common.c | 4 +-
arch/x86/kernel/cpu/perf_event.c | 16 +-
arch/x86/kernel/ldt.c | 247 +++++++++--------
arch/x86/kernel/process_64.c | 6 +-
arch/x86/kernel/step.c | 8 +-
arch/x86/power/cpu.c | 3 +-
kernel/sys_ni.c | 1 +
tools/testing/selftests/x86/Makefile | 2 +-
tools/testing/selftests/x86/ldt_gdt.c | 492 ++++++++++++++++++++++++++++++++++
14 files changed, 730 insertions(+), 152 deletions(-)
create mode 100644 tools/testing/selftests/x86/ldt_gdt.c
--
2.4.3
next reply other threads:[~2015-07-21 19:59 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-21 19:59 Andy Lutomirski [this message]
2015-07-21 19:59 ` [PATCH v2 1/3] x86/ldt: Make modify_ldt synchronous Andy Lutomirski
2015-07-21 21:53 ` Boris Ostrovsky
2015-07-21 23:38 ` Andrew Cooper
2015-07-22 0:07 ` Andy Lutomirski
2015-07-22 0:21 ` Andrew Cooper
2015-07-22 0:28 ` Andy Lutomirski
2015-07-22 0:49 ` Andrew Cooper
2015-07-22 1:06 ` Andy Lutomirski
2015-07-22 2:04 ` [Xen-devel] " Boris Ostrovsky
2015-07-22 2:13 ` Andy Lutomirski
2015-07-22 2:01 ` Brian Gerst
2015-07-22 2:12 ` Andy Lutomirski
2015-07-22 2:53 ` Brian Gerst
2015-07-22 4:22 ` Andy Lutomirski
2015-07-21 19:59 ` [PATCH v2 2/3] x86/ldt: Make modify_ldt optional Andy Lutomirski
2015-07-21 20:20 ` Sasha Levin
2015-07-21 20:27 ` Andy Lutomirski
2015-07-21 20:28 ` Brian Gerst
2015-07-21 20:34 ` Andy Lutomirski
2015-07-21 20:54 ` Brian Gerst
2015-07-22 6:06 ` Ingo Molnar
2015-07-22 6:23 ` Andy Lutomirski
2015-07-22 6:27 ` Ingo Molnar
2015-07-22 18:49 ` Andy Lutomirski
2015-07-22 12:34 ` Willy Tarreau
2015-07-21 19:59 ` [PATCH v2 3/3] selftests/x86, x86/ldt: Add a selftest for modify_ldt Andy Lutomirski
2015-07-21 22:02 ` Boris Ostrovsky
2015-07-21 22:34 ` Andy Lutomirski
2015-07-21 23:36 ` Willy Tarreau
2015-07-21 23:40 ` 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=cover.1437508485.git.luto@kernel.org \
--to=luto@kernel.org \
--cc=boris.ostrovsky@oracle.com \
--cc=bp@alien8.de \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=sasha.levin@oracle.com \
--cc=security@kernel.org \
--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).