Merge pull request #9 from morphis/fix-sigbus-with-newer-kernels

staging: ashmem: Fix SIGBUS crash when traversing mmaped ashmem pages
This commit is contained in:
Simon Fels 2018-09-02 12:20:21 +02:00 committed by GitHub
commit 5061f6e5cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -419,7 +419,13 @@ static int ashmem_mmap(struct file *file, struct vm_area_struct *vma)
fput(asma->file); fput(asma->file);
goto out; goto out;
} }
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0)
} else {
vma_set_anonymous(vma);
} }
#else
}
#endif
if (vma->vm_file) if (vma->vm_file)
fput(vma->vm_file); fput(vma->vm_file);