Re: #warning "Consider adding the right clone() syscall definitions here!"

James Cowgill <[email protected]>
Newsgroups gmane.linux.debian.ports.mips
Message-ID <[email protected]>
Hi,

On 25/04/17 11:21, Mathieu Malaterre wrote:
> Hi there,
> 
> Did anyone review the warning(s) generated during systemd building on mipsel* ?
> 
> I am starring at the clone warning (mmap seems to trigger something
> equivalent apparently):
> 
> https://buildd.debian.org/status/fetch.php?pkg=systemd&arch=mips64el&ver=232-22&stamp=1490743348&raw=0
> 
> See:
> http://sources.debian.net/src/systemd/232-22/src/shared/seccomp-util.c/#L726
> 
> 
> $ man 2 clone
> [...]
>        On x86-32, and several other common architectures (including
> score, ARM, ARM 64, PA-RISC, arc, Power PC, xtensa, and MIPS), the
> order of the last two arguments is reversed:
> 
>            long clone(unsigned long flags, void *child_stack,
>                      int *ptid, unsigned long newtls,
>                      int *ctid);
> [...]
> 
> Is this worth reporting a bug for this ?

Yes I think so.

Looking at the kernel, all current arches use the "normal" ordering of
the first 2 args except for cris and s390 (only CLONE_BACKWARDS2 is
relevant here).

$ grep CLONE_BACKWARDS arch/*/Kconfig
arch/arc/Kconfig:       select CLONE_BACKWARDS
arch/arm/Kconfig:       select CLONE_BACKWARDS
arch/arm64/Kconfig:     select CLONE_BACKWARDS
arch/cris/Kconfig:      select CLONE_BACKWARDS2
arch/microblaze/Kconfig:        select CLONE_BACKWARDS3
arch/mips/Kconfig:      select CLONE_BACKWARDS
arch/parisc/Kconfig:    select CLONE_BACKWARDS
arch/powerpc/Kconfig:   select CLONE_BACKWARDS
arch/s390/Kconfig:      select CLONE_BACKWARDS2
arch/score/Kconfig:     select CLONE_BACKWARDS
arch/x86/Kconfig:       select CLONE_BACKWARDS
arch/xtensa/Kconfig:    select CLONE_BACKWARDS

=== From kernel/fork.c ===
#ifdef CONFIG_CLONE_BACKWARDS
SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp,
                 int __user *, parent_tidptr,
                 unsigned long, tls,
                 int __user *, child_tidptr)
#elif defined(CONFIG_CLONE_BACKWARDS2)
SYSCALL_DEFINE5(clone, unsigned long, newsp, unsigned long, clone_flags,
                 int __user *, parent_tidptr,
                 int __user *, child_tidptr,
                 unsigned long, tls)
#elif defined(CONFIG_CLONE_BACKWARDS3)
SYSCALL_DEFINE6(clone, unsigned long, clone_flags, unsigned long, newsp,
                int, stack_size,
                int __user *, parent_tidptr,
                int __user *, child_tidptr,
                unsigned long, tls)
#else
SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp,
                 int __user *, parent_tidptr,
                 int __user *, child_tidptr,
                 unsigned long, tls)
#endif

Thanks,
James
signature.asc (application/pgp-signature, 819 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCgAGBQJY/yhPAAoJEMfxZ23qLQHvpYYP/37cvUmkFPfSg+xnv1XlsVUV
5gD0za9UyoxctOM7LEwkarkgXt9tI2b88bUQvGKURUrYZYKqCmF1rOwVCpgEw4uI
8MitzERNoMAodyIeoi8hZrzW8XV0TypHPEV8Uj0Oxz+mP8eaqj7m6sWEKUavX9HI
/iR2AbxnISwXTRw1i5WeLVRsmFBPgKvb6/wLkD1EbRf/fFzcLm25uknBGD5/bjYT
k+SCvciI6HFbmQuy1YYPrqY1ab+d2A8ep5capNHUMJ2haur/Xoq57s486PJC6OHf
5egYL95CiVcihivgREQBHtXw2u5nQXPS4MLX1+MMIQ8zMfr/aZGfTszzxUE87dF4
ZNHviHKnGJptIIwgS6eUhCWxDgOio5GmtafB6VuqFmCYo4GNfaGRGmPu733Oxh1P
M7pY0+OcxEkzPQ0ek+oOGeNVm8d+8zWT3NsfETz/dXOM/txeHhdaotWlSQtHzSht
yZ9SN+Vew2tHbaUiiPwiqFjwouO+xKdEspDHYWit76QCEXTZu1x5S7OoKIt6zZ2F
PrrrThQ6uvzLUoAWQUZrDFgbb1mQ+/ILtI0CLxwnZCLzmtBtGjj7nUClwjjnXhz/
vRiHUR3LTjTTZMP/a42uCjdRBuiY8Ytus+Cf/fW+GpqzntqCIGMIDB2UnPpQcIjB
0ZoZ79D3YFzw+EhxB2WJ
=swA7
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.