[CRIU] [PATCH 4/5] x86/compel/infect: Be verbose on remote mmap failure

Dmitry Safonov dima at arista.com
Thu May 2 04:34:44 MSK 2019


Error-case print missing.

Signed-off-by: Dmitry Safonov <dima at arista.com>
---
 compel/arch/x86/src/lib/infect.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/compel/arch/x86/src/lib/infect.c b/compel/arch/x86/src/lib/infect.c
index 0737e07a3d27..11e7f4c91f4a 100644
--- a/compel/arch/x86/src/lib/infect.c
+++ b/compel/arch/x86/src/lib/infect.c
@@ -375,10 +375,13 @@ void *remote_mmap(struct parasite_ctl *ctl,
 	if (err < 0)
 		return NULL;
 
+	if (map == -EACCES && (prot & PROT_WRITE) && (prot & PROT_EXEC)) {
+		pr_warn("mmap(PROT_WRITE | PROT_EXEC) failed for %d, "
+			"check selinux execmem policy\n", ctl->rpid);
+		return NULL;
+	}
 	if (IS_ERR_VALUE(map)) {
-		if (map == -EACCES && (prot & PROT_WRITE) && (prot & PROT_EXEC))
-			pr_warn("mmap(PROT_WRITE | PROT_EXEC) failed for %d, "
-				"check selinux execmem policy\n", ctl->rpid);
+		pr_err("remote mmap() failed: %s\n", strerror(-map));
 		return NULL;
 	}
 
-- 
2.21.0



More information about the CRIU mailing list