linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Andy Lutomirski <luto@kernel.org>,
	"the arch/x86 maintainers" <x86@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Borislav Petkov <bp@alien8.de>, Brian Gerst <brgerst@gmail.com>,
	David Laight <David.Laight@aculab.com>,
	Kees Cook <keescook@chromium.org>,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: x86/ldt: Prevent ldt inheritance on exec
Date: Fri, 8 Dec 2017 13:38:40 -0800	[thread overview]
Message-ID: <CA+55aFznXdyaxY8nf5O6jAzgYgKx8y4CiozLVn8vNJRZQusVoA@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1712082055390.2301@nanos>

On Fri, Dec 8, 2017 at 12:02 PM, Thomas Gleixner <tglx@linutronix.de> wrote:
>
> The reason why this happens is that init_new_context_ldt() is called from
> init_new_context() which obviously needs to be called for both fork() and
> exec().
>
> It would be surprising if anything relies on that behaviour, so it seems to
> be safe to remove that misfeature.

Looks sane. That said, can't we separate this out into the copy_mm()
phase only?

We have "arch_dup_mmap()" that is called on fork() only, so that could
do the LDT copy from the old mm, and the actual init_new_context would
just zero it out.

Then there wouldn't be any odd "check if this is an execve" because
the copying would be done in the right place.

Hmm?

             Linus

  reply	other threads:[~2017-12-08 21:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-08 20:02 x86/ldt: Prevent ldt inheritance on exec Thomas Gleixner
2017-12-08 21:38 ` Linus Torvalds [this message]
2017-12-08 21:49   ` Thomas Gleixner

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=CA+55aFznXdyaxY8nf5O6jAzgYgKx8y4CiozLVn8vNJRZQusVoA@mail.gmail.com \
    --to=torvalds@linux-foundation.org \
    --cc=David.Laight@aculab.com \
    --cc=bp@alien8.de \
    --cc=brgerst@gmail.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --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;
as well as URLs for NNTP newsgroup(s).