Added conditional matching for kernels >= 6.3.0

This commit is contained in:
musover 2023-12-03 18:18:36 +01:00 committed by Christian Hoff
parent 41fe6db44a
commit 084d19950a
1 changed files with 5 additions and 1 deletions

View File

@ -390,7 +390,11 @@ static int ashmem_mmap(struct file *file, struct vm_area_struct *vma)
ret = -EPERM; ret = -EPERM;
goto out; goto out;
} }
vm_flags_clear(vma, calc_vm_may_flags(~asma->prot_mask)); #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)
vm_flags_clear(vma, calc_vm_may_flags(~asma->prot_mask));
#else
vma->vm_flags &= ~calc_vm_may_flags(~asma->prot_mask);
#endif
if (!asma->file) { if (!asma->file) {
char *name = ASHMEM_NAME_DEF; char *name = ASHMEM_NAME_DEF;