mirror of
https://github.com/torvalds/linux.git
synced 2026-11-30 02:23:05 +00:00
When MFD_NOEXEC_SEAL was introduced, there was one big mistake: it didn't have proper documentation. This led to a lot of confusion, especially about whether or not memfd created with the MFD_NOEXEC_SEAL flag is sealable. Before MFD_NOEXEC_SEAL, memfd had to explicitly set MFD_ALLOW_SEALING to be sealable, so it's a fair question. As one might have noticed, unlike other flags in memfd_create, MFD_NOEXEC_SEAL is actually a combination of multiple flags. The idea is to make it easier to use memfd in the most common way, which is NOEXEC + F_SEAL_EXEC + MFD_ALLOW_SEALING. This works with sysctl vm.noexec to help existing applications move to a more secure way of using memfd. Proposals have been made to put MFD_NOEXEC_SEAL non-sealable, unless MFD_ALLOW_SEALING is set, to be consistent with other flags [1], Those are based on the viewpoint that each flag is an atomic unit, which is a reasonable assumption. However, MFD_NOEXEC_SEAL was designed with the intent of promoting the most secure method of using memfd, therefore a combination of multiple functionalities into one bit. Furthermore, the MFD_NOEXEC_SEAL has been added for more than one year, and multiple applications and distributions have backported and utilized it. Altering ABI now presents a degree of risk and may lead to disruption. MFD_NOEXEC_SEAL is a new flag, and applications must change their code to use it. There is no backward compatibility problem. When sysctl vm.noexec == 1 or 2, applications that don't set MFD_NOEXEC_SEAL or MFD_EXEC will get MFD_NOEXEC_SEAL memfd. And old-application might break, that is by-design, in such a system vm.noexec = 0 shall be used. Also no backward compatibility problem. I propose to include this documentation patch to assist in clarifying the semantics of MFD_NOEXEC_SEAL, thereby preventing any potential future confusion. Finally, I would like to express my gratitude to David Rheinsberg and Barnabás Pőcze for initiating the discussion on the topic of sealability. [1] https://lore.kernel.org/lkml/[email protected]/ [[email protected]: updates per Randy] Link: https://lkml.kernel.org/r/[email protected] [[email protected]: v3] Link: https://lkml.kernel.org/r/[email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Jeff Xu <[email protected]> Reviewed-by: Randy Dunlap <[email protected]> Cc: Aleksa Sarai <[email protected]> Cc: Barnabás Pőcze <[email protected]> Cc: Daniel Verkamp <[email protected]> Cc: David Rheinsberg <[email protected]> Cc: Dmitry Torokhov <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: Jorge Lucangeli Obes <[email protected]> Cc: Kees Cook <[email protected]> Cc: Shuah Khan <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
74 lines
1.1 KiB
ReStructuredText
74 lines
1.1 KiB
ReStructuredText
=====================================
|
|
The Linux kernel user-space API guide
|
|
=====================================
|
|
|
|
.. _man-pages: https://www.kernel.org/doc/man-pages/
|
|
|
|
While much of the kernel's user-space API is documented elsewhere
|
|
(particularly in the man-pages_ project), some user-space information can
|
|
also be found in the kernel tree itself. This manual is intended to be the
|
|
place where this information is gathered.
|
|
|
|
|
|
System calls
|
|
============
|
|
|
|
.. toctree::
|
|
:maxdepth: 1
|
|
|
|
unshare
|
|
futex2
|
|
ebpf/index
|
|
ioctl/index
|
|
mseal
|
|
|
|
Security-related interfaces
|
|
===========================
|
|
|
|
.. toctree::
|
|
:maxdepth: 1
|
|
|
|
no_new_privs
|
|
seccomp_filter
|
|
landlock
|
|
lsm
|
|
mfd_noexec
|
|
spec_ctrl
|
|
tee
|
|
|
|
Devices and I/O
|
|
===============
|
|
|
|
.. toctree::
|
|
:maxdepth: 1
|
|
|
|
accelerators/ocxl
|
|
dma-buf-alloc-exchange
|
|
gpio/index
|
|
iommu
|
|
iommufd
|
|
media/index
|
|
dcdbas
|
|
vduse
|
|
isapnp
|
|
|
|
Everything else
|
|
===============
|
|
|
|
.. toctree::
|
|
:maxdepth: 1
|
|
|
|
ELF
|
|
netlink/index
|
|
sysfs-platform_profile
|
|
vduse
|
|
futex2
|
|
perf_ring_buffer
|
|
|
|
.. only:: subproject and html
|
|
|
|
Indices
|
|
=======
|
|
|
|
* :ref:`genindex`
|