The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: chouryzhou <chouryzhou@tencent.com>
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>
Subject: Re: [PATCH V2] binder: ipc namespace support for android binder
Date: Tue, 6 Nov 2018 16:07:01 -0800	[thread overview]
Message-ID: <20181106160701.5e73de3056dee7aa560e43a3@linux-foundation.org> (raw)
In-Reply-To: <5FBCBE569E134E4CA167B91C0A77FD610198F6BB7D@EXMBX-SZMAIL022.tencent.com>

On Mon, 29 Oct 2018 06:18:11 +0000 chouryzhou(周威) <chouryzhou@tencent.com> wrote:

>   We are working for running android in container, but we found that binder is
> not isolated by ipc namespace. Since binder is a form of IPC and therefore should
> be tied to ipc namespace. With this patch, we can run more than one android
> container on one host.
>   This patch move "binder_procs" and "binder_context" into ipc_namespace,
> driver will find the context from it when opening. Althought statistics in debugfs
> remain global.
> 
> ...
>
> --- 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.


  reply	other threads:[~2018-11-07  0:07 UTC|newest]

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

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=20181106160701.5e73de3056dee7aa560e43a3@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=arve@android.com \
    --cc=chouryzhou@tencent.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