android_kernel_sony_sdm845/mm
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Joel Fernandes a69b2773bd 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>
Signed-off-by: Sorayukii <sorayukii69@gmail.com>
2026-05-15 18:04:21 +07:00
..
kasan BACKPORT: rcu: Ports some of RCU's taken from k4.14 2026-05-15 17:49:30 +07:00
backing-dev.c Merge remote-tracking branch 'common/android-4.9-q' into lineage-18.1-caf-sdm845 2021-12-27 02:07:39 +02:00
balloon_compaction.c
bootmem.c treewide: Backport new vmalloc for large performance benefits 2026-05-15 17:48:25 +07:00
cleancache.c
cma.c mm/cma.c: export functions to be called from DLKM driver 2019-11-12 21:52:22 +05:30
cma.h
cma_debug.c Merge android-4.9.183 (a80a7ab) into msm-4.9 2019-08-07 16:30:28 +08:00
compaction.c BACKPORT: mm: fix pageblock heuristic 2020-06-30 02:48:34 +03:00
debug.c BACKPORT: mm/debug.c: provide useful debugging information for VM_BUG 2019-03-28 21:13:06 -07:00
debug_page_ref.c
dmapool.c
early_ioremap.c
fadvise.c
failslab.c
filemap.c Merge remote-tracking branch 'common/android-4.9-q' into android13-4.9-sdm845 2022-12-20 19:52:09 +02:00
frame_vector.c v4l2: don't fall back to follow_pfn() if pin_user_pages_fast() fails 2022-12-08 11:15:42 +01:00
frontswap.c
gup.c gup: document and work around "COW can break either way" issue 2022-01-27 08:47:42 +01:00
highmem.c treewide: Backport new vmalloc for large performance benefits 2026-05-15 17:48:25 +07:00
huge_memory.c treewide: Backport new vmalloc for large performance benefits 2026-05-15 17:48:25 +07:00
hugetlb.c UPSTREAM: mm: change return type to vm_fault_t 2026-05-15 17:57:57 +07:00
hugetlb_cgroup.c mm: hugetlb: switch to css_tryget() in hugetlb_cgroup_charge_cgroup() 2019-11-25 09:51:58 +01:00
hwpoison-inject.c
init-mm.c mm: introduce arg_lock to protect arg_start|end and env_start|end in mm_struct 2021-05-26 18:59:41 +03:00
internal.h BACKPORT: mm: fix pageblock heuristic 2020-06-30 02:48:34 +03:00
interval_tree.c
Kconfig
Kconfig.debug
khugepaged.c Merge branch 'android-4.9-q' of https://android.googlesource.com/kernel/common into lineage-20 2023-01-19 15:42:12 +01:00
kmemcheck.c BACKPORT: rcu: Ports some of RCU's taken from k4.14 2026-05-15 17:49:30 +07:00
kmemleak-test.c
kmemleak.c treewide: Backport new vmalloc for large performance benefits 2026-05-15 17:48:25 +07:00
ksm.c Merge branch 'android-4.9-q' of https://android.googlesource.com/kernel/common into lineage-18.1-caf-sdm845 2021-05-26 19:04:48 +03:00
list_lru.c mm/list_lru.c: fix memory leak in __memcg_init_list_lru_node 2019-06-22 08:17:18 +02:00
maccess.c UPSTREAM: uaccess: Add strict non-pagefault kernel-space read function 2026-05-15 17:59:04 +07:00
madvise.c UPSTREAM: mm,fork: introduce MADV_WIPEONFORK 2026-05-15 18:04:15 +07:00
Makefile
memblock.c treewide: Backport new vmalloc for large performance benefits 2026-05-15 17:48:25 +07:00
memcontrol.c UPSTREAM: cgroup: memcg: net: do not associate sock with unrelated cgroup 2026-05-15 17:57:44 +07:00
memory-failure.c Merge branch 'android-4.9-q' of https://android.googlesource.com/kernel/common into lineage-18.1-caf-sdm845 2021-07-22 02:11:11 +03:00
memory.c Merge branch 'android-4.9-q' of https://android.googlesource.com/kernel/common into lineage-20 2023-01-19 15:42:12 +01:00
memory_hotplug.c Merge branch 'android-4.9-q' of https://android.googlesource.com/kernel/common into lineage-17.1-caf-sdm845 2021-01-17 05:04:08 +02:00
mempolicy.c Merge remote-tracking branch 'common/android-4.9-q' into android12-4.9-sdm845 2022-09-06 06:20:26 +03:00
mempool.c
memtest.c
migrate.c Merge android-4.9.165 (72b54df) into msm-4.9 2019-05-21 17:01:55 +08:00
mincore.c mm/mincore.c: make mincore() more conservative 2019-05-21 18:48:58 +02:00
mlock.c Merge android-4.9.185 (70d52cb) into msm-4.9 2019-08-07 16:36:14 +08:00
mm_init.c treewide: Backport new vmalloc for large performance benefits 2026-05-15 17:48:25 +07:00
mmap.c UPSTREAM: mm: change return type to vm_fault_t 2026-05-15 17:57:57 +07:00
mmu_context.c
mmu_notifier.c BACKPORT: rcu: Ports some of RCU's taken from k4.14 2026-05-15 17:49:30 +07:00
mmzone.c
mprotect.c
mremap.c Merge remote-tracking branch 'common/android-4.9-q' into android12-4.9-sdm845 2022-06-12 01:39:01 +03:00
msync.c
nobootmem.c treewide: Backport new vmalloc for large performance benefits 2026-05-15 17:48:25 +07:00
nommu.c treewide: Backport new vmalloc for large performance benefits 2026-05-15 17:48:25 +07:00
oom_kill.c treewide: Backport new vmalloc for large performance benefits 2026-05-15 17:48:25 +07:00
page-writeback.c treewide: Backport new vmalloc for large performance benefits 2026-05-15 17:48:25 +07:00
page_alloc.c UPSTREAM: mm: combine LRU and main union in struct page 2026-05-15 17:57:58 +07:00
page_counter.c
page_ext.c Merge android-4.9.168 (286f971) into msm-4.9 2019-05-30 13:40:07 +08:00
page_idle.c mm/page_idle.c: fix oops because end_pfn is larger than max_pfn 2019-07-10 09:55:38 +02:00
page_io.c Merge branch 'android-4.9-q' of https://android.googlesource.com/kernel/common into lineage-18.1-caf-sdm845 2021-04-26 01:27:02 +03:00
page_isolation.c
page_owner.c
page_poison.c
pagewalk.c mm: pagewalk: fix termination condition in walk_pte_range() 2020-10-01 20:40:06 +02:00
percpu-km.c
percpu-vm.c
percpu.c percpu: stop printing kernel addresses 2019-04-27 09:34:47 +02:00
pgtable-generic.c
process_reclaim.c
process_vm_access.c
quicklist.c
readahead.c Merge android-4.9.155 (32e6695) into msm-4.9 2019-02-12 16:32:37 +08:00
rmap.c BACKPORT: rcu: Ports some of RCU's taken from k4.14 2026-05-15 17:49:30 +07:00
shmem.c BACKPORT: mm: Add an F_SEAL_FUTURE_WRITE seal to memfd 2026-05-15 18:04:21 +07:00
showmem.c
slab.c BACKPORT: rcu: Ports some of RCU's taken from k4.14 2026-05-15 17:49:30 +07:00
slab.h BACKPORT: rcu: Ports some of RCU's taken from k4.14 2026-05-15 17:49:30 +07:00
slab_common.c BACKPORT: rcu: Ports some of RCU's taken from k4.14 2026-05-15 17:49:30 +07:00
slob.c BACKPORT: rcu: Ports some of RCU's taken from k4.14 2026-05-15 17:49:30 +07:00
slub.c UPSTREAM: mm: move lru union within struct page 2026-05-15 17:57:58 +07:00
sparse-vmemmap.c
sparse.c
swap.c treewide: Backport new vmalloc for large performance benefits 2026-05-15 17:48:25 +07:00
swap_cgroup.c
swap_ratio.c
swap_state.c Merge branch 'android-4.9-q' of https://android.googlesource.com/kernel/common into lineage-17.1-caf-sdm845 2021-01-17 05:04:08 +02:00
swapfile.c Merge branch 'linux-4.9.y' of https://kernel.googlesource.com/pub/scm/linux/kernel/git/jaegeuk/f2fs-stable into lineage-20 2022-11-16 15:35:23 +01:00
truncate.c
usercopy.c This is the 4.9.197 stable release 2019-10-17 13:54:42 -07:00
userfaultfd.c This is the 4.9.314 stable release 2022-05-16 08:47:01 +02:00
util.c treewide: Backport new vmalloc for large performance benefits 2026-05-15 17:48:25 +07:00
vmacache.c
vmalloc.c BACKPORT: bpf: Add mmap() support for BPF_MAP_TYPE_ARRAY 2026-05-15 17:59:15 +07:00
vmpressure.c
vmscan.c Merge android-4.9.165 (72b54df) into msm-4.9 2019-05-21 17:01:55 +08:00
vmstat.c Merge branch 'android-4.9-q' of https://android.googlesource.com/kernel/common into lineage-18.1-caf-sdm845 2021-07-22 02:11:11 +03:00
workingset.c treewide: Backport new vmalloc for large performance benefits 2026-05-15 17:48:25 +07:00
z3fold.c
zbud.c
zpool.c
zsmalloc.c Merge remote-tracking branch 'common/android-4.9-q' into lineage-18.1-caf-sdm845 2021-12-27 02:07:39 +02:00
zswap.c treewide: Backport new vmalloc for large performance benefits 2026-05-15 17:48:25 +07:00