lkml.org 
[lkml]   [2017]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch V2 2/2] x86/ldt: Prevent ldt inheritance on exec
On Mon, 11 Dec 2017, Peter Zijlstra wrote:
> 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.

Yeah, found that and fixed that already. Next version will be perfect :)

\
 
 \ /
  Last update: 2017-12-12 18:01    [W:0.048 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site