From: Peter Zijlstra <peterz@infradead.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
Linus Torvalds <torvalds@linuxfoundation.org>,
x86@kernel.org, Andy Lutomirski <luto@kernel.org>,
Borislav Petkov <bp@alien8.de>, Brian Gerst <brgerst@gmail.com>,
David Laight <David.Laight@aculab.com>,
Kees Cook <keescook@chromium.org>
Subject: Re: [patch V2 2/2] x86/ldt: Prevent ldt inheritance on exec
Date: Mon, 11 Dec 2017 13:13:02 +0100 [thread overview]
Message-ID: <20171211121302.bdjkhnfv2ncclrht@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <alpine.DEB.2.20.1712091922340.2301@nanos>
On Sat, Dec 09, 2017 at 07:24:35PM +0100, Thomas Gleixner wrote:
> On Fri, 8 Dec 2017, Thomas Gleixner wrote:
> > +int ldt_dup_context(struct mm_struct *old_mm, struct mm_struct *mm)
> > {
> > struct ldt_struct *new_ldt;
> > - struct mm_struct *old_mm;
> > int retval = 0;
> >
> > - mutex_init(&mm->context.lock);
> > - old_mm = current->mm;
> > - if (!old_mm) {
> > - mm->context.ldt = NULL;
> > + if (!old_mm)
> > return 0;
> > - }
> >
> > mutex_lock(&old_mm->context.lock);
>
> Bah. That's broken. It now nests into old_mm->mmap_sem which is the reverse
> lock order than in ldt_write. Will fix.
But read_ldt() will still nest mmap_sem inside context.lock, no? Lockdep
doesn't care about old_mm vs new_mm.
next prev parent reply other threads:[~2017-12-11 12:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-08 22:32 [patch V2 0/2] x86/ldt: Prevent LDT inheritance on exec() Thomas Gleixner
2017-12-08 22:32 ` [patch V2 1/2] arch: Allow arch_dup_mmap() to fail Thomas Gleixner
2017-12-08 22:32 ` [patch V2 2/2] x86/ldt: Prevent ldt inheritance on exec Thomas Gleixner
2017-12-09 18:24 ` Thomas Gleixner
2017-12-09 18:28 ` Thomas Gleixner
2017-12-11 12:13 ` Peter Zijlstra [this message]
2017-12-12 17:00 ` 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=20171211121302.bdjkhnfv2ncclrht@hirez.programming.kicks-ass.net \
--to=peterz@infradead.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=tglx@linutronix.de \
--cc=torvalds@linuxfoundation.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®