Skip to content

Commit

Permalink
将发送Binder信息的时机往后调到trace_binder_transaction前面
Browse files Browse the repository at this point in the history
  • Loading branch information
CCCC-L committed Jul 20, 2024
1 parent f6c875e commit bb477f9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@v4

- name: install gcc、clang
run: |
git clone https://github.com/LineageOS/android_prebuilts_gcc_linux-x86_aarch64_aarch64-linux-android-4.9 toolchain/gcc/linux-x86/aarch64/aarch64-linux-android-4.9
Expand Down
24 changes: 9 additions & 15 deletions drivers/android/binder.c
Original file line number Diff line number Diff line change
Expand Up @@ -3360,13 +3360,6 @@ static void binder_transaction(struct binder_proc *proc,
target_proc = target_thread->proc;
target_proc->tmp_ref++;
binder_inner_proc_unlock(target_thread->proc);
#ifdef CONFIG_RE_KERNEL
if (target_proc
&& target_proc->tsk
&& task_uid(target_proc->tsk).val <= MAX_SYSTEM_UID
&& proc->pid != target_proc->pid)
rekernel_report(BINDER, REPLY, proc->pid, proc->tsk, target_proc->pid, target_proc->tsk, false);
#endif /* CONFIG_RE_KERNEL */
} else {
if (tr->target.handle) {
struct binder_ref *ref;
Expand Down Expand Up @@ -3420,14 +3413,6 @@ static void binder_transaction(struct binder_proc *proc,
}
e->to_node = target_node->debug_id;

#ifdef CONFIG_RE_KERNEL
if (target_proc
&& target_proc->tsk
&& task_uid(target_proc->tsk).val > MIN_USERAPP_UID
&& proc->pid != target_proc->pid)
rekernel_report(BINDER, TRANSACTION, proc->pid, proc->tsk, target_proc->pid, target_proc->tsk, !!(tr->flags & TF_ONE_WAY));
#endif

#ifdef CONFIG_SAMSUNG_FREECESS
freecess_sync_binder_report(proc, target_proc, tr);
#endif
Expand Down Expand Up @@ -3641,6 +3626,15 @@ static void binder_transaction(struct binder_proc *proc,
t->buffer->debug_id = t->debug_id;
t->buffer->transaction = t;
t->buffer->target_node = target_node;
#ifdef CONFIG_RE_KERNEL
if (!reply) {
if (target_proc
&& target_proc->tsk
&& task_uid(target_proc->tsk).val > MIN_USERAPP_UID
&& proc->pid != target_proc->pid)
rekernel_report(BINDER, TRANSACTION, proc->pid, proc->tsk, target_proc->pid, target_proc->tsk, !!(tr->flags & TF_ONE_WAY));
}
#endif
trace_binder_transaction_alloc_buf(t->buffer);

if (binder_alloc_copy_user_to_buffer(
Expand Down

0 comments on commit bb477f9

Please sign in to comment.