mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Willy Tarreau <w@1wt.eu>
To: Andy Lutomirski <luto@amacapital.net>
Cc: Ingo Molnar <mingo@kernel.org>, Brian Gerst <brgerst@gmail.com>,
	Andy Lutomirski <luto@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	"security@kernel.org" <security@kernel.org>,
	X86 ML <x86@kernel.org>, Borislav Petkov <bp@alien8.de>,
	Sasha Levin <sasha.levin@oracle.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>
Subject: Re: [PATCH v2 2/3] x86/ldt: Make modify_ldt optional
Date: Wed, 22 Jul 2015 14:34:22 +0200	[thread overview]
Message-ID: <20150722123422.GH1588@1wt.eu> (raw)
In-Reply-To: <CALCETrVDa6bYhDuQhNf79eXNOPiXXKRJgfzPm_5orWFsbG-SwQ@mail.gmail.com>

On Tue, Jul 21, 2015 at 11:23:02PM -0700, Andy Lutomirski wrote:
> >> >> +config MODIFY_LDT_SYSCALL
> >> >> +       bool "Enable the LDT (local descriptor table)" if EXPERT
> >> >> +       default y
> >> >> +       ---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.
> >> >> +
> >> >
> >> > I believe Wine still uses the LDT for thread-local data, even for 32
> >> > and 64-bit programs.  This is separate from the Linux runtime TLS.
> >> >
> >>
> >> Really?  I thought the whole reason we had three set_thread_area slots
> >> was for Wine.
> >
> > Too bad we have to guess, if only we had the Wine source code under a nicely
> > accessible Git archive or so to check?
> >
> >   git clone git://source.winehq.org/git/wine.git
> >
> > ;-)
> 
> You don't say?
> 
> It appears that Wine uses set_thread_area with a fallback to
> modify_ldt for 32-bit binaries and arch_prctl for 64-bit.

Why wouldn't we have this (as well as X86_16BIT) as a sysctl for the long
term, just like we've finally got rid of NULL mapping ? We would encourage
distros to ship with those settings disabled by default and to only enable
them when breakage is *observed*. Currently I think that adding new config
options will just make distro ship with the option enabled "just in case".

It's also a nice way to discover users of these mechanisms and to suggest
their developers to contemplate other options or to whine loudly.

Willy


  parent reply	other threads:[~2015-07-22 12:35 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-21 19:59 [PATCH v2 0/3] x86: modify_ldt improvement, test, and config option Andy Lutomirski
2015-07-21 19:59 ` [PATCH v2 1/3] x86/ldt: Make modify_ldt synchronous Andy Lutomirski
2015-07-21 21:53   ` Boris Ostrovsky
2015-07-21 23:38     ` Andrew Cooper
2015-07-22  0:07       ` Andy Lutomirski
2015-07-22  0:21         ` Andrew Cooper
2015-07-22  0:28           ` Andy Lutomirski
2015-07-22  0:49             ` Andrew Cooper
2015-07-22  1:06               ` Andy Lutomirski
2015-07-22  2:04               ` [Xen-devel] " Boris Ostrovsky
2015-07-22  2:13                 ` Andy Lutomirski
2015-07-22  2:01   ` Brian Gerst
2015-07-22  2:12     ` Andy Lutomirski
2015-07-22  2:53       ` Brian Gerst
2015-07-22  4:22         ` Andy Lutomirski
2015-07-21 19:59 ` [PATCH v2 2/3] x86/ldt: Make modify_ldt optional Andy Lutomirski
2015-07-21 20:20   ` Sasha Levin
2015-07-21 20:27     ` Andy Lutomirski
2015-07-21 20:28   ` Brian Gerst
2015-07-21 20:34     ` Andy Lutomirski
2015-07-21 20:54       ` Brian Gerst
2015-07-22  6:06       ` Ingo Molnar
2015-07-22  6:23         ` Andy Lutomirski
2015-07-22  6:27           ` Ingo Molnar
2015-07-22 18:49             ` Andy Lutomirski
2015-07-22 12:34           ` Willy Tarreau [this message]
2015-07-21 19:59 ` [PATCH v2 3/3] selftests/x86, x86/ldt: Add a selftest for modify_ldt Andy Lutomirski
2015-07-21 22:02   ` Boris Ostrovsky
2015-07-21 22:34     ` Andy Lutomirski
2015-07-21 23:36   ` Willy Tarreau
2015-07-21 23:40     ` Andy Lutomirski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150722123422.GH1588@1wt.eu \
    --to=w@1wt.eu \
    --cc=boris.ostrovsky@oracle.com \
    --cc=bp@alien8.de \
    --cc=brgerst@gmail.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=luto@kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=sasha.levin@oracle.com \
    --cc=security@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome