Hi,
This patch series addresses the VM_READ_CAPS/VM_WRITE_CAPS flags issue: https://git.morello-project.org/morello/kernel/linux/-/issues/36
io_uring system uses buffers shared with userspace to read the io events and report their results. The structs that populate the submission and completion queues can contain capabilities. Shared mappings don't have the Load/Store capabilities permission to avoid leaking capabilities outside their original address space, so add two new VM flags that would allow the kernel to set up such mappings.
While at it, also fix pte_modify to allow setting PTE_*_CAPS flags, add new the new rc/wc smaps flags, and remove the automatic addition of PTE_*_CAPS to user mappings.
To note: this wouldn't allow userspace to make arbitrary shared mappings with tag access, the new VM flags would be for internal use only for the time being.
Review branch: https://git.morello-project.org/tudcre01/linux/-/commits/vm_rw_caps_v1/
Thanks, Tudor
--- Tudor Cretu (3): arm64: pgtable: Allow PTE_*_CAPS in the pte_modify mask arm64: mm: Add VM_READ_CAPS and VM_WRITE_CAPS flags arm64: mm: Use VM_*_CAPS instead of enabling PTE_*_CAPS to default user mappings
arch/arm64/Kconfig | 1 + arch/arm64/include/asm/mman.h | 19 +++++++++++++++++-- arch/arm64/include/asm/page.h | 2 +- arch/arm64/include/asm/pgtable-prot.h | 12 +++++------- arch/arm64/include/asm/pgtable.h | 2 +- fs/proc/task_mmu.c | 4 ++++ include/linux/mm.h | 9 +++++++++ 7 files changed, 38 insertions(+), 11 deletions(-)