* [PATCH] staging: android: binder.c: Use more appropriate functions for euid retrieval
@ 2014-05-31 19:43 Tair Rzayev
2014-05-31 19:52 ` Greg KH
0 siblings, 1 reply; 5+ messages in thread
From: Tair Rzayev @ 2014-05-31 19:43 UTC (permalink / raw)
To: Greg KH; +Cc: swetland, linux-kernel
Instead of getting the reference to whole credential structure, use
task_euid() and current_euid() to get it.
Signed-off-by: Tair Rzayev <tair.rzayev@gmail.com>
---
drivers/staging/android/binder.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c
index e8dd7dd..989f809 100644
--- a/drivers/staging/android/binder.c
+++ b/drivers/staging/android/binder.c
@@ -1326,7 +1326,6 @@ static void binder_transaction(struct binder_proc *proc,
struct binder_transaction *in_reply_to = NULL;
struct binder_transaction_log_entry *e;
uint32_t return_error;
- const struct cred *cred = __task_cred(proc->tsk);
e = binder_transaction_log_add(&binder_transaction_log);
e->call_type = reply ? 2 : !!(tr->flags & TF_ONE_WAY);
@@ -1468,7 +1467,7 @@ static void binder_transaction(struct binder_proc *proc,
t->from = thread;
else
t->from = NULL;
- t->sender_euid = cred->euid;
+ t->sender_euid = task_euid(proc->tsk);
t->to_proc = target_proc;
t->to_thread = target_thread;
t->code = tr->code;
@@ -2602,7 +2601,7 @@ static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
struct binder_thread *thread;
unsigned int size = _IOC_SIZE(cmd);
void __user *ubuf = (void __user *)arg;
- const struct cred *cred = current_cred();
+ kuid_t curr_euid = current_euid();
/*pr_info("binder_ioctl: %d:%d %x %lx\n", proc->pid, current->pid, cmd, arg);*/
@@ -2688,15 +2687,16 @@ static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
goto err;
}
if (uid_valid(binder_context_mgr_uid)) {
- if (!uid_eq(binder_context_mgr_uid, cred->euid)) {
+ if (!uid_eq(binder_context_mgr_uid, curr_euid)) {
pr_err("BINDER_SET_CONTEXT_MGR bad uid %d != %d\n",
- from_kuid(&init_user_ns, cred->euid),
+ from_kuid(&init_user_ns, curr_euid),
from_kuid(&init_user_ns, binder_context_mgr_uid));
ret = -EPERM;
goto err;
}
- } else
- binder_context_mgr_uid = cred->euid;
+ } else {
+ binder_context_mgr_uid = curr_euid;
+ }
binder_context_mgr_node = binder_new_node(proc, 0, 0);
if (binder_context_mgr_node == NULL) {
ret = -ENOMEM;
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] staging: android: binder.c: Use more appropriate functions for euid retrieval
2014-05-31 19:43 [PATCH] staging: android: binder.c: Use more appropriate functions for euid retrieval Tair Rzayev
@ 2014-05-31 19:52 ` Greg KH
2014-05-31 20:03 ` Tair Rzayev
0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2014-05-31 19:52 UTC (permalink / raw)
To: Tair Rzayev; +Cc: swetland, linux-kernel
On Sat, May 31, 2014 at 10:43:34PM +0300, Tair Rzayev wrote:
> Instead of getting the reference to whole credential structure, use
> task_euid() and current_euid() to get it.
>
> Signed-off-by: Tair Rzayev <tair.rzayev@gmail.com>
> ---
> drivers/staging/android/binder.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
What kernel tree did you make this against? It doesn't seem to match up
with what is in my staging-next branch to merge with Linus for the next
release, so please work against that one.
Oh, and I think this is already been done, although in a bit different
way there, please check to make sure it is correct.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] staging: android: binder.c: Use more appropriate functions for euid retrieval
2014-05-31 19:52 ` Greg KH
@ 2014-05-31 20:03 ` Tair Rzayev
2014-05-31 20:18 ` Greg KH
0 siblings, 1 reply; 5+ messages in thread
From: Tair Rzayev @ 2014-05-31 20:03 UTC (permalink / raw)
To: Greg KH; +Cc: swetland, linux-kernel
On 2014.05.31. 22:52, Greg KH wrote:
> What kernel tree did you make this against? It doesn't seem to match up
> with what is in my staging-next branch to merge with Linus for the next
> release, so please work against that one.
Made against staging-next branch of your linux-next staging tree.
> Oh, and I think this is already been done, although in a bit different
> way there, please check to make sure it is correct.
Yes, I have noticed the changes after I have made the patch but I
thought mine are a bit cleaner so I have rebased the patch against the
changes that are already applied.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] staging: android: binder.c: Use more appropriate functions for euid retrieval
2014-05-31 20:03 ` Tair Rzayev
@ 2014-05-31 20:18 ` Greg KH
2014-05-31 20:19 ` Greg KH
0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2014-05-31 20:18 UTC (permalink / raw)
To: Tair Rzayev; +Cc: swetland, linux-kernel
On Sat, May 31, 2014 at 11:03:44PM +0300, Tair Rzayev wrote:
>
>
> On 2014.05.31. 22:52, Greg KH wrote:
> > What kernel tree did you make this against? It doesn't seem to match up
> > with what is in my staging-next branch to merge with Linus for the next
> > release, so please work against that one.
>
> Made against staging-next branch of your linux-next staging tree.
Hm, it doesn't apply there:
checking file drivers/staging/android/binder.c
Reversed (or previously applied) patch detected! Assume -R? [n]
Apply anyway? [n]
Skipping patch.
4 out of 4 hunks ignored
Are you sure you got the right branch?
> > Oh, and I think this is already been done, although in a bit different
> > way there, please check to make sure it is correct.
>
> Yes, I have noticed the changes after I have made the patch but I
> thought mine are a bit cleaner so I have rebased the patch against the
> changes that are already applied.
Something went wrong when you made this :(
Care to try again?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] staging: android: binder.c: Use more appropriate functions for euid retrieval
2014-05-31 20:18 ` Greg KH
@ 2014-05-31 20:19 ` Greg KH
0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2014-05-31 20:19 UTC (permalink / raw)
To: Tair Rzayev; +Cc: swetland, linux-kernel
On Sat, May 31, 2014 at 01:18:34PM -0700, Greg KH wrote:
> On Sat, May 31, 2014 at 11:03:44PM +0300, Tair Rzayev wrote:
> >
> >
> > On 2014.05.31. 22:52, Greg KH wrote:
> > > What kernel tree did you make this against? It doesn't seem to match up
> > > with what is in my staging-next branch to merge with Linus for the next
> > > release, so please work against that one.
> >
> > Made against staging-next branch of your linux-next staging tree.
>
> Hm, it doesn't apply there:
>
> checking file drivers/staging/android/binder.c
> Reversed (or previously applied) patch detected! Assume -R? [n]
> Apply anyway? [n]
> Skipping patch.
> 4 out of 4 hunks ignored
>
> Are you sure you got the right branch?
>
> > > Oh, and I think this is already been done, although in a bit different
> > > way there, please check to make sure it is correct.
> >
> > Yes, I have noticed the changes after I have made the patch but I
> > thought mine are a bit cleaner so I have rebased the patch against the
> > changes that are already applied.
>
> Something went wrong when you made this :(
Oh crap, _I_ was looking at the wrong branch here, nevermind, this
applies just fine.
Sorry for the noise...
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-05-31 20:19 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-31 19:43 [PATCH] staging: android: binder.c: Use more appropriate functions for euid retrieval Tair Rzayev
2014-05-31 19:52 ` Greg KH
2014-05-31 20:03 ` Tair Rzayev
2014-05-31 20:18 ` Greg KH
2014-05-31 20:19 ` Greg KH
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.