Skip to contentSkip to conversation

mm/mseal: fix mseal documentation for 32-bit kernels

PATCH Superseded Leon Hwang 5 participants 12 messages Jul 3 – Jul 7

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Leon Hwang

author
#0 lore raw

PATCH 1/1 mm/mseal: fix mseal documentation for 32-bit kernels

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.

Document the -EINTR return from mmap_write_lock_killable(), fix the CONFIG_MSEAL_SYSTEM_MAPPINGS typo, and describe system mappings in terms of VM_SEALED_SYSMAP.

---
 Documentation/userspace-api/mseal.rst | 18 ++++++++++--------
 init/Kconfig                          |  2 +-
 mm/mseal.c                            |  4 ++--
 3 files changed, 13 insertions(+), 11 deletions(-)
Documentation/userspace-api/mseal.rst +10 -8
index ea9b11a0bd89..1f1cf206670c 100644
@@ -50,8 +50,10 @@ 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.
+      - **-EINTR**:
+         * Interrupted while waiting for the mmap write lock.
+      - **-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 +64,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,20 +134,19 @@ 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.
 
   If supported by an architecture (CONFIG_ARCH_SUPPORTS_MSEAL_SYSTEM_MAPPINGS),
-  the CONFIG_MSEAL_SYSTEM_MAPPINGS seals all system mappings of this
-  architecture.
+  CONFIG_MSEAL_SYSTEM_MAPPINGS seals mappings marked with VM_SEALED_SYSMAP.
 
   The following architectures currently support this feature: x86-64, arm64,
-  loongarch and s390.
+  loongarch, riscv, and s390.
 
   WARNING: This feature breaks programs which rely on relocating
   or unmapping system mappings. Known broken software at the time
init/Kconfig +1 -1
index 5230d4879b1c..12bb39f637b1 100644
@@ -2112,7 +2112,7 @@ config ARCH_SUPPORTS_MSEAL_SYSTEM_MAPPINGS
 	  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
