You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by GitBox <gi...@apache.org> on 2022/08/03 17:56:21 UTC

[GitHub] [trafficserver] moonchen commented on pull request #8996: Add stack guard pages

moonchen commented on PR #8996:
URL: https://github.com/apache/trafficserver/pull/8996#issuecomment-1204294044

   Frequently asked questions:
   
   **Q: How much overhead does this add?**
   
   **A:** The VM mappings cost space in the page table.  It also adds fragmentation to the page table since adjacent mappings can no longer be coalesced due to having different protection flags.
   
   **Q: Do the stack guard pages map to physical memory?**
   
   **A:** Not when I tested on Linux.  The pages are not marked as present initially.  I believe they're mapped on demand.
   
   **Q: Why did you change all stack allocations to use `mmap()`?**
   
   **A:** `mprotect()` requires that the memory be first allocated with `mmap()`.
   
   **Q: Why do you allow for more than one page of stack guard?**
   
   **A:** Stack hopping can happen where stack allocations of larger than one page in size can skip the guard page.  Having more pages of guard reduces the likelihood of this.  See [this article](https://lwn.net/Articles/725832/
   ) for more details.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org