From patchwork Tue Jan 9 15:45:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Xu X-Patchwork-Id: 13515030 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 6B452C46CD2 for ; Tue, 9 Jan 2024 15:46:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DDDDA6B007E; Tue, 9 Jan 2024 10:46:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D8DC96B0081; Tue, 9 Jan 2024 10:46:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C57FC6B0083; Tue, 9 Jan 2024 10:46:05 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id B49896B007E for ; Tue, 9 Jan 2024 10:46:05 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 71D19160937 for ; Tue, 9 Jan 2024 15:46:05 +0000 (UTC) X-FDA: 81660198690.12.026BE61 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by imf17.hostedemail.com (Postfix) with ESMTP id 5BCD140019 for ; Tue, 9 Jan 2024 15:46:03 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=CLvSiOrj; spf=pass (imf17.hostedemail.com: domain of jeffxu@chromium.org designates 209.85.214.173 as permitted sender) smtp.mailfrom=jeffxu@chromium.org; dmarc=pass (policy=none) header.from=chromium.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1704815163; 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=ig3ohwHzq/4+GvsXCviFQR9Ej/i5Rnl+U+9CFpvV1sg=; b=KcLkAQyzMhZVuAGQKwR4ER/1Jnbd5KitKfFZSXnvo9KFsySOS1kNeRqhbrc30VVdTYie87 bMBFXAv3AClVZX2stlEut4ciiL4gMJWFhR5c/MiE/vs3O3TfAC5T57JbcyKbEMxrwZmESj 8n8UxyMMJuw+odwKPGkqOeDsvuEQg6k= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1704815163; a=rsa-sha256; cv=none; b=FJ3MesxgUu/T5MpFPtIdxs2A+PyxquJqIoZanPMZ3LejlVT8spjX0Bg03KH6BhnCiOxM5k soelNVbsksyRrWm/vC+sp3gkfr9XKxSiqLYVTjYFDoqJu/AN73F5anxDNrX/+9MJO/6owX Ru+upCc/aGA6RmO+tRDI1KPw5GUId7A= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=CLvSiOrj; spf=pass (imf17.hostedemail.com: domain of jeffxu@chromium.org designates 209.85.214.173 as permitted sender) smtp.mailfrom=jeffxu@chromium.org; dmarc=pass (policy=none) header.from=chromium.org Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1d4ca2fd2fbso14160285ad.2 for ; Tue, 09 Jan 2024 07:46:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1704815162; x=1705419962; 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=ig3ohwHzq/4+GvsXCviFQR9Ej/i5Rnl+U+9CFpvV1sg=; b=CLvSiOrj2BglDDpT6TNv4nIqG1D+T58Kc5H/SgP01jUhfd1Y8we00+o+DFr9HLrnht s1m8yDm1jOxEnuJK9QI5MsIkCm4E4r6lBBsTr32jrt8uA1puTmB2nfme0KwUTJw4X2+X ejh4kc9IzYOqXM+rSpAjs5oZXirKjYquhqa7Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704815162; x=1705419962; 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=ig3ohwHzq/4+GvsXCviFQR9Ej/i5Rnl+U+9CFpvV1sg=; b=Nrz4SkBQBmWjgGZVX2Eyz07SV0tK7/BiR5jLVQuW1m7KF+ArrIGWOZXNXwywRCqbhG GzBMv77vnhgmGm9i5drrc9N+LaYVrphYouskxI3WXm9UUDikmxwPnwMbDfBt15iJ7za0 Afd9Dt615W9aWFa0jfoJAa08VWCQvU7l+X8yphIesyAaTQQwTDYoTKcstmZI7MEMqqd6 cGbxC28Xt0utTYbODEq+/kXW/bbNyYIGrHwjXV0Ap5Qgq7dkda2O1LwXEb7qI4mbbT2p EyicaKImn10t26WVH4DhRqtrb66IgBo4ubz0UcGGQnPYY2vm4Op2zjoVJGU4T3RFYcut Lteg== X-Gm-Message-State: AOJu0YyuLsl2oETjexUqpMup5IR8iy09dAxPE76Q8Lt9G9Hj3XybiBW5 zxiy7cp1Mvg9F4E7Sw3dhdsIzcZZ0EGR X-Google-Smtp-Source: AGHT+IH4k0ufyA+hoVXReRKZGJVZrKy5Y1nbuBoicBfPXBbSt8cSLBYs3HNIHxmv1p7vZ518XLU4cw== X-Received: by 2002:a17:902:b405:b0:1d4:133d:6ace with SMTP id x5-20020a170902b40500b001d4133d6acemr2714492plr.7.1704815162231; Tue, 09 Jan 2024 07:46:02 -0800 (PST) Received: from localhost (34.85.168.34.bc.googleusercontent.com. [34.168.85.34]) by smtp.gmail.com with UTF8SMTPSA id j9-20020a170902690900b001d403969b65sm1939344plk.187.2024.01.09.07.46.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 09 Jan 2024 07:46:01 -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 v5 1/4] mseal: Wire up mseal syscall Date: Tue, 9 Jan 2024 15:45:39 +0000 Message-ID: <20240109154547.1839886-2-jeffxu@chromium.org> X-Mailer: git-send-email 2.43.0.195.gebba966016-goog In-Reply-To: <20240109154547.1839886-1-jeffxu@chromium.org> References: <20240109154547.1839886-1-jeffxu@chromium.org> MIME-Version: 1.0 X-Stat-Signature: xcygkm435u67tjgbmducenttq1t88noe X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 5BCD140019 X-Rspam-User: X-HE-Tag: 1704815163-255397 X-HE-Meta: U2FsdGVkX18rVkNJq5ZCBHW+swYac8oeqe9W6oxKATUhf2ssUa6BGvX3IYqDEywfbFgeTnqQ5/QBG1loLayjECltZyzV6coY3RFwMUKZtpemVBFPcFpJnKQXswEea+GYUbxpEye+vir7HpSEkoBEQeGaS/TaFSXI43cqiaNWFKRx2hJ9d67hMho7iiuCPPoNWH02WfbRZiag8b5BB4ur+V0WPisMaIZRibVNBB/iaWgP9OKeZhytfHK2poYb+3UyojkWGG8OohhVXkU9eBhQpA6fjuZbMldQwFZAwvpsoVSPPanrkNbHwQIpe4c6sq8I97VHf4DCClg5UzduIEuEu/YZu8pPK8+o/Dmg9Y9HP1KllK3Tg8SBlx32+AG/0cm6oVIGqPZJB9mqiCB5YuZUhh3BdNbufK8aT4kErq6hQ+QNL7yodQhIm9VTVJWity0l2SldyOScnBtOB4de6B1eJIbmACLe2hJu66FkORhIJZTDdvD/Xab1rhydka391MIssAmRmF4Iglrip9dlOTJfKpyBVnWMiGGlGxgvJXVa4wRKn+vKnxSae58XYigaAPbmqKUsBInUjDoRQ0Ea3hspkmiWYsDq5PiD9QDWk44uVtI5YtnHtVnybueMdJDh3s7R2WApSdUhJjOiYM+RZtcND372n2EnT0YZXjwc3bVGDrzYEshzQ5Xj6rxWcOCednI3RAzA0aknHJ6Ey77fZGOnZgQ9nUmY9L3DXLVnWG0heEqiys9olS80lxNz2f7gEFVwuR7jFwG15pNqgwAALTMQUCiPXzBx+smLeTIjqshqLdJxxST45rkTxKhh4W+GYdGQcLTV6LvVa7irSwLficaMIPUjcCjQGY0anIm0DCgntNVXfZp69PphoQe6OC2ECH2fq4nOdsoofDp0nyERdEsrH8Y/5gMOxY5cXBRUGFU9qiIbk3CKK3M0AYyxvY2/QVtgxraQkikoC+0DKXiy2Yf /r/FpmB8 OZ77Nlt6x3VHCux9znlDIhHqdyP9tIt937v1tXdSQVyBwL5Xq1oj58PZnlQ+4Av+LTiDzWMItEbEXyNoGwAFvHRKxRlGVCa0aBvRF4VxHuiYC38rOGkfsa/Sfj/vqXrqgnrR30GRJywfIBvqNnstjwB1tYMSPsKOXQDcSV17mhmxODhDjdMAJX7J41/Bg3nkkdc6Bek1qJB4KB+I0VknqqcKkmFCFkatK5uWtLKP4GmYqZK03tdUitd4LN321CxczDuLQURNXJnP51SZKwgc+Jomcf1HTrpXVJ2XQX4PGK4ogl3Ehe76wDiWcFjZYE9dldX1ISe/olMCMtECkX8qFRY2B0TVyv6LHeVth/ru6k0n9qj2XZO3Km2lk1sPR0G0pn6rItFbBx50Op89Ss87auW1sgA4afV22rMDJmEDWvoKZ1dIfV8pqbqVWDw== 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 ++++- kernel/sys_ni.c | 1 + 19 files changed, 23 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 diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c index 9a846439b36a..02280199069b 100644 --- a/kernel/sys_ni.c +++ b/kernel/sys_ni.c @@ -193,6 +193,7 @@ COND_SYSCALL(migrate_pages); COND_SYSCALL(move_pages); COND_SYSCALL(set_mempolicy_home_node); COND_SYSCALL(cachestat); +COND_SYSCALL(mseal); COND_SYSCALL(perf_event_open); COND_SYSCALL(accept4);