Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

J.R. Mauro and committed by
Greg Kroah-Hartman
9279bcc3 a2bf2153

+4 -4
+4 -4
drivers/staging/android/binder.c
··· 1401 1401 t->from = thread; 1402 1402 else 1403 1403 t->from = NULL; 1404 - t->sender_euid = proc->tsk->euid; 1404 + t->sender_euid = proc->tsk->cred->euid; 1405 1405 t->to_proc = target_proc; 1406 1406 t->to_thread = target_thread; 1407 1407 t->code = tr->code; ··· 2593 2593 goto err; 2594 2594 } 2595 2595 if (binder_context_mgr_uid != -1) { 2596 - if (binder_context_mgr_uid != current->euid) { 2596 + if (binder_context_mgr_uid != current->cred->euid) { 2597 2597 printk(KERN_ERR "binder: BINDER_SET_" 2598 2598 "CONTEXT_MGR bad uid %d != %d\n", 2599 - current->euid, 2599 + current->cred->euid, 2600 2600 binder_context_mgr_uid); 2601 2601 ret = -EPERM; 2602 2602 goto err; 2603 2603 } 2604 2604 } else 2605 - binder_context_mgr_uid = current->euid; 2605 + binder_context_mgr_uid = current->cred->euid; 2606 2606 binder_context_mgr_node = binder_new_node(proc, NULL, NULL); 2607 2607 if (binder_context_mgr_node == NULL) { 2608 2608 ret = -ENOMEM;