From mboxrd@z Thu Jan 1 00:00:00 1970 From: Borislav Petkov Subject: Re: [PATCH v4 2/3] x86/ldt: Make modify_ldt optional Date: Sat, 25 Jul 2015 11:15:31 +0200 Message-ID: <20150725091531.GE3427__4307.28176511383$1437815821$gmane$org@nazgul.tnic> References: <7286d77aa81abc38dc40362e2439861427064f6f.1437802102.git.luto@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <7286d77aa81abc38dc40362e2439861427064f6f.1437802102.git.luto@kernel.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andy Lutomirski Cc: "security@kernel.org" , Peter Zijlstra , Andrew Cooper , X86 ML , linux-kernel@vger.kernel.org, Steven Rostedt , xen-devel , Jan Beulich , Sasha Levin , Boris Ostrovsky List-Id: xen-devel@lists.xenproject.org On Fri, Jul 24, 2015 at 10:36:45PM -0700, Andy Lutomirski wrote: > The modify_ldt syscall exposes a large attack surface and is > unnecessary for modern userspace. Make it optional. > > Signed-off-by: Andy Lutomirski > --- > arch/x86/Kconfig | 17 +++++++++++++++++ > arch/x86/include/asm/mmu.h | 2 ++ > arch/x86/include/asm/mmu_context.h | 31 +++++++++++++++++++++++-------- > arch/x86/kernel/Makefile | 3 ++- > arch/x86/kernel/cpu/perf_event.c | 4 ++++ > arch/x86/kernel/process_64.c | 2 ++ > arch/x86/kernel/step.c | 2 ++ > kernel/sys_ni.c | 1 + > 8 files changed, 53 insertions(+), 9 deletions(-) > > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig > index b3a1a5d77d92..ede52be845db 100644 > --- a/arch/x86/Kconfig > +++ b/arch/x86/Kconfig > @@ -1015,6 +1015,7 @@ config VM86 > config X86_16BIT > bool "Enable support for 16-bit segments" if EXPERT > default y > + depends on MODIFY_LDT_SYSCALL > ---help--- > This option is required by programs like Wine to run 16-bit > protected mode legacy code on x86 processors. Disabling > @@ -2053,6 +2054,22 @@ config CMDLINE_OVERRIDE > This is used to work around broken boot loaders. This should > be set to 'N' under normal conditions. > > +config MODIFY_LDT_SYSCALL > + bool "Enable the LDT (local descriptor table)" if EXPERT bool "Enable modify_ldt() for per-process Local Descriptor Table" is how I'd call it. > + default y Is that "default y" going to turn into a "default n" after a grace period? > + ---help--- > + Linux can allow user programs to install a per-process x86 > + Local Descriptor Table (LDT) using the modify_ldt(2) system > + call. This is required to run 16-bit or segmented code such as > + DOSEMU or some Wine programs. It is also used by some very old > + threading libraries. > + > + Enabling this feature adds a small amount of overhead to > + context switches and increases the low-level kernel attack > + surface. Disabling it removes the modify_ldt(2) system call. > + > + Saying 'N' here may make sense for embedded or server kernels. -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply. --