diff --git a/drivers/android/binder.c b/drivers/android/binder.c index cd73ee33c8f5..361296975923 100644 --- a/drivers/android/binder.c +++ b/drivers/android/binder.c @@ -160,6 +160,9 @@ static int binder_set_stop_on_user_error(const char *val, module_param_call(stop_on_user_error, binder_set_stop_on_user_error, param_get_int, &binder_stop_on_user_error, 0644); +static bool binder_global_pid_lookups = true; +module_param_named(global_pid_lookups, binder_global_pid_lookups, bool, S_IRUGO); + #define binder_debug(mask, x...) \ do { \ if (binder_debug_mask & mask) \ @@ -4285,6 +4288,9 @@ retry: tr.sender_pid = task_tgid_nr_ns(sender, task_active_pid_ns(current)); + + if (binder_global_pid_lookups && tr.sender_pid == 0) + tr.sender_pid = task_tgid_nr(sender); } else { tr.sender_pid = 0; }