[CRIU] [PATCH 8/8] restore: print a error if ptrace() failed

Andrei Vagin avagin at openvz.org
Fri Feb 16 10:21:20 MSK 2018


[This sender failed our fraud detection checks and may not be who they appear to be. Learn about spoofing at http://aka.ms/LearnAboutSpoofing]

From: Andrei Vagin <avagin at virtuozzo.com>

CID 85039 (#1 of 1): Unchecked return value (CHECKED_RETURN)
6. check_return: Calling ptrace without checking return value (as is done elsewhere 44 out of 49 times).

Signed-off-by: Andrei Vagin <avagin at virtuozzo.com>
---
 criu/cr-restore.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/criu/cr-restore.c b/criu/cr-restore.c
index 7188d1a9d..a7316f79c 100644
--- a/criu/cr-restore.c
+++ b/criu/cr-restore.c
@@ -1564,7 +1564,8 @@ static void sigchld_handler(int signal, siginfo_t *siginfo, void *data)
                if (!current && WIFSTOPPED(status) &&
                                        WSTOPSIG(status) == SIGCHLD) {
                        /* The root task is ptraced. Allow it to handle SIGCHLD */
-                       ptrace(PTRACE_CONT, siginfo->si_pid, 0, SIGCHLD);
+                       if (ptrace(PTRACE_CONT, pid, 0, SIGCHLD))
+                               pr_perror("Unable to resume %d", pid);
                        return;
                }

--
2.13.6




More information about the CRIU mailing list