Skip to content

Commit ac89276

Browse files
fredldotmeNotKit
authored andcommitted
binder: Configurable global PID lookups
This reshakes commit d2587ce3968c6fdde3cf09d785bb957c4b75572f and implements a kernel parameter to explicitly allow disabling the behavior change to look up caller PIDs in the global namespace.
1 parent 4b5e3db commit ac89276

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/android/binder.c

+5
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,9 @@ static int binder_set_stop_on_user_error(const char *val,
148148
module_param_call(stop_on_user_error, binder_set_stop_on_user_error,
149149
param_get_int, &binder_stop_on_user_error, 0644);
150150

151+
static bool binder_global_pid_lookups = true;
152+
module_param_named(global_pid_lookups, binder_global_pid_lookups, bool, S_IRUGO);
153+
151154
#define binder_debug(mask, x...) \
152155
do { \
153156
if (binder_debug_mask & mask) \
@@ -4450,6 +4453,8 @@ static int binder_thread_read(struct binder_proc *proc,
44504453
trd->sender_pid =
44514454
task_tgid_nr_ns(sender,
44524455
task_active_pid_ns(current));
4456+
if (binder_global_pid_lookups && trd->sender_pid == 0)
4457+
trd->sender_pid = task_tgid_nr(sender);
44534458
} else {
44544459
trd->sender_pid = 0;
44554460
}

0 commit comments

Comments
 (0)