ANDROID: 16K: ashmem: Fix size check
In page-compat mode, all VMAs are forced to be a multiple of the emulated page-size. Bug: 383389337 Bug: 315325080 Bug: 302403436 Change-Id: I5c083cedc15c6837803efa497450c4df5331968f Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
This commit is contained in:
committed by
Carlos Llamas
parent
df9123472f
commit
a1e630ea0d
@@ -20,6 +20,7 @@
|
|||||||
#include <linux/mm.h>
|
#include <linux/mm.h>
|
||||||
#include <linux/mman.h>
|
#include <linux/mman.h>
|
||||||
#include <linux/uaccess.h>
|
#include <linux/uaccess.h>
|
||||||
|
#include <linux/page_size_compat.h>
|
||||||
#include <linux/personality.h>
|
#include <linux/personality.h>
|
||||||
#include <linux/bitops.h>
|
#include <linux/bitops.h>
|
||||||
#include <linux/mutex.h>
|
#include <linux/mutex.h>
|
||||||
@@ -386,7 +387,7 @@ static int ashmem_mmap(struct file *file, struct vm_area_struct *vma)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* requested mapping size larger than object size */
|
/* requested mapping size larger than object size */
|
||||||
if (vma->vm_end - vma->vm_start > PAGE_ALIGN(asma->size)) {
|
if (vma->vm_end - vma->vm_start > __PAGE_ALIGN(asma->size)) {
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user