Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save makslevental/2b3471318e6c25f24597cb24ed4b3570 to your computer and use it in GitHub Desktop.
Save makslevental/2b3471318e6c25f24597cb24ed4b3570 to your computer and use it in GitHub Desktop.
Linux kernel 4.14 patch to disguise TracerPid in /proc/*/status
commit acc0182c3d3869802bc20c8bf4e04c3464936bcc
Author: Douglas Hellinger <[email protected]>
Date: Sun Nov 19 22:48:46 2017 +0800
Fix tracerPid=0 in /proc
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 6f6fc16..bcf470d 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -171,7 +171,8 @@ static inline void task_state(struct seq_file *m, struct pid_namespace *ns,
tracer = ptrace_parent(p);
if (tracer)
- tpid = task_pid_nr_ns(tracer, ns);
+ // hide TracerPid
+ tpid = 0;
tgid = task_tgid_nr_ns(p, ns);
ngid = task_numa_group_id(p);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment