title: Does mmap changes flags stored in the page table?
body: <p>To the best of my knowledge,</p>
  
  <p>MMAP can be used to change a protection of mapped memory region.</p>
  
  <p>For example, If I want to add executable permission</p>
  
  <p>to one of my stack page </p>
  
  <p>which is originally set as readable and writable permission</p>
  
  <p>because of the Data execution policy(DEP).</p>
  
  <p>And this permission is reflected on the page table flags such as W/XD in x86 architecture.</p>
  
  <p>So my question is If I change the permission of the specific page using the MMAP,</p>
  
  <p>does it request the kernel change the page table flags? </p>
  
  <p>and does it automatically flush the TLB? </p>
  
  <p>Thanks.</p>