diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2012-05-25 20:34:53 -0400 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2012-09-21 06:13:26 -0400 |
commit | 4a2ebb93bf0ae67b4b49f1974a525523eb923da0 (patch) | |
tree | b3d55229f4e5fed0927ebcc5b7499b4fbb238155 /drivers/staging | |
parent | d2b31ca644fdc8704de3367a6a56a5c958c77f53 (diff) |
userns: Convert binder ipc to use kuids
Cc: Arve Hjønnevåg <arve@android.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/android/binder.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c index 574e99210c3..8e35d4b2524 100644 --- a/drivers/staging/android/binder.c +++ b/drivers/staging/android/binder.c | |||
@@ -47,7 +47,7 @@ static HLIST_HEAD(binder_dead_nodes); | |||
47 | static struct dentry *binder_debugfs_dir_entry_root; | 47 | static struct dentry *binder_debugfs_dir_entry_root; |
48 | static struct dentry *binder_debugfs_dir_entry_proc; | 48 | static struct dentry *binder_debugfs_dir_entry_proc; |
49 | static struct binder_node *binder_context_mgr_node; | 49 | static struct binder_node *binder_context_mgr_node; |
50 | static uid_t binder_context_mgr_uid = -1; | 50 | static kuid_t binder_context_mgr_uid = INVALID_UID; |
51 | static int binder_last_id; | 51 | static int binder_last_id; |
52 | static struct workqueue_struct *binder_deferred_workqueue; | 52 | static struct workqueue_struct *binder_deferred_workqueue; |
53 | 53 | ||
@@ -356,7 +356,7 @@ struct binder_transaction { | |||
356 | unsigned int flags; | 356 | unsigned int flags; |
357 | long priority; | 357 | long priority; |
358 | long saved_priority; | 358 | long saved_priority; |
359 | uid_t sender_euid; | 359 | kuid_t sender_euid; |
360 | }; | 360 | }; |
361 | 361 | ||
362 | static void | 362 | static void |
@@ -2427,7 +2427,7 @@ retry: | |||
2427 | } | 2427 | } |
2428 | tr.code = t->code; | 2428 | tr.code = t->code; |
2429 | tr.flags = t->flags; | 2429 | tr.flags = t->flags; |
2430 | tr.sender_euid = t->sender_euid; | 2430 | tr.sender_euid = from_kuid(current_user_ns(), t->sender_euid); |
2431 | 2431 | ||
2432 | if (t->from) { | 2432 | if (t->from) { |
2433 | struct task_struct *sender = t->from->proc->tsk; | 2433 | struct task_struct *sender = t->from->proc->tsk; |
@@ -2705,12 +2705,12 @@ static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | |||
2705 | ret = -EBUSY; | 2705 | ret = -EBUSY; |
2706 | goto err; | 2706 | goto err; |
2707 | } | 2707 | } |
2708 | if (binder_context_mgr_uid != -1) { | 2708 | if (uid_valid(binder_context_mgr_uid)) { |
2709 | if (binder_context_mgr_uid != current->cred->euid) { | 2709 | if (!uid_eq(binder_context_mgr_uid, current->cred->euid)) { |
2710 | pr_err("binder: BINDER_SET_" | 2710 | pr_err("binder: BINDER_SET_" |
2711 | "CONTEXT_MGR bad uid %d != %d\n", | 2711 | "CONTEXT_MGR bad uid %d != %d\n", |
2712 | current->cred->euid, | 2712 | from_kuid(&init_user_ns, current->cred->euid), |
2713 | binder_context_mgr_uid); | 2713 | from_kuid(&init_user_ns, binder_context_mgr_uid)); |
2714 | ret = -EPERM; | 2714 | ret = -EPERM; |
2715 | goto err; | 2715 | goto err; |
2716 | } | 2716 | } |