Re: [PATCH] userns: move user access out of the mutex
From: Serge E. Hallyn
Date: Wed Jun 27 2018 - 12:32:17 EST
Quoting Christian Brauner (christian.brauner@xxxxxxxxxxxxx):
> On Tue, Jun 26, 2018 at 04:06:45PM +0200, Jann Horn wrote:
> > On Tue, Jun 26, 2018 at 3:08 PM Christian Brauner
> > <christian.brauner@xxxxxxxxxxxxx> wrote:
> > >
> > > On Mon, Jun 25, 2018 at 06:34:19PM +0200, Jann Horn wrote:
> > > > The old code would hold the userns_state_mutex indefinitely if
> > > > memdup_user_nul stalled due to e.g. a userfault region. Prevent that by
> > > > moving the memdup_user_nul in front of the mutex_lock().
> > > >
> > > > Note: This changes the error precedence of invalid buf/count/*ppos vs
> > > > map already written / capabilities missing.
> > > >
> > > > Fixes: 22d917d80e84 ("userns: Rework the user_namespace adding uid/gid...")
> > > > Cc: stable@xxxxxxxxxxxxxxx
> > > > Signed-off-by: Jann Horn <jannh@xxxxxxxxxx>
>
> Acked-by: Christian Brauner <christian@xxxxxxxxxx>
Acked-by: Serge Hallyn <serge@xxxxxxxxxx>
thanks.
-serge