linux/include
Lorenzo Stoakes (ARM) 4c1c2d2418 mm/mseal: limit scope of mseal address zero to address zero
Commit 44f65d9006 ("binfmt_elf: mseal address zero") unconditionally
provided do_mseal() to any internal kernel caller in order to address a
corner case slated for possible removal.

It also incorrectly attempts to mseal without checking to see whether the
mapping even succeeded.

Restrict the scope to the corner case by providing mseal_mmap_page_zero()
which asserts the MMAP_PAGE_ZERO personality.

Avoid unnecessary checks in the start, end range by abstracting the actual
mseal()'ing to mseal_range() and have mseal_mmap_page_zero() call that
instead.

Also only try to seal the VMA if we mapped the VMA.  This isn't strictly
necessary as the operation would error out anyway, but it's useless work
and could be problematic if me make future changes to mseal semantics.

Link: https://lore.kernel.org/20260717-mseal-fixups-v2-2-0daa0014b813@kernel.org
Signed-off-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Jan Kara <jack@suse.cz>
Cc: Jann Horn <jannh@google.com>
Cc: Kees Cook <kees@kernel.org>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Pedro Falcato <pfalcato@suse.de>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2026-08-06 18:57:12 -07:00
..
acpi ACPICA: Define acpi_ut_safe_strncpy() as strscpy_pad() alias 2026-07-01 12:29:24 +02:00
asm-generic mm: rename uffd-wp PTE accessors to uffd 2026-08-04 19:18:36 -07:00
clocksource
crypto Networking changes for 7.2. 2026-06-17 08:17:00 +01:00
cxl cxl/region: Introduce devm_cxl_probe_mem() 2026-06-12 13:47:30 -07:00
drm drm-misc-fixes for v7.2-rc5: 2026-07-24 18:30:29 +10:00
dt-bindings SoC fixes for 7.2 2026-07-17 08:52:09 -07:00
hyperv
keys keys: Pin request_key_auth payload in instantiate paths 2026-06-15 15:19:13 +03:00
kunit linux_kselftest-kunit-7.2-rc1 2026-06-16 16:33:57 +05:30
kvm Merge branch kvm-arm64/vgic-v5-PPI-fixes into kvmarm-master/next 2026-06-12 09:08:31 +01:00
linux mm/mseal: limit scope of mseal address zero to address zero 2026-08-06 18:57:12 -07:00
math-emu
media media: v4l2-fwnode: Fix subdev owner overwritten in v4l2_async_register_subdev_sensor() 2026-06-05 10:28:03 +03:00
memory
misc
net tcp: challenge ACK for non-exact RST in SYN-RECEIVED 2026-07-23 08:27:22 -07:00
pcmcia Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (headers) 2026-07-03 07:38:16 +02:00
ras
rdma RDMA v7.2 merge window 2026-06-18 08:16:21 -07:00
rv rv: Prevent task migration while handling per-CPU events 2026-06-03 12:33:25 +02:00
scsi scsi: core: wake eh reliably when using scsi_schedule_eh 2026-07-12 22:21:22 -04:00
soc soc/tegra: pmc: Fixes for v7.2 2026-07-10 14:40:52 +02:00
sound Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (headers) 2026-07-03 07:38:16 +02:00
target
trace mm: add VM_UFFD_RWP VMA flag 2026-08-04 19:18:37 -07:00
uapi userfaultfd: add UFFDIO_SET_MODE for runtime sync/async toggle 2026-08-04 19:18:39 -07:00
ufs Merge branch 7.1/scsi-fixes into 7.2/scsi-staging 2026-06-15 21:01:30 -04:00
vdso futex: Provide infrastructure to plug the non contended robust futex unlock race 2026-06-03 11:38:52 +02:00
video
xen xen: Replace __ASSEMBLY__ with __ASSEMBLER__ in header files 2026-07-01 09:49:52 +02:00
Kbuild