Linux kernel source tree
Go to file
Joel Fernandes (Google) dec031f640 UPSTREAM: mm/memfd: Add an F_SEAL_FUTURE_WRITE seal to memfd
Android uses ashmem for sharing memory regions.  We are looking forward to
migrating all usecases of ashmem to memfd so that we can possibly remove
the ashmem driver in the future from staging while also benefiting from
using memfd and contributing to it.  Note staging drivers are also not ABI
and generally can be removed at anytime.

One of the main usecases Android has is the ability to create a region and
mmap it as writeable, then add protection against making any "future"
writes while keeping the existing already mmap'ed writeable-region active.
This allows us to implement a usecase where receivers of the shared
memory buffer can get a read-only view, while the sender continues to
write to the buffer.  See CursorWindow documentation in Android for more
details:
https://developer.android.com/reference/android/database/CursorWindow

This usecase cannot be implemented with the existing F_SEAL_WRITE seal.
To support the usecase, this patch adds a new F_SEAL_FUTURE_WRITE seal
which prevents any future mmap and write syscalls from succeeding while
keeping the existing mmap active.

A better way to do F_SEAL_FUTURE_WRITE seal was discussed [1] last week
where we don't need to modify core VFS structures to get the same
behavior of the seal. This solves several side-effects pointed by Andy.
self-tests are provided in later patch to verify the expected semantics.

[1] https://lore.kernel.org/lkml/20181111173650.GA256781@google.com/

[Thanks a lot to Andy for suggestions to improve code]
Cc: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Acked-by: John Stultz <john.stultz@linaro.org>

Change-Id: I6710c045954378f87bfbff6311d372a3b8549064
2019-01-16 09:48:42 -05:00
arch ANDROID: cuttlefish: enable CONFIG_NET_CLS_BPF=y 2019-01-16 00:44:13 +00:00
block block: mq-deadline: Fix write completion handling 2019-01-13 09:51:07 +01:00
certs export.h: remove VMLINUX_SYMBOL() and VMLINUX_SYMBOL_STR() 2018-08-22 23:21:44 +09:00
crypto This is the 4.19.14 stable release 2019-01-09 18:55:03 +01:00
Documentation Merge upstream-f2fs-stable-linux-4.19.y into android-4.19 2019-01-10 14:44:56 -08:00
drivers This is the 4.19.15 stable release 2019-01-13 10:25:45 +01:00
firmware kbuild: remove all dummy assignments to obj- 2017-11-18 11:46:06 +09:00
fs UPSTREAM: mm/memfd: Add an F_SEAL_FUTURE_WRITE seal to memfd 2019-01-16 09:48:42 -05:00
include UPSTREAM: mm/memfd: Add an F_SEAL_FUTURE_WRITE seal to memfd 2019-01-16 09:48:42 -05:00
init This is the 4.19.11 stable release 2018-12-19 19:30:07 +01:00
ipc ANDROID: vfs: Add permission2 for filesystems with per mount permissions 2018-12-05 09:48:14 -08:00
kernel This is the 4.19.15 stable release 2019-01-13 10:25:45 +01:00
lib This is the 4.19.15 stable release 2019-01-13 10:25:45 +01:00
LICENSES LICENSES: Remove CC-BY-SA-4.0 license text 2018-10-18 11:28:50 +02:00
mm UPSTREAM: mm/memfd: Add an F_SEAL_FUTURE_WRITE seal to memfd 2019-01-16 09:48:42 -05:00
net This is the 4.19.15 stable release 2019-01-13 10:25:45 +01:00
samples samples: disable CONFIG_SAMPLES for UML 2018-10-11 02:15:46 +09:00
scripts This is the 4.19.15 stable release 2019-01-13 10:25:45 +01:00
security This is the 4.19.15 stable release 2019-01-13 10:25:45 +01:00
sound ALSA: usb-audio: Always check descriptor sizes in parser code 2019-01-13 09:51:06 +01:00
tools mm, devm_memremap_pages: fix shutdown handling 2019-01-13 09:51:04 +01:00
usr initramfs: move gen_initramfs_list.sh from scripts/ to usr/ 2018-08-22 23:21:44 +09:00
virt KVM: arm/arm64: vgic: Fix off-by-one bug in vgic_get_irq() 2019-01-09 17:38:49 +01:00
.clang-format clang-format: Set IndentWrappedFunctionNames false 2018-08-01 18:38:51 +02:00
.cocciconfig
.get_maintainer.ignore
.gitattributes .gitattributes: set git diff driver for C source code files 2016-10-07 18:46:30 -07:00
.gitignore Kbuild updates for v4.17 (2nd) 2018-04-15 17:21:30 -07:00
.mailmap libnvdimm-for-4.19_misc 2018-08-25 18:13:10 -07:00
build.config.cuttlefish.aarch64 ANDROID: Move from clang r328903 to r346389b. 2018-12-07 11:52:07 -08:00
build.config.cuttlefish.x86_64 ANDROID: Move from clang r328903 to r346389b. 2018-12-07 11:52:07 -08:00
COPYING COPYING: use the new text with points to the license files 2018-03-23 12:41:45 -06:00
CREDITS 9p: remove Ron Minnich from MAINTAINERS 2018-08-17 16:20:26 -07:00
Kbuild Kbuild updates for v4.15 2017-11-17 17:45:29 -08:00
Kconfig kconfig: move the "Executable file formats" menu to fs/Kconfig.binfmt 2018-08-02 08:06:55 +09:00
MAINTAINERS MAINTAINERS: Add Sasha as a stable branch maintainer 2018-12-01 09:37:25 +01:00
Makefile Makefile: Fix 4.19.15 resolution 2019-01-14 18:34:54 -07:00
README Docs: Added a pointer to the formatted docs to README 2018-03-21 09:02:53 -06:00

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.
See Documentation/00-INDEX for a list of what is contained in each file.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.