Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5611891ybi; Tue, 4 Jun 2019 09:12:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqygiSpfRXNpXAJiNzsDVWDX42vEg0IfOwZmN76SY1/zUQxhTIMtVLzettpjp5jHOqF0qR4n X-Received: by 2002:a62:750c:: with SMTP id q12mr18412131pfc.59.1559664748432; Tue, 04 Jun 2019 09:12:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559664748; cv=none; d=google.com; s=arc-20160816; b=A+epGqAmUymx1dpQi94JQfWXfK3o+OwQMiU2gxu7zIj+oh+8PKeIM3UU+mHPbLv+gs ZR9c6h8klgGFqiGgbG5Lqj4MxEeLn99sCr/fTjvq2qoTy1FdyT9hwY2zMhRQ78tAuS68 1DfYj61D9voWsfKChAzGTRwXnprLPb2xTu3l+zYcV8JPr/w4yN5BTxdQ3DWhNN2k4dP8 EKsr7tPNFVa46dt2mOuHPzTBfrGraUDapJxuHNjSjaw426dK0/JVyAj/XnsoNTWsp1nT Znr/Jw7mCRLECXgOwrgWFMaeKBU5OfMc6eI/j7Uwv2yIUz1a+LTrqutP4R7H0H5UTkXS faSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ygMGl15yL8Dl/CKxDv58CFgXErk1JZawsiPT7PZu59c=; b=qi2r1oda2bEt9NIHs0hBm7PL821q4j36/0wm/atAZjcdxUqmeeaIstrpcu8KOdvQv2 Ms81fE9H/2dTM7EkBPv9hE6oAX7lttSLbBtYNusyffyBRYxJ9siNrSFaGM38mepVUeEz RIH3FwO9vzFCkScUneSIPqc9JrSP7XYjBrLVNioaGm2Ny+MoYU6Yx7MaaJh/UujYs26D JAearhleIp6JjNvyjqWcpZoSoeAVB6bz4ALh79j2eQ7mzVzfAQi8DXkwpck+o4Ghgl9n mEI2yy/21VZtPGckQGoUuGRqd9KzY6mwfnCkHwgjTCXdvNvxU7uD6T1Gj18uB/ZsDYzE atCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brauner.io header.s=google header.b=Ugq8j9ea; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i123si28144317pfc.60.2019.06.04.09.12.10; Tue, 04 Jun 2019 09:12:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@brauner.io header.s=google header.b=Ugq8j9ea; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728338AbfFDQKB (ORCPT + 99 others); Tue, 4 Jun 2019 12:10:01 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:34798 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728330AbfFDQKA (ORCPT ); Tue, 4 Jun 2019 12:10:00 -0400 Received: by mail-wr1-f67.google.com with SMTP id e16so8199538wrn.1 for ; Tue, 04 Jun 2019 09:09:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brauner.io; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ygMGl15yL8Dl/CKxDv58CFgXErk1JZawsiPT7PZu59c=; b=Ugq8j9ea6T6m2QJYNrHxhrwF0Gfbdtq8EVLSsuEpeXNBxuPCF1eyBO0rdgcAhxHjlU a4SO8JY6dra7YmOYqhoAsKfOR7vbCsFCacO5FpAsmS0jFl4+Zhvlb4Dh4S0hdP7ZRL6S Pp5sDM0b/05jQIonO7S6jG2u200oGGYlwVHW5JFYRj9S4y/UhHJBfoynyuzBCeKzEAqo 5MtXRUUfco1DLg/7OIsMowDvKTd8Xt548bUkDZthXP38d/cbyEKRls+Nx6TpBtsYjyPa v+Z41qiuP582owphpatCNRAmB7NK7TzOht+2VeefvCYV9aX54HC/QTdjVr6DTTDHWkhZ dHYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ygMGl15yL8Dl/CKxDv58CFgXErk1JZawsiPT7PZu59c=; b=XmX55KimTe8QBLMxTfbs+gGKC/x8ByWDKQ/koa+0CJJah4eT8JzUhSBsa6yA+UQ9jN agBc6JgqHiNVeQTsdWVAlECNdEVnQxjEzwcM+NBgoc4X1SPrVd14eR/B5q18g9rN1SFW hs8yqaujE22JkoPfCPRcv4f6NEjnin9/6mUeXyUY482zcCtRpygs2E6w/E2IlWt5Czvs l+a24fU/TVuy1CIsg9YczPXKBNnyoJqNdjtPW1mxj6l0TgA41KsHhICTDaHLaEFgxwxZ 4MegiiAziSo39Ks/N8TzxKuAouyWuOV9RHwO07CsEE9dzAdl0+TAdZmAoqWM9yZGHpiS 2Mdw== X-Gm-Message-State: APjAAAV8oEElR/+NcYjgKywIKW8mlnoGgROPcikQKi2ZKly0K3wLM/JT PixsK1TcZXf9TJB23IsI2hffKg== X-Received: by 2002:a5d:4b49:: with SMTP id w9mr7207099wrs.113.1559664598427; Tue, 04 Jun 2019 09:09:58 -0700 (PDT) Received: from localhost.localdomain (p548C9938.dip0.t-ipconnect.de. [84.140.153.56]) by smtp.gmail.com with ESMTPSA id e6sm10578055wrw.83.2019.06.04.09.09.57 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 04 Jun 2019 09:09:57 -0700 (PDT) From: Christian Brauner To: viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, jannh@google.com Cc: keescook@chromium.org, fweimer@redhat.com, oleg@redhat.com, arnd@arndb.de, dhowells@redhat.com, Christian Brauner , Andrew Morton , Adrian Reber , linux-api@vger.kernel.org, linux-arch@vger.kernel.org, x86@kernel.org Subject: [PATCH v3 2/2] arch: wire-up clone3() syscall Date: Tue, 4 Jun 2019 18:09:44 +0200 Message-Id: <20190604160944.4058-2-christian@brauner.io> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190604160944.4058-1-christian@brauner.io> References: <20190604160944.4058-1-christian@brauner.io> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Wire up the clone3() call on all arches that don't require hand-rolled assembly. Some of the arches look like they need special assembly massaging and it is probably smarter if the appropriate arch maintainers would do the actual wiring. Arches that are wired-up are: - x86{_32,64} - arm{64} - xtensa Signed-off-by: Christian Brauner Cc: Arnd Bergmann Cc: Kees Cook Cc: David Howells Cc: Andrew Morton Cc: Oleg Nesterov Cc: Adrian Reber Cc: Linus Torvalds Cc: Al Viro Cc: Florian Weimer Cc: linux-api@vger.kernel.org Cc: linux-arch@vger.kernel.org Cc: x86@kernel.org --- v1: unchanged v2: unchanged v3: - Christian Brauner : - wire up clone3 on all arches that don't have hand-rolled entry points for clone --- arch/arm/tools/syscall.tbl | 1 + arch/arm64/include/asm/unistd.h | 2 +- arch/arm64/include/asm/unistd32.h | 2 ++ arch/microblaze/kernel/syscalls/syscall.tbl | 1 + arch/x86/entry/syscalls/syscall_32.tbl | 1 + arch/x86/entry/syscalls/syscall_64.tbl | 1 + arch/xtensa/kernel/syscalls/syscall.tbl | 1 + include/uapi/asm-generic/unistd.h | 4 +++- 8 files changed, 11 insertions(+), 2 deletions(-) diff --git a/arch/arm/tools/syscall.tbl b/arch/arm/tools/syscall.tbl index aaf479a9e92d..e99a82bdb93a 100644 --- a/arch/arm/tools/syscall.tbl +++ b/arch/arm/tools/syscall.tbl @@ -447,3 +447,4 @@ 431 common fsconfig sys_fsconfig 432 common fsmount sys_fsmount 433 common fspick sys_fspick +436 common clone3 sys_clone3 diff --git a/arch/arm64/include/asm/unistd.h b/arch/arm64/include/asm/unistd.h index 70e6882853c0..24480c2d95da 100644 --- a/arch/arm64/include/asm/unistd.h +++ b/arch/arm64/include/asm/unistd.h @@ -44,7 +44,7 @@ #define __ARM_NR_compat_set_tls (__ARM_NR_COMPAT_BASE + 5) #define __ARM_NR_COMPAT_END (__ARM_NR_COMPAT_BASE + 0x800) -#define __NR_compat_syscalls 434 +#define __NR_compat_syscalls 437 #endif #define __ARCH_WANT_SYS_CLONE diff --git a/arch/arm64/include/asm/unistd32.h b/arch/arm64/include/asm/unistd32.h index c39e90600bb3..b144ea675d70 100644 --- a/arch/arm64/include/asm/unistd32.h +++ b/arch/arm64/include/asm/unistd32.h @@ -886,6 +886,8 @@ __SYSCALL(__NR_fsconfig, sys_fsconfig) __SYSCALL(__NR_fsmount, sys_fsmount) #define __NR_fspick 433 __SYSCALL(__NR_fspick, sys_fspick) +#define __NR_clone3 436 +__SYSCALL(__NR_clone3, sys_clone3) /* * Please add new compat syscalls above this comment and update diff --git a/arch/microblaze/kernel/syscalls/syscall.tbl b/arch/microblaze/kernel/syscalls/syscall.tbl index 26339e417695..3110440bcc31 100644 --- a/arch/microblaze/kernel/syscalls/syscall.tbl +++ b/arch/microblaze/kernel/syscalls/syscall.tbl @@ -439,3 +439,4 @@ 431 common fsconfig sys_fsconfig 432 common fsmount sys_fsmount 433 common fspick sys_fspick +436 common clone3 sys_clone3 diff --git a/arch/x86/entry/syscalls/syscall_32.tbl b/arch/x86/entry/syscalls/syscall_32.tbl index ad968b7bac72..80e26211feff 100644 --- a/arch/x86/entry/syscalls/syscall_32.tbl +++ b/arch/x86/entry/syscalls/syscall_32.tbl @@ -438,3 +438,4 @@ 431 i386 fsconfig sys_fsconfig __ia32_sys_fsconfig 432 i386 fsmount sys_fsmount __ia32_sys_fsmount 433 i386 fspick sys_fspick __ia32_sys_fspick +436 i386 clone3 sys_clone3 __ia32_sys_clone3 diff --git a/arch/x86/entry/syscalls/syscall_64.tbl b/arch/x86/entry/syscalls/syscall_64.tbl index b4e6f9e6204a..7968f0b5b5e8 100644 --- a/arch/x86/entry/syscalls/syscall_64.tbl +++ b/arch/x86/entry/syscalls/syscall_64.tbl @@ -355,6 +355,7 @@ 431 common fsconfig __x64_sys_fsconfig 432 common fsmount __x64_sys_fsmount 433 common fspick __x64_sys_fspick +436 common clone3 __x64_sys_clone3/ptregs # # x32-specific system call numbers start at 512 to avoid cache impact diff --git a/arch/xtensa/kernel/syscalls/syscall.tbl b/arch/xtensa/kernel/syscalls/syscall.tbl index 5fa0ee1c8e00..b2767c8c2b4e 100644 --- a/arch/xtensa/kernel/syscalls/syscall.tbl +++ b/arch/xtensa/kernel/syscalls/syscall.tbl @@ -404,3 +404,4 @@ 431 common fsconfig sys_fsconfig 432 common fsmount sys_fsmount 433 common fspick sys_fspick +436 common clone3 sys_clone3 diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h index a87904daf103..45bc87687c47 100644 --- a/include/uapi/asm-generic/unistd.h +++ b/include/uapi/asm-generic/unistd.h @@ -844,9 +844,11 @@ __SYSCALL(__NR_fsconfig, sys_fsconfig) __SYSCALL(__NR_fsmount, sys_fsmount) #define __NR_fspick 433 __SYSCALL(__NR_fspick, sys_fspick) +#define __NR_clone3 436 +__SYSCALL(__NR_clone3, sys_clone3) #undef __NR_syscalls -#define __NR_syscalls 434 +#define __NR_syscalls 437 /* * 32 bit systems traditionally used different -- 2.21.0