From patchwork Tue Aug 6 15:35:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Mendoza X-Patchwork-Id: 265086 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 7F44E2C008E for ; Wed, 7 Aug 2013 01:36:56 +1000 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1V6jJT-0002f0-HM; Tue, 06 Aug 2013 15:36:43 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1V6jJN-0002e3-WC for kernel-team@lists.ubuntu.com; Tue, 06 Aug 2013 15:36:37 +0000 Received: from [200.75.117.138] (helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1V6jJN-0007G9-Ip; Tue, 06 Aug 2013 15:36:37 +0000 From: Ricardo Mendoza To: kernel-team@lists.ubuntu.com Subject: [PATCH][SAUCY][GROUPER] binder: search for receiving context pid in global namespace Date: Tue, 6 Aug 2013 11:05:54 -0430 Message-Id: <1375803357-2095-1-git-send-email-ricardo.mendoza@canonical.com> X-Mailer: git-send-email 1.8.3.2 Cc: ubuntu-phone@lists.launchpad.net, ricardo.savelti@canonical.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com If binder cannot find the receiving task in the sender's namespace it will default to a null PID which thus breaks communication in our container-based scenario. This patch extends binder to first look in the senders namespace and if unsuccesfull search in the global namespace. Signed-off-by: Ricardo Mendoza --- drivers/staging/android/binder.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c index e13b4c4..3b35a23 100644 --- a/drivers/staging/android/binder.c +++ b/drivers/staging/android/binder.c @@ -2427,6 +2427,8 @@ retry: struct task_struct *sender = t->from->proc->tsk; tr.sender_pid = task_tgid_nr_ns(sender, current->nsproxy->pid_ns); + if (tr.sender_pid == 0) + tr.sender_pid = task_tgid_nr(sender); } else { tr.sender_pid = 0; }