[CRIU] [PATCH 1/2] arch: Fix sys_clone() arguments order

Kirill Tkhai ktkhai at virtuozzo.com
Tue May 16 12:45:42 PDT 2017


The right order for all of our 4 archs is:

SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp,
                 int __user *, parent_tidptr,
                 unsigned long, tls,
                 int __user *, child_tidptr)

See Linux kernel for the details.

Note, this is just a fix, and it's not connected with the second patch.

Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 compel/arch/arm/plugins/std/syscalls/syscall.def   |    2 +-
 .../ppc64/plugins/std/syscalls/syscall-ppc64.tbl   |    2 +-
 .../arch/x86/plugins/std/syscalls/syscall_32.tbl   |    2 +-
 .../arch/x86/plugins/std/syscalls/syscall_64.tbl   |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/compel/arch/arm/plugins/std/syscalls/syscall.def b/compel/arch/arm/plugins/std/syscalls/syscall.def
index 3f48d88c7..b6aa59e42 100644
--- a/compel/arch/arm/plugins/std/syscalls/syscall.def
+++ b/compel/arch/arm/plugins/std/syscalls/syscall.def
@@ -42,7 +42,7 @@ shutdown			210	293	(int sockfd, int how)
 bind				235	282	(int sockfd, const struct sockaddr *addr, int addrlen)
 setsockopt			208	294	(int sockfd, int level, int optname, const void *optval, socklen_t optlen)
 getsockopt			209	295	(int sockfd, int level, int optname, const void *optval, socklen_t *optlen)
-clone				220	120	(unsigned long flags, void *child_stack, void *parent_tid, void *child_tid)
+clone				220	120	(unsigned long flags, void *child_stack, void *parent_tid, unsigned long newtls, void *child_tid)
 exit				93	1	(unsigned long error_code)
 wait4				260	114	(int pid, int *status, int options, struct rusage *ru)
 waitid				95	280	(int which, pid_t pid, struct siginfo *infop, int options, struct rusage *ru)
diff --git a/compel/arch/ppc64/plugins/std/syscalls/syscall-ppc64.tbl b/compel/arch/ppc64/plugins/std/syscalls/syscall-ppc64.tbl
index b4ac63eb1..c0fab4118 100644
--- a/compel/arch/ppc64/plugins/std/syscalls/syscall-ppc64.tbl
+++ b/compel/arch/ppc64/plugins/std/syscalls/syscall-ppc64.tbl
@@ -41,7 +41,7 @@ __NR_shutdown		338		sys_shutdown		(int sockfd, int how)
 __NR_bind		327		sys_bind		(int sockfd, const struct sockaddr *addr, int addrlen)
 __NR_setsockopt		339		sys_setsockopt		(int sockfd, int level, int optname, const void *optval, socklen_t optlen)
 __NR_getsockopt		340		sys_getsockopt		(int sockfd, int level, int optname, const void *optval, socklen_t *optlen)
-__NR_clone		120		sys_clone		(unsigned long flags, void *child_stack, void *parent_tid, void *child_tid)
+__NR_clone		120		sys_clone		(unsigned long flags, void *child_stack, void *parent_tid, unsigned long newtls, void *child_tid)
 __NR_exit		1		sys_exit		(unsigned long error_code)
 __NR_wait4		114		sys_wait4		(int pid, int *status, int options, struct rusage *ru)
 __NR_kill		37		sys_kill		(long pid, int sig)
diff --git a/compel/arch/x86/plugins/std/syscalls/syscall_32.tbl b/compel/arch/x86/plugins/std/syscalls/syscall_32.tbl
index 0eea9d061..c67fc4955 100644
--- a/compel/arch/x86/plugins/std/syscalls/syscall_32.tbl
+++ b/compel/arch/x86/plugins/std/syscalls/syscall_32.tbl
@@ -32,7 +32,7 @@ __NR_setitimer		104		sys_setitimer		(int which, struct itimerval *in, struct iti
 __NR_getitimer		105		sys_getitimer		(int which, struct itimerval *it)
 __NR_wait4		114		sys_wait4		(pid_t pid, int *stat_addr, int options, struct rusage *ru)
 __NR_ipc		117		sys_ipc			(unsigned int call, int first, unsigned long second, unsigned long third, void *ptr, long fifth)
-__NR_clone		120		sys_clone		(unsigned long flags, void *child_stack, void *parent_tid, void *child_tid)
+__NR_clone		120		sys_clone		(unsigned long flags, void *child_stack, void *parent_tid, unsigned long newtls, void *child_tid)
 __NR_mprotect		125		sys_mprotect		(const void *addr, unsigned long len, unsigned long prot)
 __NR_getpgid		132		sys_getpgid		(pid_t pid)
 __NR_personality	136		sys_personality		(unsigned int personality)
diff --git a/compel/arch/x86/plugins/std/syscalls/syscall_64.tbl b/compel/arch/x86/plugins/std/syscalls/syscall_64.tbl
index c291c9a42..e1c198929 100644
--- a/compel/arch/x86/plugins/std/syscalls/syscall_64.tbl
+++ b/compel/arch/x86/plugins/std/syscalls/syscall_64.tbl
@@ -37,7 +37,7 @@ __NR_shutdown			48		sys_shutdown		(int sockfd, int how)
 __NR_bind			49		sys_bind		(int sockfd, const struct sockaddr *addr, int addrlen)
 __NR_setsockopt			54		sys_setsockopt		(int sockfd, int level, int optname, const void *optval, socklen_t optlen)
 __NR_getsockopt			55		sys_getsockopt		(int sockfd, int level, int optname, const void *optval, socklen_t *optlen)
-__NR_clone			56		sys_clone		(unsigned long flags, void *child_stack, void *parent_tid, void *child_tid)
+__NR_clone			56		sys_clone		(unsigned long flags, void *child_stack, void *parent_tid, unsigned long newtls, void *child_tid)
 __NR_exit			60		sys_exit		(unsigned long error_code)
 __NR_wait4			61		sys_wait4		(int pid, int *status, int options, struct rusage *ru)
 __NR_kill			62		sys_kill		(long pid, int sig)



More information about the CRIU mailing list