Skip to content

Commit 49ed969

Browse files
Hridya Valsarajugregkh
authored andcommitted
binder: prevent transactions to context manager from its own process.
Currently, a transaction to context manager from its own process is prevented by checking if its binder_proc struct is the same as that of the sender. However, this would not catch cases where the process opens the binder device again and uses the new fd to send a transaction to the context manager. Reported-by: [email protected] Signed-off-by: Hridya Valsaraju <[email protected]> Acked-by: Todd Kjos <[email protected]> Cc: stable <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent a565870 commit 49ed969

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/android/binder.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2988,7 +2988,7 @@ static void binder_transaction(struct binder_proc *proc,
29882988
else
29892989
return_error = BR_DEAD_REPLY;
29902990
mutex_unlock(&context->context_mgr_node_lock);
2991-
if (target_node && target_proc == proc) {
2991+
if (target_node && target_proc->pid == proc->pid) {
29922992
binder_user_error("%d:%d got transaction to context manager from process owning it\n",
29932993
proc->pid, thread->pid);
29942994
return_error = BR_FAILED_REPLY;

0 commit comments

Comments
 (0)