mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Linus Torvalds <torvalds@linuxfoundation.org>,
	x86@kernel.org, Peter Zijlstra <peterz@infradead.org>,
	Andy Lutomirski <luto@kernel.org>, Borislav Petkov <bp@alien8.de>,
	Brian Gerst <brgerst@gmail.com>,
	David Laight <David.Laight@aculab.com>,
	Kees Cook <keescook@chromium.org>
Subject: [patch V2 0/2] x86/ldt: Prevent LDT inheritance on exec()
Date: Fri, 08 Dec 2017 23:32:41 +0100	[thread overview]
Message-ID: <20171208223241.367344665@linutronix.de> (raw)

LDT should not be inherited on exec(), only on fork().

To sanitize that, the LDT initialization for a new process must be split
into parts and the actual duplication moved to arch_dup_mmap() which is
only called on fork(). This requires that arch_dup_mmap() gains a return
value.

Changes vs. V1:
  Moved the duplication to arch_dup_mmap() as suggested by Linus.

Thanks,

	tglx
---
 arch/powerpc/include/asm/mmu_context.h     |    5 +++--
 arch/x86/kernel/ldt.c                      |   17 +++++------------
 b/arch/um/include/asm/mmu_context.h        |    3 ++-
 b/arch/unicore32/include/asm/mmu_context.h |    5 +++--
 b/arch/x86/include/asm/mmu_context.h       |   24 ++++++++++++++++--------
 include/asm-generic/mm_hooks.h             |    5 +++--
 kernel/fork.c                              |    3 +--
 tools/testing/selftests/x86/ldt_gdt.c      |    9 +++------
 8 files changed, 36 insertions(+), 35 deletions(-)

             reply	other threads:[~2017-12-08 22:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-08 22:32 Thomas Gleixner [this message]
2017-12-08 22:32 ` [patch V2 1/2] arch: Allow arch_dup_mmap() to fail Thomas Gleixner
2017-12-08 22:32 ` [patch V2 2/2] x86/ldt: Prevent ldt inheritance on exec Thomas Gleixner
2017-12-09 18:24   ` Thomas Gleixner
2017-12-09 18:28     ` Thomas Gleixner
2017-12-11 12:13     ` Peter Zijlstra
2017-12-12 17:00       ` Thomas Gleixner

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=20171208223241.367344665@linutronix.de \
    --to=tglx@linutronix.de \
    --cc=David.Laight@aculab.com \
    --cc=bp@alien8.de \
    --cc=brgerst@gmail.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=peterz@infradead.org \
    --cc=torvalds@linuxfoundation.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

all inboxes | Powered by JetHome®