--- zzzz-none-000/linux-4.9.279/mm/mmap.c 2021-08-08 06:38:54.000000000 +0000 +++ puma7-arm-6591-750/linux-4.9.279/mm/mmap.c 2023-02-08 10:58:16.000000000 +0000 @@ -6,6 +6,11 @@ * Address space accounting code */ +/* + * Includes Intel Corporation's changes/modifications dated: 2017. + * Changed/modified portions - Copyright (c) 2017, Intel Corporation. + */ + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include @@ -1346,6 +1351,11 @@ struct mm_struct *mm = current->mm; int pkey = 0; +#ifdef CONFIG_MLOCK_APPS + if (!(prot & PROT_WRITE) && capable(CAP_IPC_LOCK)) + flags |= MAP_LOCKED; +#endif + *populate = 0; if (!len)