From df9123472ff8f6a5ee847dca8403e4f1eeba2870 Mon Sep 17 00:00:00 2001 From: Kalesh Singh Date: Tue, 16 Jan 2024 08:55:56 -0800 Subject: [PATCH] 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 --- security/selinux/selinuxfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c index e172f182b65c..8acbaa4f2cb5 100644 --- a/security/selinux/selinuxfs.c +++ b/security/selinux/selinuxfs.c @@ -14,6 +14,7 @@ #include #include +#include #include #include #include @@ -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)