linprocfs: add TracerPid to /proc/pid/status.

Also fix the value of parent pid if the process is traced.

Submitted by:	Yanko Yankulov <yanko.yankulov@gmail.com>
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2018-06-15 13:56:58 +00:00
parent 6a1d1e0ca3
commit 1f3bc15763

View File

@ -829,8 +829,8 @@ linprocfs_doprocstatus(PFS_FILL_ARGS)
* Credentials
*/
sbuf_printf(sb, "Pid:\t%d\n", p->p_pid);
sbuf_printf(sb, "PPid:\t%d\n", p->p_pptr ?
p->p_pptr->p_pid : 0);
sbuf_printf(sb, "PPid:\t%d\n", kp.ki_ppid );
sbuf_printf(sb, "TracerPid:\t%d\n", kp.ki_tracer );
sbuf_printf(sb, "Uid:\t%d %d %d %d\n", p->p_ucred->cr_ruid,
p->p_ucred->cr_uid,
p->p_ucred->cr_svuid,