From 5db72ef2e42f53ea494c6a7ade67469ef70ff4a6 Mon Sep 17 00:00:00 2001 From: Edward Tomasz Napierala Date: Tue, 31 Jan 2017 15:22:51 +0000 Subject: [PATCH] Fix linux_getppid() to debug the actual parent, even it was reparented by debugger. Reviewed by: dchagin@ MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D9361 --- sys/compat/linux/linux_misc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index e61d3630a728..1e6822fa4f02 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -1733,9 +1733,7 @@ linux_getppid(struct thread *td, struct linux_getppid_args *args) printf(ARGS(getppid, "")); #endif - PROC_LOCK(td->td_proc); - td->td_retval[0] = td->td_proc->p_pptr->p_pid; - PROC_UNLOCK(td->td_proc); + td->td_retval[0] = kern_getppid(td); return (0); }