[PATCH][SAUCY][MAKO] binder: search for receiving context pid in global namespace

Ricardo Mendoza ricardo.mendoza at canonical.com
Tue Aug 6 15:35:56 UTC 2013


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 <ricardo.mendoza at canonical.com>
---
 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 85ed6cf..1e71e16 100644
--- a/drivers/staging/android/binder.c
+++ b/drivers/staging/android/binder.c
@@ -2472,6 +2472,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;
 		}
-- 
1.8.3.2





More information about the kernel-team mailing list