mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Linus Torvalds <torvalds@linux-foundation.org>
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 22:49:45 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.20.1712082248260.2301@nanos> (raw)
In-Reply-To: <CA+55aFznXdyaxY8nf5O6jAzgYgKx8y4CiozLVn8vNJRZQusVoA@mail.gmail.com>

On Fri, 8 Dec 2017, Linus Torvalds wrote:

> 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.

Yes, that should work. It just needs to change arch_dup_mmap() so it can
return an error code.

Thanks,

	tglx

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

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

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=alpine.DEB.2.20.1712082248260.2301@nanos \
    --to=tglx@linutronix.de \
    --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=torvalds@linux-foundation.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

all inboxes | Powered by JetHome®