staging: android: binder: Fix use of euid

Previous thread: Staging: add android framework by Linux Kernel Mailing List on Tuesday, January 6, 2009 - 7:12 pm. (1 message)

Next thread: Staging: android: timed_gpio: Rename android_timed_gpio to timed_gpio by Linux Kernel Mailing List on Tuesday, January 6, 2009 - 7:12 pm. (1 message)
From: Linux Kernel Mailing List
Date: Tuesday, January 6, 2009 - 7:12 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9279bc...
Commit:     9279bcc31698842961a30bb05b00aef7236dd728
Parent:     a2bf2153cb2a2de341b6a87cb644870a5bde2a9d
Author:     J.R. Mauro <jrm8005@gmail.com>
AuthorDate: Mon Jan 5 17:08:53 2009 -0500
Committer:  Greg Kroah-Hartman <gregkh@suse.de>
CommitDate: Tue Jan 6 13:52:42 2009 -0800

    staging: android: binder: Fix use of euid
    
    Task credentials were moved and must be accessed through task_struct.cred
    
    Signed-off-by: J.R. Mauro <jrm8005@gmail.com>
    Cc: Arve Hjønnevåg <arve@android.com>
    Cc: Brian Swetland <swetland@google.com>
    Cc: Robert Love <rlove@google.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/staging/android/binder.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c
index 765048e..7c3da5a 100644
--- a/drivers/staging/android/binder.c
+++ b/drivers/staging/android/binder.c
@@ -1401,7 +1401,7 @@ binder_transaction(struct binder_proc *proc, struct binder_thread *thread,
 		t->from = thread;
 	else
 		t->from = NULL;
-	t->sender_euid = proc->tsk->euid;
+	t->sender_euid = proc->tsk->cred->euid;
 	t->to_proc = target_proc;
 	t->to_thread = target_thread;
 	t->code = tr->code;
@@ -2593,16 +2593,16 @@ static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 			goto err;
 		}
 		if (binder_context_mgr_uid != -1) {
-			if (binder_context_mgr_uid != current->euid) {
+			if (binder_context_mgr_uid != current->cred->euid) {
 				printk(KERN_ERR "binder: BINDER_SET_"
 				       "CONTEXT_MGR bad uid %d != %d\n",
-				       current->euid,
+				       current->cred->euid,
 				       binder_context_mgr_uid);
 				ret = -EPERM;
 				goto err;
 			}
 		} else
-			binder_context_mgr_uid = current->euid;
+			binder_context_mgr_uid = current->cred->euid;
 ...
Previous thread: Staging: add android framework by Linux Kernel Mailing List on Tuesday, January 6, 2009 - 7:12 pm. (1 message)

Next thread: Staging: android: timed_gpio: Rename android_timed_gpio to timed_gpio by Linux Kernel Mailing List on Tuesday, January 6, 2009 - 7:12 pm. (1 message)