[CRIU] [PATCH] ptrace: check that process is stopped by SIGTRAP

Andrey Vagin avagin at openvz.org
Wed Jun 19 13:42:21 EDT 2013


All other states are unexpected.

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 parasite-syscall.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/parasite-syscall.c b/parasite-syscall.c
index 4853cf6..8aed5ee 100644
--- a/parasite-syscall.c
+++ b/parasite-syscall.c
@@ -814,6 +814,11 @@ static int parasite_fini_seized(struct parasite_ctl *ctl)
 			return -1;
 		}
 
+		if (!WIFSTOPPED(status) || WSTOPSIG(status) != SIGTRAP) {
+			pr_err("Task is in unexpected state: %x\n", status);
+			return -1;
+		}
+
 		pr_debug("%d was trapped\n", pid);
 		if (!WIFSTOPPED(status)) {
 			pr_err("%d\n", status);
-- 
1.8.2.1



More information about the CRIU mailing list