From a4eacf3227bd9978e420eebb1b4520d3b43e433f Mon Sep 17 00:00:00 2001 From: Todd Kjos Date: Thu, 11 Nov 2021 18:31:04 -0800 Subject: [PATCH] ANDROID: binder: fix regression in sender_euid A recent change to use proc->cred instead of proc->tsk as the source for sender_euid caused a failure in the CredentialsTest#CaptureLayersTest test. Revert 1 line of the patch to fix the test. The rest of the patch needs to remain since the subsequent patches rely on it. Before fixing upstream, we need to investigate more since the code looks correct so the issue may be a latent userspace bug. Bug: 205938623 Fixes: d65efd5b73dc ("UPSTREAM: binder: use euid from cred instead of using task") Signed-off-by: Todd Kjos Change-Id: I16543a50f43f79131234995fb0813de00795bd3d --- drivers/android/binder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/android/binder.c b/drivers/android/binder.c index 962f3203aa6a..b03bf4e11a08 100644 --- a/drivers/android/binder.c +++ b/drivers/android/binder.c @@ -2845,7 +2845,7 @@ static void binder_transaction(struct binder_proc *proc, t->from = thread; else t->from = NULL; - t->sender_euid = binder_get_cred(proc)->euid; + t->sender_euid = task_euid(proc->tsk); t->to_proc = target_proc; t->to_thread = target_thread; t->code = tr->code;