Re: [PATCH v3 2/3] x86/ldt: Make modify_ldt optional

2015-07-24 Thread Willy Tarreau
On Fri, Jul 24, 2015 at 09:24:51AM +0200, Willy Tarreau wrote: > On Thu, Jul 23, 2015 at 05:09:21PM -0700, Kees Cook wrote: > > > All this to say that probably only a handful of tricky syscalls would > > > need an on/off switch but clearly not all of them at all, so I'd rather > > > add a few

Re: [PATCH v3 2/3] x86/ldt: Make modify_ldt optional

2015-07-24 Thread Willy Tarreau
On Thu, Jul 23, 2015 at 05:09:21PM -0700, Kees Cook wrote: > > All this to say that probably only a handful of tricky syscalls would > > need an on/off switch but clearly not all of them at all, so I'd rather > > add a few entries just for the relevant ones, mainly to fix compatibility > > issues

Re: [PATCH v3 2/3] x86/ldt: Make modify_ldt optional

2015-07-24 Thread Willy Tarreau
On Thu, Jul 23, 2015 at 05:09:21PM -0700, Kees Cook wrote: All this to say that probably only a handful of tricky syscalls would need an on/off switch but clearly not all of them at all, so I'd rather add a few entries just for the relevant ones, mainly to fix compatibility issues and

Re: [PATCH v3 2/3] x86/ldt: Make modify_ldt optional

2015-07-24 Thread Willy Tarreau
On Fri, Jul 24, 2015 at 09:24:51AM +0200, Willy Tarreau wrote: On Thu, Jul 23, 2015 at 05:09:21PM -0700, Kees Cook wrote: All this to say that probably only a handful of tricky syscalls would need an on/off switch but clearly not all of them at all, so I'd rather add a few entries just

Re: [PATCH v3 2/3] x86/ldt: Make modify_ldt optional

2015-07-23 Thread Kees Cook
On Thu, Jul 23, 2015 at 4:58 PM, Willy Tarreau wrote: > On Thu, Jul 23, 2015 at 04:40:14PM -0700, Andy Lutomirski wrote: >> On Thu, Jul 23, 2015 at 4:36 PM, Kees Cook wrote: >> > I've been pondering something like this that is even MORE generic, for >> > any syscall. Something like a "syscalls"

Re: [PATCH v3 2/3] x86/ldt: Make modify_ldt optional

2015-07-23 Thread Willy Tarreau
On Thu, Jul 23, 2015 at 04:40:14PM -0700, Andy Lutomirski wrote: > On Thu, Jul 23, 2015 at 4:36 PM, Kees Cook wrote: > > I've been pondering something like this that is even MORE generic, for > > any syscall. Something like a "syscalls" directory under > > /proc/sys/kernel, with 1 entry per

Re: [PATCH v3 2/3] x86/ldt: Make modify_ldt optional

2015-07-23 Thread Andy Lutomirski
On Thu, Jul 23, 2015 at 4:36 PM, Kees Cook wrote: > On Thu, Jul 23, 2015 at 3:24 AM, Willy Tarreau wrote: >> #ifdef CONFIG_SMP >> static void flush_ldt(void *current_mm) >> { >> @@ -254,6 +260,9 @@ asmlinkage int sys_modify_ldt(int func, void __user *ptr, >> { >> int ret = -ENOSYS;

Re: [PATCH v3 2/3] x86/ldt: Make modify_ldt optional

2015-07-23 Thread Kees Cook
On Thu, Jul 23, 2015 at 3:24 AM, Willy Tarreau wrote: > Hi Andy, > > On Wed, Jul 22, 2015 at 12:23:47PM -0700, Andy Lutomirski wrote: >> The modify_ldt syscall exposes a large attack surface and is >> unnecessary for modern userspace. Make it optional. > > Wouldn't you prefer something like this

Re: [PATCH v3 2/3] x86/ldt: Make modify_ldt optional

2015-07-23 Thread Willy Tarreau
Hi Andy, On Wed, Jul 22, 2015 at 12:23:47PM -0700, Andy Lutomirski wrote: > The modify_ldt syscall exposes a large attack surface and is > unnecessary for modern userspace. Make it optional. Wouldn't you prefer something like this which makes it possible to re-enable it at runtime so that we

Re: [PATCH v3 2/3] x86/ldt: Make modify_ldt optional

2015-07-23 Thread Jan Beulich
>>> On 22.07.15 at 21:23, wrote: > --- 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

Re: [PATCH v3 2/3] x86/ldt: Make modify_ldt optional

2015-07-23 Thread Kees Cook
On Thu, Jul 23, 2015 at 4:58 PM, Willy Tarreau w...@1wt.eu wrote: On Thu, Jul 23, 2015 at 04:40:14PM -0700, Andy Lutomirski wrote: On Thu, Jul 23, 2015 at 4:36 PM, Kees Cook keesc...@chromium.org wrote: I've been pondering something like this that is even MORE generic, for any syscall.

Re: [PATCH v3 2/3] x86/ldt: Make modify_ldt optional

2015-07-23 Thread Kees Cook
On Thu, Jul 23, 2015 at 3:24 AM, Willy Tarreau w...@1wt.eu wrote: Hi Andy, On Wed, Jul 22, 2015 at 12:23:47PM -0700, Andy Lutomirski wrote: The modify_ldt syscall exposes a large attack surface and is unnecessary for modern userspace. Make it optional. Wouldn't you prefer something like

Re: [PATCH v3 2/3] x86/ldt: Make modify_ldt optional

2015-07-23 Thread Willy Tarreau
On Thu, Jul 23, 2015 at 04:40:14PM -0700, Andy Lutomirski wrote: On Thu, Jul 23, 2015 at 4:36 PM, Kees Cook keesc...@chromium.org wrote: I've been pondering something like this that is even MORE generic, for any syscall. Something like a syscalls directory under /proc/sys/kernel, with 1

Re: [PATCH v3 2/3] x86/ldt: Make modify_ldt optional

2015-07-23 Thread Andy Lutomirski
On Thu, Jul 23, 2015 at 4:36 PM, Kees Cook keesc...@chromium.org wrote: On Thu, Jul 23, 2015 at 3:24 AM, Willy Tarreau w...@1wt.eu wrote: #ifdef CONFIG_SMP static void flush_ldt(void *current_mm) { @@ -254,6 +260,9 @@ asmlinkage int sys_modify_ldt(int func, void __user *ptr, {

Re: [PATCH v3 2/3] x86/ldt: Make modify_ldt optional

2015-07-23 Thread Jan Beulich
On 22.07.15 at 21:23, l...@kernel.org wrote: --- 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

Re: [PATCH v3 2/3] x86/ldt: Make modify_ldt optional

2015-07-23 Thread Willy Tarreau
Hi Andy, On Wed, Jul 22, 2015 at 12:23:47PM -0700, Andy Lutomirski wrote: The modify_ldt syscall exposes a large attack surface and is unnecessary for modern userspace. Make it optional. Wouldn't you prefer something like this which makes it possible to re-enable it at runtime so that we can

[PATCH v3 2/3] x86/ldt: Make modify_ldt optional

2015-07-22 Thread Andy Lutomirski
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

[PATCH v3 2/3] x86/ldt: Make modify_ldt optional

2015-07-22 Thread Andy Lutomirski
The modify_ldt syscall exposes a large attack surface and is unnecessary for modern userspace. Make it optional. Signed-off-by: Andy Lutomirski l...@kernel.org --- arch/x86/Kconfig | 17 + arch/x86/include/asm/mmu.h | 2 ++