I have defined an upward stack in xv6 (which had a downward stack) and want to know how I put a guard page between the stack and the heap. Is there any specific system call I can make use of? Also how can I maintain that one page address space to always lie between stack and heap?
Asked
Active
Viewed 2,044 times
2

trincot
- 317,000
- 35
- 244
- 286

Mona Jalal
- 34,860
- 64
- 239
- 408
-
Also see [Qualys Security Advisory - The Stack Clash](http://www.openwall.com/lists/oss-security/2017/06/19/1) on OSS-Security mailing list. Its shows off some neat tricks, and its pretty damning of the guard page. Its amazing how many OS'es they took down with it. – jww Jun 19 '17 at 22:05
1 Answers
0
so you know exactly from where your stack start growing up? In that case, why don't you just leave one page and just start from the next page onwards. And you might need to allocate and poison the memory with some data so that it could be detected. Like the way some of these memory overrun detection tools work. or you might need to set some custom flag to that page so that while trying to access them, you can check the flag and fault if found inappropriate.
Did I get your question correctly, btw?

joe
- 1,136
- 9
- 17