android_kernel_google_msm/include
Joel Fernandes 52193857e2 BACKPORT: mm: 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.

Verified with test program at: https://lore.kernel.org/patchwork/patch/1008117/
Backport link: https://lore.kernel.org/patchwork/patch/1014892/
Bug: 113362644
Change-Id: If7424db3b64372932d455f0219cd9df613fec1d4
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Joel Fernandes <joelaf@google.com>
2020-12-14 17:10:31 +01:00
..
acpi
asm-generic net: introduce SO_MAX_PACING_RATE 2020-11-30 19:31:32 +03:00
crypto Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
drm Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
keys
linux BACKPORT: mm: Add an F_SEAL_FUTURE_WRITE seal to memfd 2020-12-14 17:10:31 +01:00
math-emu
media msm: vidc: Add support for Picture Order Count Type 2018-08-27 14:52:37 +00:00
misc
mtd
net Include uidgid.h in same header files as in newer kernels 2020-12-07 20:55:11 +03:00
pcmcia
rdma
rxrpc
scsi
sound ASoC: msm: flush if prior and current backends rate not matching 2018-08-27 14:52:45 +00:00
target Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
trace Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
uapi/linux shm: add memfd_create() syscall 2020-10-25 02:37:54 -04:00
video remove compilation error by changing int to uint32_t 2018-08-27 14:52:44 +00:00
xen
Kbuild Revert "shm: add memfd.h to export list" 2020-12-12 13:05:55 +03:00