On 23/06/2023 15:33, Tudor Cretu wrote:
The aio_ring buffer is a shared memory region that hosts the io_event array. The io_event struct may contain user pointers, so the memory region must be allowed to store and load capability pointers in PCuABI.
Signed-off-by: Tudor Cretu tudor.cretu@arm.com
fs/aio.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/fs/aio.c b/fs/aio.c index 8a93a9c0e59b..c48f4b9f5da6 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -478,6 +478,11 @@ static int aio_ring_mmap(struct file *file, struct vm_area_struct *vma) { vma->vm_flags |= VM_DONTEXPAND; vma->vm_ops = &aio_ring_vm_ops; +#if IS_ENABLED(CONFIG_CHERI_PURECAP_UABI)
Nit: you can simply use #ifdef CONFIG_CHERI_PURECAP_UABI. IS_ENABLED() is mainly useful in C, or for options that can be =m. This one can only be =n or =y so just checking it's defined is equivalent.
Kevin
- vma->vm_flags |= VM_READ_CAPS | VM_WRITE_CAPS;
- vma_set_page_prot(vma);
+#endif
- return 0;
}