RE: [PATCH V2] binder: ipc namespace support for android binder

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> Sent: Thursday, November 8, 2018 6:38 AM
> To: chouryzhou(周威) <chouryzhou@xxxxxxxxxxx>
> Cc: gregkh@xxxxxxxxxxxxxxxxxxx; arve@xxxxxxxxxxx; tkjos@xxxxxxxxxxx;
> dave@xxxxxxxxxxxx; devel@xxxxxxxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH V2] binder: ipc namespace support for android
> binder
> 
> On Wed, 7 Nov 2018 01:48:12 +0000 chouryzhou(周威)
> <chouryzhou@xxxxxxxxxxx> wrote:
> 
> > > > --- a/ipc/namespace.c
> > > > +++ b/ipc/namespace.c
> > > > @@ -56,6 +56,9 @@ static struct ipc_namespace *create_ipc_ns(struct
> > > user_namespace *user_ns,
> > > >         ns->ucounts = ucounts;
> > > >
> > > >         err = mq_init_ns(ns);
> > > > +       if (err)
> > > > +               goto fail_put;
> > > > +       err = binder_init_ns(ns);
> > > >         if (err)
> > > >                 goto fail_put;
> > > >
> > >
> > > Don't we need an mq_put_mnt() if binder_init_ns() fails?
> > >
> > > free_ipc_ns() seems to have forgotten about that too.  In which case it
> > > must be madly leaking mounts so probably I'm wrong.  Confused.
> > >
> >
> > mq_init_ns will do clean job if it failed, and as do binder_init_ns.
> 
> My point is that if mq_init_ns() succeeds and binder_init_ns() fails,
> we don't undo the effects of mq_init_ns()?

Oh, mq_put_mnt is called in put_ipc_ns. We should invoke put_ipc_ns if binder_init_ns fails. I will update the patch soon. Thank you very much for pointing out the issue.
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux