pie: fix clobber registers for int 0x80

Submitted by Dmitry Safonov on Dec. 14, 2016, 3:40 p.m.

Details

Message ID 20161214154049.26874-1-dsafonov@virtuozzo.com
State Superseded
Series "pie: fix clobber registers for int 0x80"
Headers show

Commit Message

Dmitry Safonov Dec. 14, 2016, 3:40 p.m.
I managed to forgot that kernel erases R8...R11 regitster
prior returning to userspace from `int 0x80`:
https://lkml.org/lkml/2009/10/1/164

That was the reason for hang on gcc v6.1 on Jenkins/elsewhere:
https://ci.openvz.org/job/CRIU/job/CRIU-x86_64/branch/criu-dev/

I'll check the other places with `int 0x80` for missed clobbers.

Tested on gcc v6.1 locally, on Travis-CI:
https://travis-ci.org/0x7f454c46/criu/builds/183958805

Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
---
 criu/arch/x86/include/asm/parasite.h | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/arch/x86/include/asm/parasite.h b/criu/arch/x86/include/asm/parasite.h
index 2385ec16d061..7b259d7a2c8d 100644
--- a/criu/arch/x86/include/asm/parasite.h
+++ b/criu/arch/x86/include/asm/parasite.h
@@ -38,12 +38,8 @@  static int arch_get_user_desc(user_desc_t *desc)
 	"	mov %%eax,%0			\n"
 	: "+m"(ret)
 	: "m"(desc)
-	: "eax", "rbx", "memory");
+	: "rax", "rbx", "r8", "r9", "r10", "r11", "memory");
 
-	/*
-	 * Fixup for Travis: on missing GDT entry get_thread_area()
-	 * retruns -EINTR then descriptor with seg_not_preset = 1
-	 */
 	if (ret)
 		pr_err("Failed to dump TLS descriptor #%d: %d\n",
 				desc->entry_number, ret);