linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "chouryzhou(周威)" <chouryzhou@tencent.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"arve@android.com" <arve@android.com>,
	"tkjos@android.com" <tkjos@android.com>,
	"dave@stgolabs.net" <dave@stgolabs.net>,
	"devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"chouryzhou(周威)" <chouryzhou@tencent.com>
Subject: RE: [PATCH V2] binder: ipc namespace support for android binder
Date: Thu, 8 Nov 2018 03:01:15 +0000	[thread overview]
Message-ID: <5FBCBE569E134E4CA167B91C0A77FD610198F8406F@EXMBX-SZMAIL022.tencent.com> (raw)

> -----Original Message-----
> From: Andrew Morton <akpm@linux-foundation.org>
> Sent: Thursday, November 8, 2018 6:38 AM
> To: chouryzhou(周威) <chouryzhou@tencent.com>
> Cc: gregkh@linuxfoundation.org; arve@android.com; tkjos@android.com;
> dave@stgolabs.net; devel@driverdev.osuosl.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH V2] binder: ipc namespace support for android
> binder
> 
> On Wed, 7 Nov 2018 01:48:12 +0000 chouryzhou(周威)
> <chouryzhou@tencent.com> 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.

             reply	other threads:[~2018-11-08  3:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-08  3:01 chouryzhou(周威) [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-11-08  8:09 [PATCH V2] binder: ipc namespace support for android binder chouryzhou(周威)
2018-11-07  1:48 chouryzhou(周威)
2018-11-07 22:37 ` Andrew Morton
2018-10-29  6:18 chouryzhou(周威)
2018-11-07  0:07 ` Andrew Morton
2018-11-08  6:21 ` Davidlohr Bueso
2018-11-08  6:27   ` Davidlohr Bueso
2018-11-08  6:59 ` Davidlohr Bueso

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=5FBCBE569E134E4CA167B91C0A77FD610198F8406F@EXMBX-SZMAIL022.tencent.com \
    --to=chouryzhou@tencent.com \
    --cc=akpm@linux-foundation.org \
    --cc=arve@android.com \
    --cc=dave@stgolabs.net \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tkjos@android.com \
    /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;
as well as URLs for NNTP newsgroup(s).