linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch V2 0/2] x86/ldt: Prevent LDT inheritance on exec()
@ 2017-12-08 22:32 Thomas Gleixner
  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
  0 siblings, 2 replies; 7+ messages in thread
From: Thomas Gleixner @ 2017-12-08 22:32 UTC (permalink / raw)
  To: LKML
  Cc: Linus Torvalds, x86, Peter Zijlstra, Andy Lutomirski,
	Borislav Petkov, Brian Gerst, David Laight, Kees Cook

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(-)

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-12-12 17:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-08 22:32 [patch V2 0/2] x86/ldt: Prevent LDT inheritance on exec() Thomas Gleixner
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

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).