From a68b74a7ca524148b690fbec7eb7b387e9633841 Mon Sep 17 00:00:00 2001 From: Shui <83878803+Shuiqing321@users.noreply.github.com> Date: Mon, 24 Jul 2023 18:32:25 +0800 Subject: [PATCH] Adapting modifications for the kernel. The kernel has set the vm_flags variable as const and provided a series of interfaces to manipulate it. Therefore, it is necessary to make appropriate modifications to the code in linux-sgx-driver. --- sgx_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sgx_main.c b/sgx_main.c index ca52821..dbe344d 100644 --- a/sgx_main.c +++ b/sgx_main.c @@ -109,8 +109,8 @@ bool sgx_has_sgx2; static int sgx_mmap(struct file *file, struct vm_area_struct *vma) { vma->vm_ops = &sgx_vm_ops; - vma->vm_flags |= VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP | VM_IO | - VM_DONTCOPY; + vm_flags_set(vma, VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP | VM_IO | + VM_DONTCOPY); return 0; }