Patchwork [SAUCY,MAGURO] binder: search for receiving context pid in global namespace

login
register
mail settings
Submitter Ricardo Mendoza
Date Aug. 6, 2013, 3:35 p.m.
Message ID <1375803357-2095-2-git-send-email-ricardo.mendoza@canonical.com>
Download mbox | patch
Permalink /patch/265087/
State New
Headers show

Comments

Ricardo Mendoza - Aug. 6, 2013, 3:35 p.m.
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@canonical.com>
---
 drivers/staging/android/binder.c | 2 ++
 1 file changed, 2 insertions(+)

Patch

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;
 		}