linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Brauner <christian@brauner.io>
To: linux-kernel@vger.kernel.org
Cc: arnd@arndb.de, Christian Brauner <christian@brauner.io>
Subject: [PATCH 2/2] unistd: protect clone3 via __ARCH_WANT_SYS_CLONE3
Date: Sun, 14 Jul 2019 21:22:05 +0200	[thread overview]
Message-ID: <20190714192205.27190-3-christian@brauner.io> (raw)
In-Reply-To: <20190714192205.27190-1-christian@brauner.io>

This lets us catch new architectures that implicitly make use of clone3
without setting __ARCH_WANT_SYS_CLONE3.
Failing on missing __ARCH_WANT_SYS_CLONE3 is a good indicator that they
either did not really want this syscall or haven't really thought about
whether it needs special treatment and just accidently included it in
their entrypoints by e.g. generating their syscall table automatically
via asm-generic/unistd.h

This patch has been compile-tested for the h8300 architecture which is
one of the architectures that does not yet implement clone3 and
generates its syscall table via asm-generic/unistd.h.

Signed-off-by: Christian Brauner <christian@brauner.io>
Suggested-by: Arnd Bergmann <arnd@arndb.de>
---
 include/uapi/asm-generic/unistd.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h
index 9acfff0cd153..1be0e798e362 100644
--- a/include/uapi/asm-generic/unistd.h
+++ b/include/uapi/asm-generic/unistd.h
@@ -846,8 +846,10 @@ __SYSCALL(__NR_fsmount, sys_fsmount)
 __SYSCALL(__NR_fspick, sys_fspick)
 #define __NR_pidfd_open 434
 __SYSCALL(__NR_pidfd_open, sys_pidfd_open)
+#ifdef __ARCH_WANT_SYS_CLONE3
 #define __NR_clone3 435
 __SYSCALL(__NR_clone3, sys_clone3)
+#endif
 
 #undef __NR_syscalls
 #define __NR_syscalls 436
-- 
2.22.0


  parent reply	other threads:[~2019-07-14 19:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-14 19:22 [PATCH 0/2] clone3 fixes Christian Brauner
2019-07-14 19:22 ` [PATCH 1/2] arch: mark syscall number 435 reserved for clone3 Christian Brauner
2019-07-15 13:56   ` Christian Borntraeger
2019-07-15 14:29     ` Christian Brauner
2019-07-16 13:06     ` Christian Brauner
2019-07-16 18:53       ` Sven Schnelle
2019-07-16 18:55         ` Christian Brauner
2019-07-16 20:13           ` Helge Deller
2019-07-19 10:18       ` Michael Ellerman
2019-07-19 10:25         ` Christian Brauner
2019-07-19 11:13           ` Michael Ellerman
2019-07-19 12:20             ` Christian Brauner
2019-07-14 19:22 ` Christian Brauner [this message]
2019-07-14 20:07 ` [PATCH 0/2] clone3 fixes Arnd Bergmann
2019-07-14 22:30   ` Christian Brauner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190714192205.27190-3-christian@brauner.io \
    --to=christian@brauner.io \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).