mm/mseal.c +2 -2
index 9781647483d1..0464c7b94ab9 100644
@@ -132,8 +132,8 @@ static int mseal_apply(struct mm_struct *mm,
  *   addr is not a valid address (not allocated).
  *   end (start + len) is not a valid address.
  *   a gap (unallocated memory) between start and end.
- *  -EPERM:
- *  - In 32 bit architecture, sealing is not supported.
+ *  -EINTR:
+ *   interrupted while waiting for the mmap write lock.
  * Note:
  *  user can call mseal(2) multiple times, adding a seal on an
  *  already sealed memory is a no-action (no error).
Signature · 1 line
2.54.0
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Leon Hwang

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.

Document the -EINTR return from mmap_write_lock_killable(), fix the CONFIG_MSEAL_SYSTEM_MAPPINGS typo, and describe system mappings in terms of VM_SEALED_SYSMAP.

---

Thanks, free free to add:

#2 lore raw
In reply to Leon Hwang

On Fri, Jul 03, 2026 at 10:25:07AM +0800, Leon Hwang wrote:
(...)

Documentation/userspace-api/mseal.rst Use cases · line 149

Quoted 3 lines

The following architectures currently support this feature: x86-64, arm64,

Documentation/userspace-api/mseal.rst +1 -1
-  loongarch and s390.
+  loongarch, riscv, and s390.

For per-architecture feature documentation we also have Documentation/features/. Maybe move it there.

Quoted 3 lines

WARNING: This feature breaks programs which rely on relocating or unmapping system mappings. Known broken software at the time

(...)

author
#3 lore raw
Quoted 9 lines · Thomas Weißschuh

On Fri, Jul 03, 2026 at 10:25:07AM +0800, Leon Hwang wrote:
(...)

Documentation/userspace-api/mseal.rst Use cases · line 149

Quoted 3 lines

The following architectures currently support this feature: x86-64, arm64,

Documentation/userspace-api/mseal.rst +1 -1
-  loongarch and s390.
+  loongarch, riscv, and s390.

For per-architecture feature documentation we also have Documentation/features/. Maybe move it there.

Better to replace with a reference to the feature doc?

+ Refer to :doc:features/core/mseal_sys_mappings/arch-support for the
+ support status of each architecture.

Thanks,
Leon

Quoted 6 lines
Quoted 4 lines

WARNING: This feature breaks programs which rely on relocating or unmapping system mappings. Known broken software at the time

(...)

#4 lore raw
Quoted 13 lines · Leon Hwang
Quoted 9 lines · Thomas Weißschuh

On Fri, Jul 03, 2026 at 10:25:07AM +0800, Leon Hwang wrote:
(...)

Documentation/userspace-api/mseal.rst Use cases · line 149

Quoted 3 lines

The following architectures currently support this feature: x86-64, arm64,

Documentation/userspace-api/mseal.rst +1 -1
-  loongarch and s390.
+  loongarch, riscv, and s390.

For per-architecture feature documentation we also have Documentation/features/. Maybe move it there.

Better to replace with a reference to the feature doc?

Review

Quoted 2 lines
(quoted diff) +2 -0
+  Refer to :doc:`features/core/mseal_sys_mappings/arch-support` for the
+  support status of each architecture.

It should automatically show up here:
https://www.kernel.org/doc/html/latest/admin-guide/features.html

See also Documentation/sphinx/kernel_feat.py

So I don't think an explicit link is necessary.
But the maintainers might disagree.
In my opinion the link should then go to the rendered table entry.

Thomas

author
#5 lore raw
Quoted 17 lines · Thomas Weißschuh
Quoted 13 lines · Leon Hwang
Quoted 9 lines · Thomas Weißschuh

On Fri, Jul 03, 2026 at 10:25:07AM +0800, Leon Hwang wrote:
(...)

Documentation/userspace-api/mseal.rst Use cases · line 149

Quoted 3 lines

The following architectures currently support this feature: x86-64, arm64,

Documentation/userspace-api/mseal.rst +1 -1
-  loongarch and s390.
+  loongarch, riscv, and s390.

For per-architecture feature documentation we also have Documentation/features/. Maybe move it there.

Better to replace with a reference to the feature doc?

Review

Quoted 2 lines
(quoted diff) +2 -0
+  Refer to :doc:`features/core/mseal_sys_mappings/arch-support` for the
+  support status of each architecture.
Quoted 9 lines

It should automatically show up here:
https://www.kernel.org/doc/html/latest/admin-guide/features.html

See also Documentation/sphinx/kernel_feat.py

So I don't think an explicit link is necessary.
But the maintainers might disagree.
In my opinion the link should then go to the rendered table entry.

Let us drop the sentence following Pedro's suggestion.

Thanks,
Leon

reviewer
#6 lore raw
In reply to Leon Hwang
Quoted 21 lines · Leon Hwang

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.

Document the -EINTR return from mmap_write_lock_killable(), fix the CONFIG_MSEAL_SYSTEM_MAPPINGS typo, and describe system mappings in terms of VM_SEALED_SYSMAP.

---
 Documentation/userspace-api/mseal.rst | 18 ++++++++++--------
 init/Kconfig                          |  2 +-
 mm/mseal.c                            |  4 ++--
 3 files changed, 13 insertions(+), 11 deletions(-)
Documentation/userspace-api/mseal.rst +0 -0
index ea9b11a0bd89..1f1cf206670c 100644
@@ -50,8 +50,10 @@ mseal syscall signature
          * The start address (``addr``) is not allocated.
          * The end address (``addr`` + ``len``) is not allocated.

Documentation/userspace-api/mseal.rst mseal syscall signature · line 59

Quoted 10 lines
Documentation/userspace-api/mseal.rst +4 -2
          * A gap (unallocated memory) between start and end address.
-      - **-EPERM**:
-         * sealing is supported only on 64-bit CPUs, 32-bit is not supported.
+      - **-EINTR**:
+         * Interrupted while waiting for the mmap write lock.
+      - **-ENOSYS**:
+         * The kernel does not implement ``mseal()``.
 
    **Note about error return**:
       - For above error cases, users can expect the given memory range is

Honestly, this whole thing needs to be deleted. We need a proper manpage.

Documentation/userspace-api/mseal.rst mseal syscall signature · line 68

Quoted 7 lines
Documentation/userspace-api/mseal.rst +2 -1
@@ -62,7 +64,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``.

This LGTM.

Quoted 6 lines
Documentation/userspace-api/mseal.rst +0 -0
    **Idempotent**:
       users can call mseal multiple times. mseal on an already sealed memory
@@ -131,20 +134,19 @@ Use cases
 - Chrome browser: protect some security sensitive data structures.
 

Documentation/userspace-api/mseal.rst Use cases · line 143

Quoted 10 lines
Documentation/userspace-api/mseal.rst +2 -2
 - 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.

Also LGTM.

Documentation/userspace-api/mseal.rst Use cases · line 146

Quoted 5 lines
Documentation/userspace-api/mseal.rst +1 -2
   If supported by an architecture (CONFIG_ARCH_SUPPORTS_MSEAL_SYSTEM_MAPPINGS),
-  the CONFIG_MSEAL_SYSTEM_MAPPINGS seals all system mappings of this
-  architecture.
+  CONFIG_MSEAL_SYSTEM_MAPPINGS seals mappings marked with VM_SEALED_SYSMAP.

VM_SEALED_SYSMAP isn't meaningful to userspace.

Documentation/userspace-api/mseal.rst Use cases · line 149

Quoted 4 lines
Documentation/userspace-api/mseal.rst +1 -1
   The following architectures currently support this feature: x86-64, arm64,
-  loongarch and s390.
+  loongarch, riscv, and s390.

This is also useless, every 64-bit architecture will support this.

Quoted 21 lines
Documentation/userspace-api/mseal.rst +0 -0
   WARNING: This feature breaks programs which rely on relocating
   or unmapping system mappings. Known broken software at the time
init/Kconfig +1 -1
index 5230d4879b1c..12bb39f637b1 100644
@@ -2112,7 +2112,7 @@ config ARCH_SUPPORTS_MSEAL_SYSTEM_MAPPINGS
 	  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
mm/mseal.c +0 -0
index 9781647483d1..0464c7b94ab9 100644

mm/mseal.c static int mseal_apply(struct mm_struct *mm, · line 139

Quoted 10 lines
mm/mseal.c +2 -2
@@ -132,8 +132,8 @@ static int mseal_apply(struct mm_struct *mm,
  *   addr is not a valid address (not allocated).
  *   end (start + len) is not a valid address.
  *   a gap (unallocated memory) between start and end.
- *  -EPERM:
- *  - In 32 bit architecture, sealing is not supported.
+ *  -EINTR:
+ *   interrupted while waiting for the mmap write lock.
  * Note:
  *  user can call mseal(2) multiple times, adding a seal on an
  *  already sealed memory is a no-action (no error).

And this whole header needs to be deleted as well. No one's looking at kernel code for documentation (and if they are, we did a horrendous job at actually documenting the thing).

Signature · 1 line
Pedro
author
#7 lore raw
Quoted 30 lines · Pedro Falcato
Quoted 29 lines · Leon Hwang

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.

Document the -EINTR return from mmap_write_lock_killable(), fix the CONFIG_MSEAL_SYSTEM_MAPPINGS typo, and describe system mappings in terms of VM_SEALED_SYSMAP.

---
 Documentation/userspace-api/mseal.rst | 18 ++++++++++--------
 init/Kconfig                          |  2 +-
 mm/mseal.c                            |  4 ++--
 3 files changed, 13 insertions(+), 11 deletions(-)
Documentation/userspace-api/mseal.rst +4 -2
index ea9b11a0bd89..1f1cf206670c 100644
@@ -50,8 +50,10 @@ 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.
+      - **-EINTR**:
+         * Interrupted while waiting for the mmap write lock.
+      - **-ENOSYS**:
+         * The kernel does not implement ``mseal()``.
 
Quoted 4 lines

Documentation/userspace-api/mseal.rst mseal syscall signature · line 59

Quoted 2 lines
Documentation/userspace-api/mseal.rst +0 -0
    **Note about error return**:
       - For above error cases, users can expect the given memory range is

Honestly, this whole thing needs to be deleted. We need a proper manpage.

$ man mseal
No manual entry for mseal

When searching "mseal manual" using Google, this doc is the first entry.

So, this change is worthy.

Quoted 31 lines

Documentation/userspace-api/mseal.rst mseal syscall signature · line 68

Quoted 8 lines
Documentation/userspace-api/mseal.rst +2 -1
@@ -62,7 +64,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``.

This LGTM.

Quoted 6 lines
Documentation/userspace-api/mseal.rst +0 -0
    **Idempotent**:
       users can call mseal multiple times. mseal on an already sealed memory
@@ -131,20 +134,19 @@ Use cases
 - Chrome browser: protect some security sensitive data structures.
 

Documentation/userspace-api/mseal.rst Use cases · line 143

Quoted 10 lines
Documentation/userspace-api/mseal.rst +2 -2
 - 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.

Also LGTM.

Quoted 1 line
Quoted 6 lines

Documentation/userspace-api/mseal.rst Use cases · line 146

Quoted 4 lines

If supported by an architecture (CONFIG_ARCH_SUPPORTS_MSEAL_SYSTEM_MAPPINGS),

Documentation/userspace-api/mseal.rst +1 -2
-  the CONFIG_MSEAL_SYSTEM_MAPPINGS seals all system mappings of this
-  architecture.
+  CONFIG_MSEAL_SYSTEM_MAPPINGS seals mappings marked with VM_SEALED_SYSMAP.

VM_SEALED_SYSMAP isn't meaningful to userspace.

Got it. Will drop this change.

Quoted 7 lines

Documentation/userspace-api/mseal.rst Use cases · line 149

Quoted 5 lines

The following architectures currently support this feature: x86-64, arm64,

Documentation/userspace-api/mseal.rst +1 -1
-  loongarch and s390.
+  loongarch, riscv, and s390.

This is also useless, every 64-bit architecture will support this.

Do you mean dropping this sentence, or this change?

Quoted 28 lines
Quoted 28 lines

WARNING: This feature breaks programs which rely on relocating or unmapping system mappings. Known broken software at the time

init/Kconfig +1 -1
index 5230d4879b1c..12bb39f637b1 100644
@@ -2112,7 +2112,7 @@ config ARCH_SUPPORTS_MSEAL_SYSTEM_MAPPINGS
 	  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
mm/mseal.c +1 -2
index 9781647483d1..0464c7b94ab9 100644
@@ -132,8 +132,8 @@ static int mseal_apply(struct mm_struct *mm,
  *   addr is not a valid address (not allocated).
  *   end (start + len) is not a valid address.
  *   a gap (unallocated memory) between start and end.
- *  -EPERM:
- *  - In 32 bit architecture, sealing is not supported.
+ *  -EINTR:
Quoted 9 lines

mm/mseal.c static int mseal_apply(struct mm_struct *mm, · line 139

Quoted 4 lines
mm/mseal.c +1 -0
+ *   interrupted while waiting for the mmap write lock.
  * Note:
  *  user can call mseal(2) multiple times, adding a seal on an
  *  already sealed memory is a no-action (no error).

And this whole header needs to be deleted as well. No one's looking at kernel code for documentation (and if they are, we did a horrendous job at actually documenting the thing).

Just to confirm, do you mean removing the entire function comment above do_mseal()?

Thanks,
Leon

reviewer
#8 lore raw
Quoted 36 lines · Leon Hwang
Quoted 30 lines · Pedro Falcato
Quoted 29 lines · Leon Hwang

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.

Document the -EINTR return from mmap_write_lock_killable(), fix the CONFIG_MSEAL_SYSTEM_MAPPINGS typo, and describe system mappings in terms of VM_SEALED_SYSMAP.

---
 Documentation/userspace-api/mseal.rst | 18 ++++++++++--------
 init/Kconfig                          |  2 +-
 mm/mseal.c                            |  4 ++--
 3 files changed, 13 insertions(+), 11 deletions(-)
Documentation/userspace-api/mseal.rst +4 -2
index ea9b11a0bd89..1f1cf206670c 100644
@@ -50,8 +50,10 @@ 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.
+      - **-EINTR**:
+         * Interrupted while waiting for the mmap write lock.
+      - **-ENOSYS**:
+         * The kernel does not implement ``mseal()``.
 
Quoted 4 lines

Documentation/userspace-api/mseal.rst mseal syscall signature · line 59

Quoted 2 lines
Documentation/userspace-api/mseal.rst +0 -0
    **Note about error return**:
       - For above error cases, users can expect the given memory range is

Honestly, this whole thing needs to be deleted. We need a proper manpage.

Quoted 6 lines
$ man mseal
No manual entry for mseal

When searching "mseal manual" using Google, this doc is the first entry.

So, this change is worthy.

Yes, I agree. To be clear, my main gripe is with the current state of things, not your patch.

Quoted 44 lines
Quoted 32 lines

Documentation/userspace-api/mseal.rst mseal syscall signature · line 68

Quoted 9 lines
Documentation/userspace-api/mseal.rst +2 -1
@@ -62,7 +64,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``.

This LGTM.

Quoted 6 lines
Documentation/userspace-api/mseal.rst +0 -0
    **Idempotent**:
       users can call mseal multiple times. mseal on an already sealed memory
@@ -131,20 +134,19 @@ Use cases
 - Chrome browser: protect some security sensitive data structures.
 

Documentation/userspace-api/mseal.rst Use cases · line 143

Quoted 10 lines
Documentation/userspace-api/mseal.rst +2 -2
 - 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.

Also LGTM.

Quoted 1 line
Quoted 6 lines

Documentation/userspace-api/mseal.rst Use cases · line 146

Quoted 4 lines

If supported by an architecture (CONFIG_ARCH_SUPPORTS_MSEAL_SYSTEM_MAPPINGS),

Documentation/userspace-api/mseal.rst +1 -2
-  the CONFIG_MSEAL_SYSTEM_MAPPINGS seals all system mappings of this
-  architecture.
+  CONFIG_MSEAL_SYSTEM_MAPPINGS seals mappings marked with VM_SEALED_SYSMAP.

VM_SEALED_SYSMAP isn't meaningful to userspace.

Got it. Will drop this change.

Quoted 2 lines
Quoted 2 lines
Quoted 8 lines
Quoted 5 lines

Documentation/userspace-api/mseal.rst Use cases · line 149

Quoted 3 lines

The following architectures currently support this feature: x86-64, arm64,

Documentation/userspace-api/mseal.rst +1 -1
-  loongarch and s390.
+  loongarch, riscv, and s390.

This is also useless, every 64-bit architecture will support this.

Do you mean dropping this sentence, or this change?

This sentence (this is not architecture specific...).

Quoted 39 lines
Quoted 29 lines
Quoted 29 lines

WARNING: This feature breaks programs which rely on relocating or unmapping system mappings. Known broken software at the time

init/Kconfig +1 -1
index 5230d4879b1c..12bb39f637b1 100644
@@ -2112,7 +2112,7 @@ config ARCH_SUPPORTS_MSEAL_SYSTEM_MAPPINGS
 	  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
mm/mseal.c +1 -2
index 9781647483d1..0464c7b94ab9 100644
@@ -132,8 +132,8 @@ static int mseal_apply(struct mm_struct *mm,
  *   addr is not a valid address (not allocated).
  *   end (start + len) is not a valid address.
  *   a gap (unallocated memory) between start and end.
- *  -EPERM:
- *  - In 32 bit architecture, sealing is not supported.
+ *  -EINTR:
Quoted 9 lines

mm/mseal.c static int mseal_apply(struct mm_struct *mm, · line 139

Quoted 4 lines
mm/mseal.c +1 -0
+ *   interrupted while waiting for the mmap write lock.
  * Note:
  *  user can call mseal(2) multiple times, adding a seal on an
  *  already sealed memory is a no-action (no error).

And this whole header needs to be deleted as well. No one's looking at kernel code for documentation (and if they are, we did a horrendous job at actually documenting the thing).

Quoted 2 lines

Just to confirm, do you mean removing the entire function comment above do_mseal()?

Yes. Again, not your fault, just old gripes :)

Signature · 1 line
Pedro
author
#9 lore raw
Quoted 2 lines · Pedro Falcato
Quoted 1 line · Leon Hwang

On 2026/7/3 17:44, Pedro Falcato wrote:

[...]

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

The following architectures currently support this feature: x86-64, arm64,

Documentation/userspace-api/mseal.rst +1 -1
-  loongarch and s390.
+  loongarch, riscv, and s390.
Quoted 6 lines
Quoted 4 lines
Quoted 1 line

This is also useless, every 64-bit architecture will support this.

Do you mean dropping this sentence, or this change?

This sentence (this is not architecture specific...).

Got it.

Quoted 40 lines
Quoted 40 lines
Quoted 39 lines
Quoted 24 lines

WARNING: This feature breaks programs which rely on relocating or unmapping system mappings. Known broken software at the time

init/Kconfig +1 -1
index 5230d4879b1c..12bb39f637b1 100644
@@ -2112,7 +2112,7 @@ config ARCH_SUPPORTS_MSEAL_SYSTEM_MAPPINGS
 	  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
mm/mseal.c +0 -0
index 9781647483d1..0464c7b94ab9 100644

mm/mseal.c static int mseal_apply(struct mm_struct *mm, · line 139

Quoted 10 lines
mm/mseal.c +2 -2
@@ -132,8 +132,8 @@ static int mseal_apply(struct mm_struct *mm,
  *   addr is not a valid address (not allocated).
  *   end (start + len) is not a valid address.
  *   a gap (unallocated memory) between start and end.
- *  -EPERM:
- *  - In 32 bit architecture, sealing is not supported.
+ *  -EINTR:
+ *   interrupted while waiting for the mmap write lock.
  * Note:
  *  user can call mseal(2) multiple times, adding a seal on an
  *  already sealed memory is a no-action (no error).

And this whole header needs to be deleted as well. No one's looking at kernel code for documentation (and if they are, we did a horrendous job at actually documenting the thing).

Quoted 5 lines
Quoted 2 lines

Just to confirm, do you mean removing the entire function comment above do_mseal()?

Yes. Again, not your fault, just old gripes :)

Got it.

Thanks,
Leon

#10 lore raw
In reply to Leon Hwang
Quoted 1 line · Leon Hwang

Document the -EINTR return from mmap_write_lock_killable(), fix the

No, you don't understand the whole concept of "killable". If a task receives a fatal signal, it dies before it returns to userspace. So userspace never gets to see the -EINTR. It's fine to document inside the kernel that function foo() can return -EINTR, but it's pointless to document it for userspace.

This is how "killable" differs from "interruptible". Interruptible allows non-fatal signals to wake a task, and then the task can see the -EINTR. But many processes do not check the error code, and so read() and write() (despite being documented as being able to return EINTR!) do not do so in practise.

author
#11 lore raw
Quoted 9 lines · Matthew Wilcox
Quoted 1 line · Leon Hwang

Document the -EINTR return from mmap_write_lock_killable(), fix the

No, you don't understand the whole concept of "killable". If a task receives a fatal signal, it dies before it returns to userspace. So userspace never gets to see the -EINTR. It's fine to document inside the kernel that function foo() can return -EINTR, but it's pointless to document it for userspace.

Quoted 5 lines

This is how "killable" differs from "interruptible". Interruptible allows non-fatal signals to wake a task, and then the task can see the -EINTR. But many processes do not check the error code, and so read() and write() (despite being documented as being able to return EINTR!) do not do so in practise.

Thanks for your explanation.

Will drop the -EINTR documentation change from mseal.rst.

Thanks,
Leon