From patchwork Thu Jan 4 18:51:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Xu X-Patchwork-Id: 13511459 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E706C47073 for ; Thu, 4 Jan 2024 18:51:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7D5DE6B02F8; Thu, 4 Jan 2024 13:51:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 786516B02F9; Thu, 4 Jan 2024 13:51:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 64DEA6B02FE; Thu, 4 Jan 2024 13:51:51 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 5151E6B02F8 for ; Thu, 4 Jan 2024 13:51:51 -0500 (EST) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id C8ABBC03E5 for ; Thu, 4 Jan 2024 18:51:50 +0000 (UTC) X-FDA: 81642522780.19.752D4A7 Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) by imf21.hostedemail.com (Postfix) with ESMTP id EED071C001E for ; Thu, 4 Jan 2024 18:51:48 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=ceqIt8Bm; dmarc=pass (policy=none) header.from=chromium.org; spf=pass (imf21.hostedemail.com: domain of jeffxu@chromium.org designates 209.85.215.171 as permitted sender) smtp.mailfrom=jeffxu@chromium.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1704394309; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=9vp6RDMhIbeWN30Zt74XtPJJxX+4yul7WAi5sjTUUtY=; b=mxGbtA+7AUTF3bcVq++NkDvOzMTrChsOiGiCBiIZ4HrwYExwOVCcg51wGdVdlp+B6UOLJN X7w94u6KEHGYSH90S5mobfxcwJpQojGH7fw7BQOAokqJa3MyVyeeZnhyA0FVOSrVLnIMFW QC2jJflwVcPSd1LzVyG6VhXxRP1yAFY= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=ceqIt8Bm; dmarc=pass (policy=none) header.from=chromium.org; spf=pass (imf21.hostedemail.com: domain of jeffxu@chromium.org designates 209.85.215.171 as permitted sender) smtp.mailfrom=jeffxu@chromium.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1704394309; a=rsa-sha256; cv=none; b=nnxTWjoyYACHI3hEiUYt/aA/XTRFSYZnG507GdKMz+sr8ZKI29W/k9qlqBFThNtF4aGjYn Rbjj6T7KNHALw+V1B1IPJYtRZRytu8ZMAIKETmIZZnWW1Eh5Lqkx87KB2vfRgSs8sEI28Z I1JP984xE7FCEaq086E3AWklRL++lm0= Received: by mail-pg1-f171.google.com with SMTP id 41be03b00d2f7-5bdbe2de25fso614399a12.3 for ; Thu, 04 Jan 2024 10:51:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1704394308; x=1704999108; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9vp6RDMhIbeWN30Zt74XtPJJxX+4yul7WAi5sjTUUtY=; b=ceqIt8BmViFfKgsP4I5pblHs3XJD/Pl7FU51v+VUTabkPJw8t9Y/Pvgcy2oM0sgUnu tpwcnNt8CP410TY16I61FIFu4DtprU3fyOLS3UyChgRMoaHD/RO7jRlkcWZ28ct0Uwj5 6s8dDzqLF9nxamU6EIuj8Xm2lO9ddcm+ADp5s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704394308; x=1704999108; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9vp6RDMhIbeWN30Zt74XtPJJxX+4yul7WAi5sjTUUtY=; b=JFunmSaBz+OpJ1brbcgRIMROrpPqVcMTvn7nkW6FD+TBYsMjJ4Z5O3FmXc4FuCY2ni dIQIfV0A+05jPGf+OcLq1teXJo6qkAFgc1kbZKIEP/qmE8T3DctR35t6vXELakctCTwI L0hM4/5hHLKk6JR8RSumgumC7shM3g4DssWbRnjVIP33H92AvqWTqQYnh0DsuA48s3XL jqwyRvKgCpssLEAPt9MNkgy/qotq1zS1NRYBbvTSSeiSfmtVzDViPtUGglxQdFQbfuo7 cFfL0VSZNbN7RBc+x+PvZkR8BVwQLUDtbZTRQJIKMNcyyPQ11mK6xGDUUZwYEaNSZtQH Hi2Q== X-Gm-Message-State: AOJu0Yyxwlo+5BPONCUXaYfs34FKATGG1afyGx06uHf/g1+zcQCgvd4H 0mbqGHWsV4zt+NaTYPQfU1gENephJrdg X-Google-Smtp-Source: AGHT+IGLVWuovdc/3Mqfnc1J+v/iTT3+RHhB6tsCb6oWeUKVD78iZqeYmHSdcVI6Rot13MxNAEPhWA== X-Received: by 2002:a05:6a21:3398:b0:197:716a:6f55 with SMTP id yy24-20020a056a21339800b00197716a6f55mr1119741pzb.23.1704394307720; Thu, 04 Jan 2024 10:51:47 -0800 (PST) Received: from localhost (34.85.168.34.bc.googleusercontent.com. [34.168.85.34]) by smtp.gmail.com with UTF8SMTPSA id n25-20020aa78a59000000b006d9a42f25b2sm21044345pfa.201.2024.01.04.10.51.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 04 Jan 2024 10:51:46 -0800 (PST) From: jeffxu@chromium.org To: akpm@linux-foundation.org, keescook@chromium.org, jannh@google.com, sroettger@google.com, willy@infradead.org, gregkh@linuxfoundation.org, torvalds@linux-foundation.org, usama.anjum@collabora.com Cc: jeffxu@google.com, jorgelo@chromium.org, groeck@chromium.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, pedro.falcato@gmail.com, dave.hansen@intel.com, linux-hardening@vger.kernel.org, deraadt@openbsd.org, Jeff Xu Subject: [RFC PATCH v4 1/4] mseal: Wire up mseal syscall Date: Thu, 4 Jan 2024 18:51:34 +0000 Message-ID: <20240104185138.169307-2-jeffxu@chromium.org> X-Mailer: git-send-email 2.43.0.195.gebba966016-goog In-Reply-To: <20240104185138.169307-1-jeffxu@chromium.org> References: <20240104185138.169307-1-jeffxu@chromium.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: EED071C001E X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: 1osp9eqq8yaojfmmr9z88oj5n5axrt7b X-HE-Tag: 1704394308-433659 X-HE-Meta: U2FsdGVkX1+PLcHhgr+v+hNWS3iqz7VTzuWzZv7XJ4+OiFx4HVvLN5hjJhE0pPCtlRYoEjdt80su1oY9S7RSRk/5/KfbHDyCJHG5xtOpzGWtC5f+4fPxUdHPzIimsPfDBckc/AApXUxp1NhSko0Zwq3ZTOMOHXcWwUT6vh0xxI3S74L7BCdjn7F+Pf/bjj2xKY3evIjN0vOuKrPIHBtuxBV03ydt1/TxrjJFmrzX5ybljD4812NnsItBb0MZlLqzp7aJDPF56gpiRCrHO7G5DUjkcU26pDtKBq3g7Idwm6cdfScTLp4pQ7AObRs64eEjtdjov2RgpmfyKBdVb0bQYW+6Xqr9DEGaMpHKOGGvlwu/p2wPcH+q+sxnDDy3b3G8I2qL2EvWpTqeG+gKihaguIJA5YB9PuP8FSWMEhq/+/Pc1zuTqJOSO/LHPr9M2KTg3iDc5P/44wIilvyMqqb6qS007G0sgI5u+lEsotwzakcw/TsyccHEF1CeHE6i/dLhwjaReQJIrjv510xf3gSXkFang4OPLBM07b+sB8CVsJri+4uaDHevT+daekzY+fPv04igHJSU6i0Ly2JE0qIg2ngxpHDJevb873GUHnFt/4krT1ilxIreOJPzd6YeptT6NoC261d1fYDlBJT89fMGdqDtOR5Q91HzPgSlkg8KyUnSYFMJWTGhGNbcLI2TYjaTCxOpCEfbjPZ5QvBhP6eb6ENKARUQAr2KZOzHMpxzLpjN5S9xfNzo7KzCC7B0XtqoheZB3MokA/VXRHOkhJE+vsJql8NfqqpOveIQ5kvndFOHC+LUH4unxl9F9mL5LjWuvy1iq2DTQ2H7QC4eQARm5rCAzk6w+fCdtTGvMLET6R48k4QNw78D61Io5rzl+1y50VryIkuaj5Yk/t6rYY57gLdyTZ//1biFUmeh4PqZtSOC+KGdiGBXwugxM6TC2C2WNwEsiKSjnLyePtWNCSY Yo2Dwtbq dm6H3gWUaUnUYU+rmd41DZuXgAJK2QNn59a7l7BHzVUy3HQ012GqQWeQQflU9jGkSi5JhYgeTYy7rz6W6uf8Ntw/hwVSqZqeg441i1cQB/yiCYi4plJyKR6bQoODTpXPpjK/TiFo+gk/O3dDvdHR3HgG9Ycxl37jdEZ1kNPPIUn//c7orfWpVBEpas0S676+JQSfBY8wiP231TLe9AH+EWxCWM1tUNi55e1ejj3fvQHcJMvA4Fs8pVot9egfSmyIPTgZw6kIHQeN936XaTdbhw6No4vLHFP6UpZwyzSq+saxcyfmZiLM/BGPhIEeLaVob+vlaDLH3gWnIHo6ddnoB9KMav9Yt8x1X9y79EnJnWELdlww6K9n5V8HNgnmYpAMxhGzuNa2clrn57buXnjBTv0gPCcO9ydgI25pi/fIDDWiJrJgvd45VWH1N3g== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Jeff Xu Wire up mseal syscall for all architectures. Signed-off-by: Jeff Xu --- arch/alpha/kernel/syscalls/syscall.tbl | 1 + arch/arm/tools/syscall.tbl | 1 + arch/arm64/include/asm/unistd.h | 2 +- arch/arm64/include/asm/unistd32.h | 2 ++ arch/m68k/kernel/syscalls/syscall.tbl | 1 + arch/microblaze/kernel/syscalls/syscall.tbl | 1 + arch/mips/kernel/syscalls/syscall_n32.tbl | 1 + arch/mips/kernel/syscalls/syscall_n64.tbl | 1 + arch/mips/kernel/syscalls/syscall_o32.tbl | 1 + arch/parisc/kernel/syscalls/syscall.tbl | 1 + arch/powerpc/kernel/syscalls/syscall.tbl | 1 + arch/s390/kernel/syscalls/syscall.tbl | 1 + arch/sh/kernel/syscalls/syscall.tbl | 1 + arch/sparc/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 | 5 ++++- 18 files changed, 22 insertions(+), 2 deletions(-) diff --git a/arch/alpha/kernel/syscalls/syscall.tbl b/arch/alpha/kernel/syscalls/syscall.tbl index 18c842ca6c32..dd92e2639a03 100644 --- a/arch/alpha/kernel/syscalls/syscall.tbl +++ b/arch/alpha/kernel/syscalls/syscall.tbl @@ -496,3 +496,4 @@ 564 common futex_wake sys_futex_wake 565 common futex_wait sys_futex_wait 566 common futex_requeue sys_futex_requeue +567 common mseal sys_mseal diff --git a/arch/arm/tools/syscall.tbl b/arch/arm/tools/syscall.tbl index 584f9528c996..d96461ee1ebe 100644 --- a/arch/arm/tools/syscall.tbl +++ b/arch/arm/tools/syscall.tbl @@ -470,3 +470,4 @@ 454 common futex_wake sys_futex_wake 455 common futex_wait sys_futex_wait 456 common futex_requeue sys_futex_requeue +457 common mseal sys_mseal diff --git a/arch/arm64/include/asm/unistd.h b/arch/arm64/include/asm/unistd.h index 531effca5f1f..298313d2e0af 100644 --- a/arch/arm64/include/asm/unistd.h +++ b/arch/arm64/include/asm/unistd.h @@ -39,7 +39,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 457 +#define __NR_compat_syscalls 458 #endif #define __ARCH_WANT_SYS_CLONE diff --git a/arch/arm64/include/asm/unistd32.h b/arch/arm64/include/asm/unistd32.h index 9f7c1bf99526..e3118e0327c7 100644 --- a/arch/arm64/include/asm/unistd32.h +++ b/arch/arm64/include/asm/unistd32.h @@ -919,6 +919,8 @@ __SYSCALL(__NR_futex_wake, sys_futex_wake) __SYSCALL(__NR_futex_wait, sys_futex_wait) #define __NR_futex_requeue 456 __SYSCALL(__NR_futex_requeue, sys_futex_requeue) +#define __NR_mseal 457 +__SYSCALL(__NR_mseal, sys_mseal) /* * Please add new compat syscalls above this comment and update diff --git a/arch/m68k/kernel/syscalls/syscall.tbl b/arch/m68k/kernel/syscalls/syscall.tbl index 7a4b780e82cb..105e966db655 100644 --- a/arch/m68k/kernel/syscalls/syscall.tbl +++ b/arch/m68k/kernel/syscalls/syscall.tbl @@ -456,3 +456,4 @@ 454 common futex_wake sys_futex_wake 455 common futex_wait sys_futex_wait 456 common futex_requeue sys_futex_requeue +457 common mseal sys_mseal diff --git a/arch/microblaze/kernel/syscalls/syscall.tbl b/arch/microblaze/kernel/syscalls/syscall.tbl index 5b6a0b02b7de..18956345d348 100644 --- a/arch/microblaze/kernel/syscalls/syscall.tbl +++ b/arch/microblaze/kernel/syscalls/syscall.tbl @@ -462,3 +462,4 @@ 454 common futex_wake sys_futex_wake 455 common futex_wait sys_futex_wait 456 common futex_requeue sys_futex_requeue +457 common mseal sys_mseal diff --git a/arch/mips/kernel/syscalls/syscall_n32.tbl b/arch/mips/kernel/syscalls/syscall_n32.tbl index a842b41c8e06..06cac28209d2 100644 --- a/arch/mips/kernel/syscalls/syscall_n32.tbl +++ b/arch/mips/kernel/syscalls/syscall_n32.tbl @@ -395,3 +395,4 @@ 454 n32 futex_wake sys_futex_wake 455 n32 futex_wait sys_futex_wait 456 n32 futex_requeue sys_futex_requeue +457 n32 mseal sys_mseal diff --git a/arch/mips/kernel/syscalls/syscall_n64.tbl b/arch/mips/kernel/syscalls/syscall_n64.tbl index 116ff501bf92..bb8270588953 100644 --- a/arch/mips/kernel/syscalls/syscall_n64.tbl +++ b/arch/mips/kernel/syscalls/syscall_n64.tbl @@ -371,3 +371,4 @@ 454 n64 futex_wake sys_futex_wake 455 n64 futex_wait sys_futex_wait 456 n64 futex_requeue sys_futex_requeue +457 n64 mseal sys_mseal diff --git a/arch/mips/kernel/syscalls/syscall_o32.tbl b/arch/mips/kernel/syscalls/syscall_o32.tbl index 525cc54bc63b..93958f063c3f 100644 --- a/arch/mips/kernel/syscalls/syscall_o32.tbl +++ b/arch/mips/kernel/syscalls/syscall_o32.tbl @@ -444,3 +444,4 @@ 454 o32 futex_wake sys_futex_wake 455 o32 futex_wait sys_futex_wait 456 o32 futex_requeue sys_futex_requeue +457 o32 mseal sys_mseal diff --git a/arch/parisc/kernel/syscalls/syscall.tbl b/arch/parisc/kernel/syscalls/syscall.tbl index a47798fed54e..c6bc9277dcd7 100644 --- a/arch/parisc/kernel/syscalls/syscall.tbl +++ b/arch/parisc/kernel/syscalls/syscall.tbl @@ -455,3 +455,4 @@ 454 common futex_wake sys_futex_wake 455 common futex_wait sys_futex_wait 456 common futex_requeue sys_futex_requeue +457 common mseal sys_mseal diff --git a/arch/powerpc/kernel/syscalls/syscall.tbl b/arch/powerpc/kernel/syscalls/syscall.tbl index 7fab411378f2..2947c4caf22e 100644 --- a/arch/powerpc/kernel/syscalls/syscall.tbl +++ b/arch/powerpc/kernel/syscalls/syscall.tbl @@ -543,3 +543,4 @@ 454 common futex_wake sys_futex_wake 455 common futex_wait sys_futex_wait 456 common futex_requeue sys_futex_requeue +457 common mseal sys_mseal diff --git a/arch/s390/kernel/syscalls/syscall.tbl b/arch/s390/kernel/syscalls/syscall.tbl index 86fec9b080f6..2400a0e91883 100644 --- a/arch/s390/kernel/syscalls/syscall.tbl +++ b/arch/s390/kernel/syscalls/syscall.tbl @@ -459,3 +459,4 @@ 454 common futex_wake sys_futex_wake sys_futex_wake 455 common futex_wait sys_futex_wait sys_futex_wait 456 common futex_requeue sys_futex_requeue sys_futex_requeue +457 common mseal sys_mseal sys_mseal diff --git a/arch/sh/kernel/syscalls/syscall.tbl b/arch/sh/kernel/syscalls/syscall.tbl index 363fae0fe9bf..6768e43c5d23 100644 --- a/arch/sh/kernel/syscalls/syscall.tbl +++ b/arch/sh/kernel/syscalls/syscall.tbl @@ -459,3 +459,4 @@ 454 common futex_wake sys_futex_wake 455 common futex_wait sys_futex_wait 456 common futex_requeue sys_futex_requeue +457 common mseal sys_mseal diff --git a/arch/sparc/kernel/syscalls/syscall.tbl b/arch/sparc/kernel/syscalls/syscall.tbl index 7bcaa3d5ea44..4285465f7e4b 100644 --- a/arch/sparc/kernel/syscalls/syscall.tbl +++ b/arch/sparc/kernel/syscalls/syscall.tbl @@ -502,3 +502,4 @@ 454 common futex_wake sys_futex_wake 455 common futex_wait sys_futex_wait 456 common futex_requeue sys_futex_requeue +457 common mseal sys_mseal diff --git a/arch/x86/entry/syscalls/syscall_32.tbl b/arch/x86/entry/syscalls/syscall_32.tbl index c8fac5205803..e4e3b2097658 100644 --- a/arch/x86/entry/syscalls/syscall_32.tbl +++ b/arch/x86/entry/syscalls/syscall_32.tbl @@ -461,3 +461,4 @@ 454 i386 futex_wake sys_futex_wake 455 i386 futex_wait sys_futex_wait 456 i386 futex_requeue sys_futex_requeue +457 i386 mseal sys_mseal diff --git a/arch/x86/entry/syscalls/syscall_64.tbl b/arch/x86/entry/syscalls/syscall_64.tbl index 8cb8bf68721c..03cff8a24726 100644 --- a/arch/x86/entry/syscalls/syscall_64.tbl +++ b/arch/x86/entry/syscalls/syscall_64.tbl @@ -378,6 +378,7 @@ 454 common futex_wake sys_futex_wake 455 common futex_wait sys_futex_wait 456 common futex_requeue sys_futex_requeue +457 common mseal sys_mseal # # Due to a historical design error, certain syscalls are numbered differently diff --git a/arch/xtensa/kernel/syscalls/syscall.tbl b/arch/xtensa/kernel/syscalls/syscall.tbl index 06eefa9c1458..3c87cf0424c8 100644 --- a/arch/xtensa/kernel/syscalls/syscall.tbl +++ b/arch/xtensa/kernel/syscalls/syscall.tbl @@ -427,3 +427,4 @@ 454 common futex_wake sys_futex_wake 455 common futex_wait sys_futex_wait 456 common futex_requeue sys_futex_requeue +457 common mseal sys_mseal diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h index 756b013fb832..9b2b6a4a80b6 100644 --- a/include/uapi/asm-generic/unistd.h +++ b/include/uapi/asm-generic/unistd.h @@ -829,8 +829,11 @@ __SYSCALL(__NR_futex_wait, sys_futex_wait) #define __NR_futex_requeue 456 __SYSCALL(__NR_futex_requeue, sys_futex_requeue) +#define __NR_mseal 457 +__SYSCALL(__NR_mseal, sys_mseal) + #undef __NR_syscalls -#define __NR_syscalls 457 +#define __NR_syscalls 458 /* * 32 bit systems traditionally used different