Skip to content

Commit

Permalink
staging: android: binder: Fix use of euid
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
J.R. Mauro authored and Greg Kroah-Hartman committed Jan 6, 2009
1 parent a2bf215 commit 9279bcc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/staging/android/binder.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
binder_context_mgr_node = binder_new_node(proc, NULL, NULL);
if (binder_context_mgr_node == NULL) {
ret = -ENOMEM;
Expand Down

0 comments on commit 9279bcc

Please sign in to comment.