From 57bbcef534aa020c8f40530afea210c790143680 Mon Sep 17 00:00:00 2001 From: Kalesh Singh Date: Wed, 31 Jul 2024 01:15:27 -0700 Subject: [PATCH] ANDROID: 16K: Ensure mseal start and len are 16kB multiples For 16kB page size emulation in x86_64, ensure that mseal() operates on regions that are __PAGE_SIZE multiple sized and aligned. Bug: 383389337 Bug: 356480574 Change-Id: I0bc25a0090637b51558050764010a6e24275a2bb Signed-off-by: Kalesh Singh --- mm/mseal.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mm/mseal.c b/mm/mseal.c index 81d6e980e8a9..0e0531ee0042 100644 --- a/mm/mseal.c +++ b/mm/mseal.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include "internal.h" @@ -222,10 +223,10 @@ int do_mseal(unsigned long start, size_t len_in, unsigned long flags) return ret; start = untagged_addr(start); - if (!PAGE_ALIGNED(start)) + if (!__PAGE_ALIGNED(start)) return -EINVAL; - len = PAGE_ALIGN(len_in); + len = __PAGE_ALIGN(len_in); /* Check to see whether len was rounded up from small -ve to zero. */ if (len_in && !len) return -EINVAL;