From 753fd239a08e331168f7fac6fed1f2c9f5632fe4 Mon Sep 17 00:00:00 2001 From: zhoushuiqing Date: Mon, 24 Jul 2023 15:08:24 +0800 Subject: [PATCH] Modify the vm_flags variable through interfaces 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. the kernel commit is https://github.com/torvalds/linux/commit/bc292ab00f6c7a661a8a605c714e8a148f629ef6 --- sgx_main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sgx_main.c b/sgx_main.c index ca52821..75951a2 100644 --- a/sgx_main.c +++ b/sgx_main.c @@ -109,9 +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; } -- 2.33.0