From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753605AbdLHWgN (ORCPT ); Fri, 8 Dec 2017 17:36:13 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:57694 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753129AbdLHWgF (ORCPT ); Fri, 8 Dec 2017 17:36:05 -0500 Message-Id: <20171208223241.367344665@linutronix.de> User-Agent: quilt/0.63-1 Date: Fri, 08 Dec 2017 23:32:41 +0100 From: Thomas Gleixner To: LKML Cc: Linus Torvalds , x86@kernel.org, Peter Zijlstra , Andy Lutomirski , Borislav Petkov , Brian Gerst , David Laight , Kees Cook Subject: [patch V2 0/2] x86/ldt: Prevent LDT inheritance on exec() Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-)