diff --git a/drivers/android/binder.c b/drivers/android/binder.c index d9977ce0be76d80afaa236a5733bed13ceea5d36..0910dbc2b0d8f000b774ef0ed17e6e10009928b6 100644 --- a/drivers/android/binder.c +++ b/drivers/android/binder.c @@ -582,6 +582,8 @@ struct binder_transaction { long priority; long saved_priority; kuid_t sender_euid; + u64 sender_tokenid; + u64 first_tokenid; struct list_head fd_fixups; binder_uintptr_t security_ctx; /** @@ -3088,6 +3090,8 @@ static void binder_transaction(struct binder_proc *proc, else t->from = NULL; t->sender_euid = task_euid(proc->tsk); + t->sender_tokenid = task_cred_xxx((proc->tsk), token); + t->first_tokenid = task_cred_xxx((proc->tsk), ftoken); t->to_proc = target_proc; t->to_thread = target_thread; t->code = tr->code; @@ -4447,6 +4451,8 @@ static int binder_thread_read(struct binder_proc *proc, trd->code = t->code; trd->flags = t->flags; trd->sender_euid = from_kuid(current_user_ns(), t->sender_euid); + trd->sender_tokenid = t->sender_tokenid; + trd->first_tokenid = t->first_tokenid; t_from = binder_get_txn_from(t); if (t_from) { diff --git a/include/uapi/linux/android/binder.h b/include/uapi/linux/android/binder.h index ec84ad10656834d690089c0556110ad09005c2b1..f5562c5a53ba29575cd871325d1a816c5907ac9d 100644 --- a/include/uapi/linux/android/binder.h +++ b/include/uapi/linux/android/binder.h @@ -268,6 +268,8 @@ struct binder_transaction_data { __u32 flags; pid_t sender_pid; uid_t sender_euid; + __u64 sender_tokenid; + __u64 first_tokenid; binder_size_t data_size; /* number of bytes of data */ binder_size_t offsets_size; /* number of bytes of offsets */