--- zzzz-none-000/linux-2.6.39.4/mm/mmap.c 2011-08-03 19:43:28.000000000 +0000 +++ puma6-atom-6490-729/linux-2.6.39.4/mm/mmap.c 2021-11-10 13:38:18.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. + */ + #include #include #include @@ -986,6 +991,11 @@ int error; unsigned long reqprot = prot; +#ifdef CONFIG_MLOCK_APPS + if (!(prot & PROT_WRITE) && capable(CAP_IPC_LOCK)) + flags |= MAP_LOCKED; +#endif + /* * Does the application expect PROT_READ to imply PROT_EXEC? * @@ -1684,7 +1694,7 @@ { struct mm_struct *mm = vma->vm_mm; struct rlimit *rlim = current->signal->rlim; - unsigned long new_start; + unsigned long new_start __attribute__((unused)); /* address space limit tests */ if (!may_expand_vm(mm, grow))