ANDROID: 16K: Fix selinux mmap 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: I8bde000112363a0946c75a2a895a3fbdcda77c87
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
This commit is contained in:
Kalesh Singh
2024-01-16 08:55:56 -08:00
committed by Carlos Llamas
parent 7dea17008f
commit df9123472f

View File

@@ -14,6 +14,7 @@
#include <linux/kernel.h>
#include <linux/pagemap.h>
#include <linux/page_size_compat.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/fs.h>
@@ -248,7 +249,7 @@ static int sel_mmap_handle_status(struct file *filp,
BUG_ON(!status);
/* only allows one page from the head */
if (vma->vm_pgoff > 0 || size != PAGE_SIZE)
if (vma->vm_pgoff > 0 || size != __PAGE_SIZE)
return -EIO;
/* disallow writable mapping */
if (vma->vm_flags & VM_WRITE)