On Fri, Aug 23, 2019 at 06:02:48PM +0300, Jarkko Sakkinen wrote: > Hi > > Couple of remarks that are not reasoned in the code too well: > > 1. Why to allow to mmap() to a range where pages have differing > permissions? I think it would be better just to require all > pages in a range to have the same permissions. You mean different vm_max_prot_bits? I don't think we should deny mapping a mix of R and RW pages with PROT_READ, e.g. map read-only but have the option to make select pages writable in the future. > 2. Why not require exact match with the PROT bits? Toggling W in particular in the PTEs likely has value, e.g. initialize data with runtime info and then lock the range in the PTEs.