All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Lorenzo Stoakes (ARM)" <ljs@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "Liam R. Howlett" <liam@infradead.org>,
	 Vlastimil Babka <vbabka@kernel.org>,
	Jann Horn <jannh@google.com>, Pedro Falcato <pfalcato@suse.de>,
	 Alexander Viro <viro@zeniv.linux.org.uk>,
	Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
	 Kees Cook <kees@kernel.org>,
	David Hildenbrand <david@kernel.org>,
	 Mike Rapoport <rppt@kernel.org>,
	Suren Baghdasaryan <surenb@google.com>,
	 Michal Hocko <mhocko@suse.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	 linux-fsdevel@vger.kernel.org, Leon Hwang <leon.hwang@linux.dev>
Subject: Re: [PATCH 3/3] mm/mseal: remove further superfluous comments, do_mseal()
Date: Fri, 17 Jul 2026 12:06:55 +0100	[thread overview]
Message-ID: <aloK6qs03fPpI5Qa@lucifer> (raw)
In-Reply-To: <20260716173355.41a98b4e5d5a06772fd7fc12@linux-foundation.org>

On Thu, Jul 16, 2026 at 05:33:55PM -0700, Andrew Morton wrote:
> On Thu, 16 Jul 2026 14:43:11 +0100 "Lorenzo Stoakes (ARM)" <ljs@kernel.org> wrote:
>
> > There's no need to abstract do_mseal() any longer so put the system call
> > implementation in the system call declaration.
> >
> > The comment around do_mseal() is strangely formatted, overly long and adds
> > a lot of superfluous information that the code already provides, so boil it
> > down to the essentials.
> >
>
> This patch
> (https://lore.kernel.org/20260716-mseal-fixups-v1-3-3a9609bf041b@kernel.org)
> overlaps muchly with Leon's "mm/mseal: fix mseal documentation for
> 32-bit kernels"
> (https://lore.kernel.org/20260715131258.55499-1-leon.hwang@linux.dev).
>
> I'll remove the mseal.c changes from Leon's patch and I'll retain the
> rest of that patch, after adjusting its changelog.  Please check all of
> this!

Thanks! And sorry Leon - we definitely don't need the majority of the
comments in mseal.c - so this change essentially makes those changes of
yours unnecessary here.

>
>
> Here's what's left of Leon's patch:
>
> From: Leon Hwang <leon.hwang@linux.dev>
> Subject: mm/mseal: fix mseal documentation for 32-bit kernels
> Date: Wed, 15 Jul 2026 21:12:58 +0800
>
> mseal.o is built only for 64-bit kernels, so 32-bit kernels fall back to
> sys_ni_syscall() and return -ENOSYS rather than -EPERM.
>
> Drop architecture description in mseal.rst, since the arch feature doc has
> the latest state of mseal for each architecture.
>
> Fix the CONFIG_MSEAL_SYSTEM_MAPPINGS typo in init/Kconfig.
>
> Link: https://lore.kernel.org/20260715131258.55499-1-leon.hwang@linux.dev
> Signed-off-by: Leon Hwang <leon.hwang@linux.dev>
> Acked-by: Lance Yang <lance.yang@linux.dev>
> Cc: Alice Ryhl <aliceryhl@google.com>
> Cc: Anand Moon <linux.amoon@gmail.com>
> Cc: Doug Anderson <dianders@chromium.org>
> Cc: Gary Guo <gary@garyguo.net>
> Cc: Jann Horn <jannh@google.com>
> Cc: Jonathan Corbet <corbet@lwn.net>
> Cc: Leon Hwang <leon.hwang@linux.dev>
> Cc: Liam R. Howlett <liam@infradead.org>
> Cc: Lorenzo Stoakes <ljs@kernel.org>
> Cc: Miguel Ojeda <ojeda@kernel.org>
> Cc: Nathan Chancellor <nathan@kernel.org>
> Cc: Pedro Falcato <pfalcato@suse.de>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Randy Dunlap <rdunlap@infradead.org>
> Cc: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> Cc: Vlastimil Babka <vbabka@kernel.org>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
>
>  Documentation/userspace-api/mseal.rst |   14 ++++++--------
>  init/Kconfig                          |    2 +-
>  2 files changed, 7 insertions(+), 9 deletions(-)
>
> --- a/Documentation/userspace-api/mseal.rst~mm-mseal-fix-mseal-documentation-for-32-bit-kernels
> +++ a/Documentation/userspace-api/mseal.rst
> @@ -50,8 +50,8 @@ mseal syscall signature
>           * The start address (``addr``) is not allocated.
>           * The end address (``addr`` + ``len``) is not allocated.
>           * A gap (unallocated memory) between start and end address.
> -      - **-EPERM**:
> -         * sealing is supported only on 64-bit CPUs, 32-bit is not supported.
> +      - **-ENOSYS**:
> +         * The kernel does not implement ``mseal()``.
>
>     **Note about error return**:
>        - For above error cases, users can expect the given memory range is
> @@ -62,7 +62,8 @@ mseal syscall signature
>          memory range could happen. However, those cases should be rare.
>
>     **Architecture support**:
> -      mseal only works on 64-bit CPUs, not 32-bit CPUs.
> +      mseal is built only for 64-bit kernels. 32-bit kernels return
> +      ``-ENOSYS``.
>
>     **Idempotent**:
>        users can call mseal multiple times. mseal on an already sealed memory
> @@ -131,11 +132,11 @@ Use cases
>  - Chrome browser: protect some security sensitive data structures.
>
>  - System mappings:
> -  The system mappings are created by the kernel and includes vdso, vvar,
> +  The system mappings are created by the kernel and include vdso, vvar,
>    vvar_vclock, vectors (arm compat-mode), sigpage (arm compat-mode), uprobes.
>
>    Those system mappings are readonly only or execute only, memory sealing can
> -  protect them from ever changing to writable or unmmap/remapped as different
> +  protect them from ever changing to writable or unmapped/remapped as different
>    attributes. This is useful to mitigate memory corruption issues where a
>    corrupted pointer is passed to a memory management system.
>
> @@ -143,9 +144,6 @@ Use cases
>    the CONFIG_MSEAL_SYSTEM_MAPPINGS seals all system mappings of this
>    architecture.
>
> -  The following architectures currently support this feature: x86-64, arm64,
> -  loongarch and s390.
> -
>    WARNING: This feature breaks programs which rely on relocating
>    or unmapping system mappings. Known broken software at the time
>    of writing includes CHECKPOINT_RESTORE, UML, gVisor, rr. Therefore
> --- a/init/Kconfig~mm-mseal-fix-mseal-documentation-for-32-bit-kernels
> +++ a/init/Kconfig
> @@ -2120,7 +2120,7 @@ config ARCH_SUPPORTS_MSEAL_SYSTEM_MAPPIN
>  	  from a kernel perspective.
>
>  	  After the architecture enables this, a distribution can set
> -	  CONFIG_MSEAL_SYSTEM_MAPPING to manage access to the feature.
> +	  CONFIG_MSEAL_SYSTEM_MAPPINGS to manage access to the feature.
>
>  	  For complete descriptions of memory sealing, please see
>  	  Documentation/userspace-api/mseal.rst
> _
>

LGTM!

Cheers, Lorenzo

  reply	other threads:[~2026-07-17 11:07 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-16 13:43 [PATCH 0/3] mm/mseal: further cleanups Lorenzo Stoakes (ARM)
2026-07-16 13:43 ` [PATCH 1/3] mm/mseal: remove superfluous comments, fix confusion around mm Lorenzo Stoakes (ARM)
2026-07-16 15:00   ` Pedro Falcato
2026-07-17 10:33   ` David Hildenbrand (Arm)
2026-07-17 10:44     ` Lorenzo Stoakes (ARM)
2026-07-16 13:43 ` [PATCH 2/3] mm/mseal: limit scope of mseal address zero to address zero Lorenzo Stoakes (ARM)
2026-07-16 15:06   ` Pedro Falcato
2026-07-16 15:38     ` Lorenzo Stoakes (ARM)
2026-07-17 10:41       ` David Hildenbrand (Arm)
2026-07-17 10:51         ` Lorenzo Stoakes (ARM)
2026-07-17 10:46   ` David Hildenbrand (Arm)
2026-07-17 10:49     ` David Hildenbrand (Arm)
2026-07-17 10:52       ` Lorenzo Stoakes (ARM)
2026-07-16 13:43 ` [PATCH 3/3] mm/mseal: remove further superfluous comments, do_mseal() Lorenzo Stoakes (ARM)
2026-07-16 15:09   ` Pedro Falcato
2026-07-16 15:13     ` Lorenzo Stoakes (ARM)
2026-07-17  0:33   ` Andrew Morton
2026-07-17 11:06     ` Lorenzo Stoakes (ARM) [this message]
2026-07-17 10:50   ` David Hildenbrand (Arm)
2026-07-17 10:55     ` Lorenzo Stoakes (ARM)
2026-07-16 13:48 ` [PATCH 0/3] mm/mseal: further cleanups Lorenzo Stoakes (ARM)

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=aloK6qs03fPpI5Qa@lucifer \
    --to=ljs@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=brauner@kernel.org \
    --cc=david@kernel.org \
    --cc=jack@suse.cz \
    --cc=jannh@google.com \
    --cc=kees@kernel.org \
    --cc=leon.hwang@linux.dev \
    --cc=liam@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=pfalcato@suse.de \
    --cc=rppt@kernel.org \
    --cc=surenb@google.com \
    --cc=vbabka@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.