Skip to content

x86/ldt: Prevent LDT inheritance on exec()

Thomas Gleixner lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest2 patches 4 repliesIn review

Changes in v2 from the cover letter

Moved the duplication to arch_dup_mmap() as suggested by Linus.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2arch: Allow arch_dup_mmap() to failarch/powerpc/include/asm/mmu_context.h arch/um/include/asm/mmu_context.h arch/unicore32/include/asm/mmu_context.h +3 more+14 -110 replies
2/2x86/ldt: Prevent ldt inheritance on execarch/x86/include/asm/mmu_context.h arch/x86/kernel/ldt.c tools/testing/selftests/x86/ldt_gdt.c+23 -254 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [patch V2 0/2] x86/ldt: Prevent LDT inheritance on exec()

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